Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/ci/pipeline_schedules')
-rw-r--r--app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules_empty_state.vue1
-rw-r--r--app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules_form.vue38
-rw-r--r--app/assets/javascripts/ci/pipeline_schedules/components/table/cells/pipeline_schedule_target.vue7
-rw-r--r--app/assets/javascripts/ci/pipeline_schedules/components/take_ownership_modal_legacy.vue50
4 files changed, 19 insertions, 77 deletions
diff --git a/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules_empty_state.vue b/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules_empty_state.vue
index fbdb60f61f1..f701bedc74d 100644
--- a/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules_empty_state.vue
+++ b/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules_empty_state.vue
@@ -41,6 +41,7 @@ export default {
<template>
<gl-empty-state
:svg-path="$options.SCHEDULE_MD_SVG_URL"
+ :svg-height="150"
:primary-button-text="$options.i18n.createNew"
:primary-button-link="newSchedulePath"
>
diff --git a/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules_form.vue b/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules_form.vue
index 396ff9808f2..0c3ede47015 100644
--- a/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules_form.vue
+++ b/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules_form.vue
@@ -1,8 +1,7 @@
<script>
import {
GlButton,
- GlDropdown,
- GlDropdownItem,
+ GlCollapsibleListbox,
GlFormCheckbox,
GlForm,
GlFormGroup,
@@ -27,8 +26,7 @@ const scheduleId = queryToObject(window.location.search).id;
export default {
components: {
GlButton,
- GlDropdown,
- GlDropdownItem,
+ GlCollapsibleListbox,
GlForm,
GlFormCheckbox,
GlFormGroup,
@@ -81,7 +79,7 @@ export default {
this.description = schedule.description;
this.cron = schedule.cron;
this.cronTimezone = schedule.cronTimezone;
- this.scheduleRef = schedule.ref;
+ this.scheduleRef = schedule.ref || this.defaultBranch;
this.variables = variables.map((variable) => {
return {
id: variable.id,
@@ -144,10 +142,6 @@ export default {
revealText: __('Reveal values'),
hideText: __('Hide values'),
},
- typeOptions: {
- [VARIABLE_TYPE]: __('Variable'),
- [FILE_TYPE]: __('File'),
- },
formElementClasses: 'gl-md-mr-3 gl-mb-3 gl-flex-basis-quarter gl-flex-shrink-0 gl-flex-grow-0',
computed: {
dropdownTranslations() {
@@ -155,7 +149,7 @@ export default {
dropdownHeader: this.$options.i18n.targetBranchTag,
};
},
- typeOptionsListbox() {
+ typeOptions() {
return [
{
text: __('Variable'),
@@ -232,9 +226,9 @@ export default {
empty: true,
});
},
- setVariableAttribute(key, attribute, value) {
+ setVariableType(typeValue, key) {
const variable = this.variables.find((v) => v.key === key);
- variable[attribute] = value;
+ variable.variableType = typeValue;
},
removeVariable(index) {
this.variables[index].destroy = true;
@@ -387,19 +381,15 @@ export default {
class="gl-display-flex gl-align-items-stretch gl-flex-direction-column gl-md-flex-direction-row gl-mb-3 gl-pb-2"
data-testid="ci-variable-row"
>
- <gl-dropdown
- :text="$options.typeOptions[variable.variableType]"
+ <gl-collapsible-listbox
+ :items="typeOptions"
+ :selected="variable.variableType"
:class="$options.formElementClasses"
+ block
data-testid="pipeline-form-ci-variable-type"
- >
- <gl-dropdown-item
- v-for="type in Object.keys($options.typeOptions)"
- :key="type"
- @click="setVariableAttribute(variable.key, 'variableType', type)"
- >
- {{ $options.typeOptions[type] }}
- </gl-dropdown-item>
- </gl-dropdown>
+ @select="setVariableType($event, variable.key)"
+ />
+
<gl-form-input
v-model="variable.key"
:placeholder="s__('CiVariables|Input variable key')"
@@ -414,7 +404,6 @@ export default {
value="*****************"
disabled
class="gl-mb-3 gl-h-7!"
- :style="$options.textAreaStyle"
:no-resize="false"
data-testid="pipeline-form-ci-variable-hidden-value"
/>
@@ -424,7 +413,6 @@ export default {
v-model="variable.value"
:placeholder="s__('CiVariables|Input variable value')"
class="gl-mb-3 gl-h-7!"
- :style="$options.textAreaStyle"
:no-resize="false"
data-testid="pipeline-form-ci-variable-value"
data-qa-selector="ci_variable_value_field"
diff --git a/app/assets/javascripts/ci/pipeline_schedules/components/table/cells/pipeline_schedule_target.vue b/app/assets/javascripts/ci/pipeline_schedules/components/table/cells/pipeline_schedule_target.vue
index 08efa794bcc..56d50026f17 100644
--- a/app/assets/javascripts/ci/pipeline_schedules/components/table/cells/pipeline_schedule_target.vue
+++ b/app/assets/javascripts/ci/pipeline_schedules/components/table/cells/pipeline_schedule_target.vue
@@ -27,10 +27,13 @@ export default {
</script>
<template>
- <div>
- <gl-icon :name="iconName" />
+ <div data-testid="pipeline-schedule-target">
<span v-if="refPath">
+ <gl-icon :name="iconName" />
<gl-link :href="refPath" class="gl-text-gray-900">{{ refDisplay }}</gl-link>
</span>
+ <span v-else>
+ {{ s__('PipelineSchedules|None') }}
+ </span>
</div>
</template>
diff --git a/app/assets/javascripts/ci/pipeline_schedules/components/take_ownership_modal_legacy.vue b/app/assets/javascripts/ci/pipeline_schedules/components/take_ownership_modal_legacy.vue
deleted file mode 100644
index b4d84309c5f..00000000000
--- a/app/assets/javascripts/ci/pipeline_schedules/components/take_ownership_modal_legacy.vue
+++ /dev/null
@@ -1,50 +0,0 @@
-<script>
-import { GlModal } from '@gitlab/ui';
-import { __, s__ } from '~/locale';
-
-export default {
- components: {
- GlModal,
- },
- props: {
- ownershipUrl: {
- type: String,
- required: true,
- },
- },
- modalId: 'pipeline-take-ownership-modal',
- i18n: {
- takeOwnership: s__('PipelineSchedules|Take ownership'),
- ownershipMessage: s__(
- 'PipelineSchedules|Only the owner of a pipeline schedule can make changes to it. Do you want to take ownership of this schedule?',
- ),
- cancelLabel: __('Cancel'),
- },
- computed: {
- actionCancel() {
- return { text: this.$options.i18n.cancelLabel };
- },
- actionPrimary() {
- return {
- text: this.$options.i18n.takeOwnership,
- attributes: {
- variant: 'confirm',
- category: 'primary',
- href: this.ownershipUrl,
- 'data-method': 'post',
- },
- };
- },
- },
-};
-</script>
-<template>
- <gl-modal
- :modal-id="$options.modalId"
- :action-primary="actionPrimary"
- :action-cancel="actionCancel"
- :title="$options.i18n.takeOwnership"
- >
- <p>{{ $options.i18n.ownershipMessage }}</p>
- </gl-modal>
-</template>