Thanks to visit codestin.com
Credit goes to github.com

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

Fixing validation display on Create Repository dialog #2308

Merged
merged 5 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ public RepositoryCreationViewModel(
return parsedReference != repoName ? String.Format(CultureInfo.CurrentCulture, Resources.SafeRepositoryNameWarning, parsedReference) : null;
});

this.WhenAny(x => x.BaseRepositoryPathValidator.ValidationResult, x => x.Value)
.Subscribe();

CreateRepository = InitializeCreateRepositoryCommand();

isCreating = CreateRepository.IsExecuting
Expand Down
40 changes: 23 additions & 17 deletions src/GitHub.VisualStudio.UI/Views/Dialog/RepositoryCreationView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Grid.RowDefinitions>
<RowDefinition Height="35" />
<RowDefinition Height="Auto" />
<RowDefinition Height="35" />
<RowDefinition Height="35" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="35" />
<RowDefinition Height="*" />
<RowDefinition Height="35" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<Label Grid.Row="0"
Grid.Column="0"
Expand All @@ -107,17 +107,21 @@
Grid.Column="1"
MaxLength="{x:Static ghfvs:Constants.MaxRepositoryNameLength}"
Text="{Binding RepositoryName, UpdateSourceTrigger=PropertyChanged}"
SpellCheck.IsEnabled="True"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like spell checking has been disabled. Was this by design?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I disabled it, when I couldn't type VisualStudio without it calling that an error, I decided that it was not useful...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol, makes sense. Though I'm perfectly capable of misspelling the name of my repo. 😉

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It look like dotcom also has spell checking disabled fro this field.

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.RepositoryNameTextBox}" />

<StackPanel Grid.Row="1" Grid.Column="1">
<ghfvs:ValidationMessage x:Name="nameValidationMessage" ValidatesControl="{Binding ElementName=nameText}" />
<ghfvs:ValidationMessage x:Name="nameValidationMessage"
Style="{DynamicResource InlineValidationMessage}"
ValidatesControl="{Binding ElementName=nameText}"
ReactiveValidator="{Binding RepositoryNameValidator, Mode=OneWay}"/>

<ghfvs:ValidationMessage x:Name="safeRepositoryNameWarning"
ErrorAdornerTemplate="None"
Fill="#f39c12"
Icon="alert"
Style="{DynamicResource InlineValidationMessage}"
ValidatesControl="{Binding ElementName=nameText}" />
ValidatesControl="{Binding ElementName=nameText}"
ReactiveValidator="{Binding SafeRepositoryNameWarningValidator, Mode=OneWay}" />
</StackPanel>

<Label Grid.Row="2"
Expand Down Expand Up @@ -162,7 +166,9 @@
<ghfvs:ValidationMessage x:Name="pathValidationMessage"
Grid.Row="4"
Grid.Column="1"
ValidatesControl="{Binding ElementName=localPathText}" />
Style="{DynamicResource InlineValidationMessage}"
ValidatesControl="{Binding ElementName=localPathText}"
ReactiveValidator="{Binding BaseRepositoryPathValidator, Mode=OneWay}" />

<Label Grid.Row="5"
Grid.Column="0"
Expand Down