diff options
Diffstat (limited to 'app/assets')
20 files changed, 101 insertions, 91 deletions
diff --git a/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_drawer.vue b/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_drawer.vue index ad4b7b790d0..1f583a47ec0 100644 --- a/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_drawer.vue +++ b/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_drawer.vue @@ -44,6 +44,8 @@ export const i18n = { cancel: __('Cancel'), defaultScope: __('All (default)'), deleteVariable: s__('CiVariables|Delete variable'), + description: __('Description'), + descriptionHelpText: s__("CiVariables|The description of the variable's value or usage."), editVariable: s__('CiVariables|Edit variable'), saveVariable: __('Save changes'), environments: __('Environments'), @@ -459,6 +461,21 @@ export default { </p> </gl-form-checkbox> </gl-form-group> + <gl-form-group + label-for="ci-variable-description" + :label="$options.i18n.description" + class="gl-border-none gl-mb-n5" + data-testid="ci-variable-description-label" + :description="$options.i18n.descriptionHelpText" + optional + > + <gl-form-input + id="ci-variable-description" + v-model="variable.description" + class="gl-border-none" + data-testid="ci-variable-description" + /> + </gl-form-group> <gl-form-combobox v-model="variable.key" :token-list="$options.awsTokenList" diff --git a/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_table.vue b/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_table.vue index 901bd39930a..025e5a4795b 100644 --- a/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_table.vue +++ b/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_table.vue @@ -278,35 +278,40 @@ export default { <col v-for="field in scope.fields" :key="field.key" :style="field.customStyle" /> </template> <template #cell(key)="{ item }"> - <div - class="gl-display-flex gl-align-items-flex-start gl-justify-content-end gl-md-justify-content-start gl-mr-n3" - > - <span - :id="`ci-variable-key-${item.id}`" - class="gl-display-inline-block gl-max-w-full gl-word-break-word" - >{{ item.key }}</span - > - <gl-button - v-gl-tooltip - category="tertiary" - icon="copy-to-clipboard" - class="gl-my-n2 gl-ml-2" - size="small" - :title="__('Copy key')" - :data-clipboard-text="item.key" - :aria-label="__('Copy to clipboard')" - /> - </div> - <div data-testid="ci-variable-table-row-attributes" class="gl-mt-2"> - <gl-badge - v-for="attribute in item.attributes" - :key="`${item.key}-${attribute}`" - class="gl-mr-2" - variant="info" - size="sm" + <div data-testid="ci-variable-table-row-variable"> + <div + class="gl-display-flex gl-align-items-flex-start gl-justify-content-end gl-md-justify-content-start gl-mr-n3" > - {{ attribute }} - </gl-badge> + <span + :id="`ci-variable-key-${item.id}`" + class="gl-display-inline-block gl-max-w-full gl-word-break-word" + >{{ item.key }}</span + > + <gl-button + v-gl-tooltip + category="tertiary" + icon="copy-to-clipboard" + class="gl-my-n2 gl-ml-2" + size="small" + :title="__('Copy key')" + :data-clipboard-text="item.key" + :aria-label="__('Copy to clipboard')" + /> + </div> + <div v-if="item.description" class="gl-mt-2 gl-text-secondary gl-font-sm"> + {{ item.description }} + </div> + <div data-testid="ci-variable-table-row-attributes" class="gl-mt-2"> + <gl-badge + v-for="attribute in item.attributes" + :key="`${item.key}-${attribute}`" + class="gl-mr-2" + variant="info" + size="sm" + > + {{ attribute }} + </gl-badge> + </div> </div> </template> <template v-if="!isInheritedGroupVars" #cell(value)="{ item }"> diff --git a/app/assets/javascripts/ci/ci_variable_list/constants.js b/app/assets/javascripts/ci/ci_variable_list/constants.js index c4f92fed829..47b8b46afe9 100644 --- a/app/assets/javascripts/ci/ci_variable_list/constants.js +++ b/app/assets/javascripts/ci/ci_variable_list/constants.js @@ -19,6 +19,7 @@ export const variableOptions = [ ]; export const defaultVariableState = { + description: null, environmentScope: '*', key: '', masked: false, diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/fragments/ci_group_variable.fragment.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/fragments/ci_group_variable.fragment.graphql new file mode 100644 index 00000000000..a97eeac9ca3 --- /dev/null +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/fragments/ci_group_variable.fragment.graphql @@ -0,0 +1,7 @@ +fragment BaseCiGroupVariable on CiGroupVariable { + description + environmentScope + masked + protected + raw +} diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/fragments/ci_instance_variable.fragment.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/fragments/ci_instance_variable.fragment.graphql new file mode 100644 index 00000000000..fbf18b19c11 --- /dev/null +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/fragments/ci_instance_variable.fragment.graphql @@ -0,0 +1,6 @@ +fragment BaseCiInstanceVariable on CiInstanceVariable { + description + protected + masked + raw +} diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/fragments/ci_project_variable.fragment.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/fragments/ci_project_variable.fragment.graphql new file mode 100644 index 00000000000..6e2335b7621 --- /dev/null +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/fragments/ci_project_variable.fragment.graphql @@ -0,0 +1,7 @@ +fragment BaseCiProjectVariable on CiProjectVariable { + description + environmentScope + masked + protected + raw +} diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_add_variable.mutation.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_add_variable.mutation.graphql index d6f3ddf086f..fba681a1ac3 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_add_variable.mutation.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_add_variable.mutation.graphql @@ -1,14 +1,12 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_instance_variable.fragment.graphql" mutation addAdminVariable($variable: CiVariable!, $endpoint: String!) { ciVariableMutation: addAdminVariable(variable: $variable, endpoint: $endpoint) @client { ciVariables { nodes { ...BaseCiVariable - ... on CiInstanceVariable { - protected - masked - } + ...BaseCiInstanceVariable } } errors diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_delete_variable.mutation.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_delete_variable.mutation.graphql index c00c8fb2a26..891dd86a1f5 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_delete_variable.mutation.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_delete_variable.mutation.graphql @@ -1,14 +1,12 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_instance_variable.fragment.graphql" mutation deleteAdminVariable($variable: CiVariable!, $endpoint: String!) { ciVariableMutation: deleteAdminVariable(variable: $variable, endpoint: $endpoint) @client { ciVariables { nodes { ...BaseCiVariable - ... on CiInstanceVariable { - protected - masked - } + ...BaseCiInstanceVariable } } errors diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_update_variable.mutation.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_update_variable.mutation.graphql index d7b7cb77291..157a2d5f374 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_update_variable.mutation.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/admin_update_variable.mutation.graphql @@ -1,14 +1,12 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_instance_variable.fragment.graphql" mutation updateAdminVariable($variable: CiVariable!, $endpoint: String!) { ciVariableMutation: updateAdminVariable(variable: $variable, endpoint: $endpoint) @client { ciVariables { nodes { ...BaseCiVariable - ... on CiInstanceVariable { - protected - masked - } + ...BaseCiInstanceVariable } } errors diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_add_variable.mutation.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_add_variable.mutation.graphql index 0dbb6c891fd..29d1291c244 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_add_variable.mutation.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_add_variable.mutation.graphql @@ -1,4 +1,5 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_group_variable.fragment.graphql" mutation addGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPath: ID!, $id: ID!) { ciVariableMutation: addGroupVariable( @@ -12,12 +13,7 @@ mutation addGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPath: ciVariables { nodes { ...BaseCiVariable - ... on CiGroupVariable { - environmentScope - masked - protected - raw - } + ...BaseCiGroupVariable } } } diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_delete_variable.mutation.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_delete_variable.mutation.graphql index b5d007237c8..b2420534ba5 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_delete_variable.mutation.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_delete_variable.mutation.graphql @@ -1,4 +1,5 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_group_variable.fragment.graphql" mutation deleteGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPath: ID!, $id: ID!) { ciVariableMutation: deleteGroupVariable( @@ -12,12 +13,7 @@ mutation deleteGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPa ciVariables { nodes { ...BaseCiVariable - ... on CiGroupVariable { - environmentScope - masked - protected - raw - } + ...BaseCiGroupVariable } } } diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_update_variable.mutation.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_update_variable.mutation.graphql index 4ffc091b490..7ba0a9c49fd 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_update_variable.mutation.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/group_update_variable.mutation.graphql @@ -1,4 +1,5 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_group_variable.fragment.graphql" mutation updateGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPath: ID!, $id: ID!) { ciVariableMutation: updateGroupVariable( @@ -12,12 +13,7 @@ mutation updateGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPa ciVariables { nodes { ...BaseCiVariable - ... on CiGroupVariable { - environmentScope - masked - protected - raw - } + ...BaseCiGroupVariable } } } diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_add_variable.mutation.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_add_variable.mutation.graphql index 67a02be3dc1..ab349514dfd 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_add_variable.mutation.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_add_variable.mutation.graphql @@ -1,4 +1,5 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_project_variable.fragment.graphql" mutation addProjectVariable($variable: CiVariable!, $endpoint: String!, $fullPath: ID!, $id: ID!) { ciVariableMutation: addProjectVariable( @@ -12,12 +13,7 @@ mutation addProjectVariable($variable: CiVariable!, $endpoint: String!, $fullPat ciVariables { nodes { ...BaseCiVariable - ... on CiProjectVariable { - environmentScope - masked - protected - raw - } + ...BaseCiProjectVariable } } } diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_delete_variable.mutation.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_delete_variable.mutation.graphql index 4420404a7b4..281bef88f45 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_delete_variable.mutation.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_delete_variable.mutation.graphql @@ -1,4 +1,5 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_project_variable.fragment.graphql" mutation deleteProjectVariable( $variable: CiVariable! @@ -17,12 +18,7 @@ mutation deleteProjectVariable( ciVariables { nodes { ...BaseCiVariable - ... on CiProjectVariable { - environmentScope - masked - protected - raw - } + ...BaseCiProjectVariable } } } diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_update_variable.mutation.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_update_variable.mutation.graphql index 107746a19e9..5af4f4d9862 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_update_variable.mutation.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/mutations/project_update_variable.mutation.graphql @@ -1,4 +1,5 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_project_variable.fragment.graphql" mutation updateProjectVariable( $variable: CiVariable! @@ -17,12 +18,7 @@ mutation updateProjectVariable( ciVariables { nodes { ...BaseCiVariable - ... on CiProjectVariable { - environmentScope - masked - protected - raw - } + ...BaseCiProjectVariable } } } diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/queries/group_variables.query.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/queries/group_variables.query.graphql index 4a64a24573e..65179ede072 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/queries/group_variables.query.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/queries/group_variables.query.graphql @@ -1,4 +1,5 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_group_variable.fragment.graphql" #import "~/graphql_shared/fragments/page_info.fragment.graphql" query getGroupVariables( @@ -18,12 +19,7 @@ query getGroupVariables( } nodes { ...BaseCiVariable - ... on CiGroupVariable { - environmentScope - masked - protected - raw - } + ...BaseCiGroupVariable } } } diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/queries/project_variables.query.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/queries/project_variables.query.graphql index 03a7142080b..2b91cfa8c18 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/queries/project_variables.query.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/queries/project_variables.query.graphql @@ -1,4 +1,5 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_project_variable.fragment.graphql" #import "~/graphql_shared/fragments/page_info.fragment.graphql" query getProjectVariables( @@ -18,10 +19,7 @@ query getProjectVariables( } nodes { ...BaseCiVariable - environmentScope - masked - protected - raw + ...BaseCiProjectVariable } } } diff --git a/app/assets/javascripts/ci/ci_variable_list/graphql/queries/variables.query.graphql b/app/assets/javascripts/ci/ci_variable_list/graphql/queries/variables.query.graphql index adf539a44ae..42dedc462ea 100644 --- a/app/assets/javascripts/ci/ci_variable_list/graphql/queries/variables.query.graphql +++ b/app/assets/javascripts/ci/ci_variable_list/graphql/queries/variables.query.graphql @@ -1,4 +1,5 @@ #import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql" +#import "~/ci/ci_variable_list/graphql/fragments/ci_instance_variable.fragment.graphql" #import "~/graphql_shared/fragments/page_info.fragment.graphql" query getVariables( @@ -14,11 +15,7 @@ query getVariables( } nodes { ...BaseCiVariable - ... on CiInstanceVariable { - masked - protected - raw - } + ...BaseCiInstanceVariable } } } diff --git a/app/assets/javascripts/ci/inherited_ci_variables/graphql/queries/inherited_ci_variables.query.graphql b/app/assets/javascripts/ci/inherited_ci_variables/graphql/queries/inherited_ci_variables.query.graphql index 9fac461a47d..9f7c885a39d 100644 --- a/app/assets/javascripts/ci/inherited_ci_variables/graphql/queries/inherited_ci_variables.query.graphql +++ b/app/assets/javascripts/ci/inherited_ci_variables/graphql/queries/inherited_ci_variables.query.graphql @@ -10,6 +10,7 @@ query getInheritedCiVariables($after: String, $first: Int, $fullPath: ID!) { nodes { id key + description variableType environmentScope groupCiCdSettingsPath diff --git a/app/assets/javascripts/vue_shared/directives/safe_html.js b/app/assets/javascripts/vue_shared/directives/safe_html.js index c731f742771..fd76b68b083 100644 --- a/app/assets/javascripts/vue_shared/directives/safe_html.js +++ b/app/assets/javascripts/vue_shared/directives/safe_html.js @@ -19,7 +19,12 @@ const transform = (el, binding) => { } }; +const clear = (el) => { + el.textContent = ''; +}; + export default { bind: transform, update: transform, + unbind: clear, }; |