FEATURE: Allow private themes to be partially installed (#17644)

A public key must be added to GitHub when installing private themes.
When the process happens asynchronously (for example if the admin does
not have admin permissions to the GitHub repository), installing
private themes becomes very difficult.

In this case, the Discourse admin can partially install the theme by
letting Discourse save the private key, create a placeholder theme and
give the admin a public key to be used as a deploy key. After the key
is installed, the admin can finish theme installation by pressing a
button on the theme page.
This commit is contained in:
Bianca Nenciu
2022-08-10 13:30:18 +03:00
committed by GitHub
parent cc84ea2444
commit e029a9b36c
10 changed files with 617 additions and 261 deletions

View File

@ -167,6 +167,15 @@ export default Controller.extend({
return errorMessage && !updating;
},
@discourseComputed(
"model.remote_theme.remote_url",
"model.remote_theme.local_version",
"model.remote_theme.commits_behind"
)
finishInstall(remoteUrl, localVersion, commitsBehind) {
return remoteUrl && !localVersion && !commitsBehind;
},
editedFieldsForTarget(target) {
return this.get("model.editedFields").filter(
(field) => field.target === target