Skip to content
Snippets Groups Projects
Commit 12efbac9 authored by ml bonhomme's avatar ml bonhomme :bee: Committed by Erwan Rouchet
Browse files

Disable Save button while creating a new configuration

parent 2c9bf430
No related branches found
No related tags found
1 merge request!1303Disable Save button while creating a new configuration
......@@ -152,7 +152,9 @@ export default {
// If a configuration ID is set, we must have this configuration in the store
!this.selectedConfigurationId === !this.selectedConfiguration &&
// Do not allow saving the currently selected worker configuration if said configuration is archived
!this.selectedConfiguration?.archived
!this.selectedConfiguration?.archived &&
// Do not allow saving while the configuration creation form is active
!this.configCreate
},
canToggleArchive () {
// This cannot check that the user has enough rights on the worker or the repository, because the API does not provide that anywhere.
......@@ -177,7 +179,9 @@ export default {
}
},
saveButtonTitle () {
if (this.canSave) return 'Select this configuration'
if (this.canSave && this.selectedConfigurationId) return 'Select this configuration.'
if (!this.selectedConfigurationId && this.configurationId) return `Remove configuration ${this.workerConfigurations[this.workerId][this.configurationId].name}.`
if (this.configCreate) return 'Create the new configuration first, or select an existing configuration to use.'
if (this.loading) return 'Loading…'
if (this.selectedConfiguration?.archived) return 'An archived configuration cannot be selected in a process.'
return null
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment