UX: Switch placeholder to an SSH url if importing a private theme

This commit is contained in:
Rishabh
2018-12-20 17:01:38 +05:30
parent a06d310855
commit 3d2c72dd33
2 changed files with 6 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
checkPrivate: Ember.computed.match("uploadUrl", /^git/),
localFile: null,
uploadUrl: null,
urlPlaceholder: "https://github.com/discourse/sample_theme",
@computed("loading", "remote", "uploadUrl", "local", "localFile")
importDisabled(isLoading, isRemote, uploadUrl, isLocal, localFile) {
@@ -25,6 +26,10 @@ export default Ember.Controller.extend(ModalFunctionality, {
@observes("privateChecked")
privateWasChecked() {
this.get("privateChecked")
? this.set("urlPlaceholder", "git@github.com:discourse/sample_theme.git")
: this.set("urlPlaceholder", "https://github.com/discourse/sample_theme");
const checked = this.get("privateChecked");
if (checked && !this._keyLoading) {
this._keyLoading = true;