diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-15 00:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-15 00:10:36 +0300 |
commit | beabc7d164276a8bb35c2b497a0c4dc0dc824e3c (patch) | |
tree | be60f7d352225862e3404fe89c39374fd4e64a1e /app | |
parent | 14160fad80415337f8c08755af53ee994b4a7518 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/artifacts_settings/index.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/artifacts_settings/keep_latest_artifact_toggle.vue (renamed from app/assets/javascripts/artifacts_settings/keep_latest_artifact_checkbox.vue) | 24 | ||||
-rw-r--r-- | app/services/google_cloud/enable_vision_ai_service.rb | 19 |
3 files changed, 36 insertions, 11 deletions
diff --git a/app/assets/javascripts/artifacts_settings/index.js b/app/assets/javascripts/artifacts_settings/index.js index 531b42bc185..86728f1b586 100644 --- a/app/assets/javascripts/artifacts_settings/index.js +++ b/app/assets/javascripts/artifacts_settings/index.js @@ -1,6 +1,6 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; -import KeepLatestArtifactCheckbox from '~/artifacts_settings/keep_latest_artifact_checkbox.vue'; +import KeepLatestArtifactToggle from '~/artifacts_settings/keep_latest_artifact_toggle.vue'; import createDefaultClient from '~/lib/graphql'; Vue.use(VueApollo); @@ -26,7 +26,7 @@ export default (containerId = 'js-artifacts-settings-app') => { helpPagePath, }, render(createElement) { - return createElement(KeepLatestArtifactCheckbox); + return createElement(KeepLatestArtifactToggle); }, }); }; diff --git a/app/assets/javascripts/artifacts_settings/keep_latest_artifact_checkbox.vue b/app/assets/javascripts/artifacts_settings/keep_latest_artifact_toggle.vue index 8e7ccb80784..db7d1057402 100644 --- a/app/assets/javascripts/artifacts_settings/keep_latest_artifact_checkbox.vue +++ b/app/assets/javascripts/artifacts_settings/keep_latest_artifact_toggle.vue @@ -1,5 +1,5 @@ <script> -import { GlAlert, GlFormCheckbox, GlLink } from '@gitlab/ui'; +import { GlAlert, GlToggle, GlLink } from '@gitlab/ui'; import { __ } from '~/locale'; import UpdateKeepLatestArtifactProjectSetting from './graphql/mutations/update_keep_latest_artifact_project_setting.mutation.graphql'; import GetKeepLatestArtifactProjectSetting from './graphql/queries/get_keep_latest_artifact_project_setting.query.graphql'; @@ -13,12 +13,12 @@ export default { enabledHelpText: __( 'The latest artifacts created by jobs in the most recent successful pipeline will be stored.', ), - helpLinkText: __('More information'), - checkboxText: __('Keep artifacts from most recent successful jobs'), + helpLinkText: __('Learn more.'), + labelText: __('Keep artifacts from most recent successful jobs'), }, components: { GlAlert, - GlFormCheckbox, + GlToggle, GlLink, }, inject: { @@ -95,10 +95,16 @@ export default { @dismiss="isAlertDismissed = true" >{{ errorMessage }}</gl-alert > - <gl-form-checkbox v-model="keepLatestArtifact" @change="updateSetting" - ><strong class="gl-mr-3">{{ $options.i18n.checkboxText }}</strong> - <gl-link :href="helpPagePath">{{ $options.i18n.helpLinkText }}</gl-link> - <template v-if="!$apollo.loading" #help>{{ helpText }}</template> - </gl-form-checkbox> + <gl-toggle + v-model="keepLatestArtifact" + :is-loading="$apollo.loading" + :label="$options.i18n.labelText" + @change="updateSetting" + > + <template #help> + {{ helpText }} + <gl-link :href="helpPagePath">{{ $options.i18n.helpLinkText }}</gl-link> + </template> + </gl-toggle> </div> </template> diff --git a/app/services/google_cloud/enable_vision_ai_service.rb b/app/services/google_cloud/enable_vision_ai_service.rb new file mode 100644 index 00000000000..f7adea706ed --- /dev/null +++ b/app/services/google_cloud/enable_vision_ai_service.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module GoogleCloud + class EnableVisionAiService < ::GoogleCloud::BaseService + def execute + gcp_project_ids = unique_gcp_project_ids + + if gcp_project_ids.empty? + error("No GCP projects found. Configure a service account or GCP_PROJECT_ID ci variable.") + else + gcp_project_ids.each do |gcp_project_id| + google_api_client.enable_vision_api(gcp_project_id) + end + + success({ gcp_project_ids: gcp_project_ids }) + end + end + end +end |