diff options
Diffstat (limited to 'app/assets/javascripts/crm/organizations/components/organization_form_wrapper.vue')
-rw-r--r-- | app/assets/javascripts/crm/organizations/components/organization_form_wrapper.vue | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/app/assets/javascripts/crm/organizations/components/organization_form_wrapper.vue b/app/assets/javascripts/crm/organizations/components/organization_form_wrapper.vue index 38468e1f4e4..5fd0294b0ea 100644 --- a/app/assets/javascripts/crm/organizations/components/organization_form_wrapper.vue +++ b/app/assets/javascripts/crm/organizations/components/organization_form_wrapper.vue @@ -52,16 +52,23 @@ export default { additionalCreateParams() { return { groupId: this.groupGraphQLId }; }, - }, - fields: [ - { name: 'name', label: __('Name'), required: true }, - { - name: 'defaultRate', - label: s__('Crm|Default rate'), - input: { type: 'number', step: '0.01' }, + fields() { + const fields = [ + { name: 'name', label: __('Name'), required: true }, + { + name: 'defaultRate', + label: s__('Crm|Default rate'), + input: { type: 'number', step: '0.01' }, + }, + { name: 'description', label: __('Description') }, + ]; + + if (this.isEditMode) + fields.push({ name: 'active', label: s__('Crm|Active'), required: true, bool: true }); + + return fields; }, - { name: 'description', label: __('Description') }, - ], + }, }; </script> @@ -73,7 +80,7 @@ export default { :mutation="mutation" :additional-create-params="additionalCreateParams" :existing-id="organizationGraphQLId" - :fields="$options.fields" + :fields="fields" :title="title" :success-message="successMessage" /> |