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

Commit 47002f5

Browse files
committed
Removed DefaultRepositoryName
From `IRepositoryPublishViewModel`. Seems to not be needed and was causing #279. The default repository name was being placed directly into `RepositoryPublishControl.nameText` in the control which meant: - it was only written to `RepositoryName` when the user clicked on the `nameText` control - which meant that `RepositoryName` was up until that point null - which meant that the validation for it was failing - which meant the "Publish" button was disabled. This commit just sets the `RepositoryName` to the default in the VM ctor meaning that that name gets immediately validated. `DefaultRepositoryName` didn't seem to be used anywhere else, so I removed it. cc: @haacked for a sanity check because it looks like you wrote this. Fixes #279
1 parent 2f0753f commit 47002f5

File tree

4 files changed

+1
-17
lines changed

4 files changed

+1
-17
lines changed

src/GitHub.App/SampleData/SampleViewModels.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,6 @@ public RepositoryPublishViewModelDesigner()
232232
SelectedConnection = Connections[0];
233233
}
234234

235-
public string DefaultRepositoryName
236-
{
237-
get
238-
{
239-
return "whatever";
240-
}
241-
}
242-
243235
public bool IsHostComboBoxVisible
244236
{
245237
get

src/GitHub.App/ViewModels/RepositoryPublishViewModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public RepositoryPublishViewModel(
9191

9292
var defaultRepositoryName = repositoryPublishService.LocalRepositoryName;
9393
if (!string.IsNullOrEmpty(defaultRepositoryName))
94-
DefaultRepositoryName = defaultRepositoryName;
94+
RepositoryName = defaultRepositoryName;
9595

9696
this.WhenAny(x => x.SelectedConnection, x => x.SelectedAccount,
9797
(a,b) => true)
@@ -106,7 +106,6 @@ public RepositoryPublishViewModel(
106106
});
107107
}
108108

109-
public string DefaultRepositoryName { get; private set; }
110109
public new string Title { get { return title.Value; } }
111110
public bool CanKeepPrivate { get { return canKeepPrivate.Value; } }
112111
public bool IsPublishing { get { return isPublishing.Value; } }

src/GitHub.Exports.Reactive/ViewModels/IRepositoryPublishViewModel.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ public interface IRepositoryPublishViewModel : IRepositoryForm
2828
/// The selected host to publish to.
2929
/// </summary>
3030
IConnection SelectedConnection { get; set; }
31-
32-
/// <summary>
33-
/// Sets the default repository name when prepopulating the form.
34-
/// </summary>
35-
string DefaultRepositoryName { get; }
3631
}
3732

3833
public enum ProgressState

src/GitHub.VisualStudio/UI/Views/Controls/RepositoryPublishControl.xaml.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ public RepositoryPublishControl(ITeamExplorerServices teServices, INotificationD
5757
else
5858
teServices.ClearNotifications();
5959
}));
60-
61-
nameText.Text = ViewModel.DefaultRepositoryName;
6260
});
6361
IsVisibleChanged += (s, e) =>
6462
{

0 commit comments

Comments
 (0)