Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 95b1264

Browse files
Jasminepaladique
authored andcommitted
Rename repo path validation in resx to share between creation and clone
1 parent 2d643f2 commit 95b1264

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

src/GitHub.App/Resources.Designer.cs

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GitHub.App/Resources.resx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,16 @@
180180
<data name="RepositoryCloneFailedNoSelectedRepo" xml:space="preserve">
181181
<value>No selected repository.</value>
182182
</data>
183-
<data name="RepositoryClonePathInvalid" xml:space="preserve">
183+
<data name="RepositoryCreationClonePathEmpty" xml:space="preserve">
184+
<value>Please enter a repository path</value>
185+
</data>
186+
<data name="RepositoryCreationClonePathInvalid" xml:space="preserve">
184187
<value>Please enter a valid path</value>
185188
</data>
186-
<data name="RepositoryClonePathInvalidCharacters" xml:space="preserve">
189+
<data name="RepositoryCreationClonePathInvalidCharacters" xml:space="preserve">
187190
<value>Path contains invalid characters</value>
188191
</data>
189-
<data name="RepositoryClonePathTooLong" xml:space="preserve">
192+
<data name="RepositoryCreationClonePathTooLong" xml:space="preserve">
190193
<value>Path too long</value>
191194
</data>
192195
<data name="RepositoryCreationFailedAlreadyExists" xml:space="preserve">
@@ -198,9 +201,6 @@
198201
<data name="RepositoryCreationFailedQuota" xml:space="preserve">
199202
<value>Exceeded private repositories quota.</value>
200203
</data>
201-
<data name="RepositoryCreationPathEmpty" xml:space="preserve">
202-
<value>Please enter a repository path</value>
203-
</data>
204204
<data name="RepositoryNameValidatorAlreadyExists" xml:space="preserve">
205205
<value>Repository with same name already exists at this location</value>
206206
</data>

src/GitHub.App/ViewModels/RepositoryCloneViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ public RepositoryCloneViewModel(
9393
(x, y) => x.Value);
9494

9595
BaseRepositoryPathValidator = ReactivePropertyValidator.ForObservable(baseRepositoryPath)
96-
.IfNullOrEmpty(Resources.RepositoryCreationPathEmpty)
97-
.IfTrue(x => x.Length > 200, Resources.RepositoryClonePathTooLong)
98-
.IfContainsInvalidPathChars(Resources.RepositoryClonePathInvalidCharacters)
99-
.IfPathNotRooted(Resources.RepositoryClonePathInvalid)
96+
.IfNullOrEmpty(Resources.RepositoryCreationClonePathEmpty)
97+
.IfTrue(x => x.Length > 200, Resources.RepositoryCreationClonePathTooLong)
98+
.IfContainsInvalidPathChars(Resources.RepositoryCreationClonePathInvalidCharacters)
99+
.IfPathNotRooted(Resources.RepositoryCreationClonePathInvalid)
100100
.IfTrue(IsAlreadyRepoAtPath, Resources.RepositoryNameValidatorAlreadyExists);
101101

102102
var canCloneObservable = this.WhenAny(

src/GitHub.App/ViewModels/RepositoryCreationViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ public RepositoryCreationViewModel(
7676
browseForDirectoryCommand.Subscribe(_ => ShowBrowseForDirectoryDialog());
7777

7878
BaseRepositoryPathValidator = ReactivePropertyValidator.ForObservable(this.WhenAny(x => x.BaseRepositoryPath, x => x.Value))
79-
.IfNullOrEmpty("Please enter a repository path")
80-
.IfTrue(x => x.Length > 200, "Path too long")
81-
.IfContainsInvalidPathChars("Path contains invalid characters")
82-
.IfPathNotRooted("Please enter a valid path");
79+
.IfNullOrEmpty(Resources.RepositoryCreationClonePathEmpty)
80+
.IfTrue(x => x.Length > 200, Resources.RepositoryCreationClonePathTooLong)
81+
.IfContainsInvalidPathChars(Resources.RepositoryCreationClonePathInvalidCharacters)
82+
.IfPathNotRooted(Resources.RepositoryCreationClonePathInvalid);
8383

8484
var nonNullRepositoryName = this.WhenAny(
8585
x => x.RepositoryName,

0 commit comments

Comments
 (0)