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

Commit 56c347b

Browse files
authored
Merge pull request #2308 from github/fixes/repository-creation-view-errors
Fixing validation on create repository dialog
2 parents 242c91d + 6c261a9 commit 56c347b

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

src/GitHub.App/ViewModels/Dialog/RepositoryCreationViewModel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ public RepositoryCreationViewModel(
9090
return parsedReference != repoName ? String.Format(CultureInfo.CurrentCulture, Resources.SafeRepositoryNameWarning, parsedReference) : null;
9191
});
9292

93-
this.WhenAny(x => x.BaseRepositoryPathValidator.ValidationResult, x => x.Value)
94-
.Subscribe();
95-
9693
CreateRepository = InitializeCreateRepositoryCommand();
9794

9895
isCreating = CreateRepository.IsExecuting

src/GitHub.VisualStudio.UI/Views/Dialog/RepositoryCreationView.xaml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@
8484
<ColumnDefinition Width="*" />
8585
</Grid.ColumnDefinitions>
8686

87-
<Grid.RowDefinitions>
88-
<RowDefinition Height="35" />
89-
<RowDefinition Height="Auto" />
90-
<RowDefinition Height="35" />
91-
<RowDefinition Height="35" />
92-
<RowDefinition Height="Auto" />
93-
<RowDefinition Height="Auto" />
94-
<RowDefinition Height="Auto" />
95-
<RowDefinition Height="Auto" />
96-
<RowDefinition Height="Auto" />
97-
<RowDefinition Height="Auto" />
98-
<RowDefinition Height="Auto" />
99-
</Grid.RowDefinitions>
87+
<Grid.RowDefinitions>
88+
<RowDefinition Height="35" />
89+
<RowDefinition Height="*" />
90+
<RowDefinition Height="35" />
91+
<RowDefinition Height="Auto" />
92+
<RowDefinition Height="*" />
93+
<RowDefinition Height="Auto" />
94+
<RowDefinition Height="Auto" />
95+
<RowDefinition Height="Auto" />
96+
<RowDefinition Height="Auto" />
97+
<RowDefinition Height="Auto" />
98+
<RowDefinition Height="Auto" />
99+
</Grid.RowDefinitions>
100100

101101
<Label Grid.Row="0"
102102
Grid.Column="0"
@@ -107,17 +107,21 @@
107107
Grid.Column="1"
108108
MaxLength="{x:Static ghfvs:Constants.MaxRepositoryNameLength}"
109109
Text="{Binding RepositoryName, UpdateSourceTrigger=PropertyChanged}"
110-
SpellCheck.IsEnabled="True"
111110
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.RepositoryNameTextBox}" />
112111

113112
<StackPanel Grid.Row="1" Grid.Column="1">
114-
<ghfvs:ValidationMessage x:Name="nameValidationMessage" ValidatesControl="{Binding ElementName=nameText}" />
113+
<ghfvs:ValidationMessage x:Name="nameValidationMessage"
114+
Style="{DynamicResource InlineValidationMessage}"
115+
ValidatesControl="{Binding ElementName=nameText}"
116+
ReactiveValidator="{Binding RepositoryNameValidator, Mode=OneWay}"/>
117+
115118
<ghfvs:ValidationMessage x:Name="safeRepositoryNameWarning"
116119
ErrorAdornerTemplate="None"
117120
Fill="#f39c12"
118121
Icon="alert"
119122
Style="{DynamicResource InlineValidationMessage}"
120-
ValidatesControl="{Binding ElementName=nameText}" />
123+
ValidatesControl="{Binding ElementName=nameText}"
124+
ReactiveValidator="{Binding SafeRepositoryNameWarningValidator, Mode=OneWay}" />
121125
</StackPanel>
122126

123127
<Label Grid.Row="2"
@@ -162,7 +166,9 @@
162166
<ghfvs:ValidationMessage x:Name="pathValidationMessage"
163167
Grid.Row="4"
164168
Grid.Column="1"
165-
ValidatesControl="{Binding ElementName=localPathText}" />
169+
Style="{DynamicResource InlineValidationMessage}"
170+
ValidatesControl="{Binding ElementName=localPathText}"
171+
ReactiveValidator="{Binding BaseRepositoryPathValidator, Mode=OneWay}" />
166172

167173
<Label Grid.Row="5"
168174
Grid.Column="0"

0 commit comments

Comments
 (0)