diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-28 09:10:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-28 09:10:17 +0300 |
commit | d3eb1e90a58fc97c9c1548e8ac9631c233e723ea (patch) | |
tree | 0be332ab901bd95225437ffd332bc83c30c99742 /app/assets/javascripts/integrations | |
parent | 6078d7becc4a0d70aafc4a3934a70b8cf2b3775e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/integrations')
3 files changed, 81 insertions, 0 deletions
diff --git a/app/assets/javascripts/integrations/constants.js b/app/assets/javascripts/integrations/constants.js index e9bcc789bcb..6b5a828c009 100644 --- a/app/assets/javascripts/integrations/constants.js +++ b/app/assets/javascripts/integrations/constants.js @@ -33,6 +33,7 @@ export const integrationFormSections = { JIRA_ISSUES: 'jira_issues', TRIGGER: 'trigger', APPLE_APP_STORE: 'apple_app_store', + GOOGLE_PLAY: 'google_play', }; export const integrationFormSectionComponents = { @@ -42,6 +43,7 @@ export const integrationFormSectionComponents = { [integrationFormSections.JIRA_ISSUES]: 'IntegrationSectionJiraIssues', [integrationFormSections.TRIGGER]: 'IntegrationSectionTrigger', [integrationFormSections.APPLE_APP_STORE]: 'IntegrationSectionAppleAppStore', + [integrationFormSections.GOOGLE_PLAY]: 'IntegrationSectionGooglePlay', }; export const integrationTriggerEvents = { diff --git a/app/assets/javascripts/integrations/edit/components/integration_forms/section.vue b/app/assets/javascripts/integrations/edit/components/integration_forms/section.vue index d33f0ba3171..5335b7b6ee2 100644 --- a/app/assets/javascripts/integrations/edit/components/integration_forms/section.vue +++ b/app/assets/javascripts/integrations/edit/components/integration_forms/section.vue @@ -32,6 +32,10 @@ export default { import( /* webpackChunkName: 'IntegrationSectionAppleAppStore' */ '~/integrations/edit/components/sections/apple_app_store.vue' ), + IntegrationSectionGooglePlay: () => + import( + /* webpackChunkName: 'IntegrationSectionGooglePlay' */ '~/integrations/edit/components/sections/google_play.vue' + ), }, directives: { SafeHtml, diff --git a/app/assets/javascripts/integrations/edit/components/sections/google_play.vue b/app/assets/javascripts/integrations/edit/components/sections/google_play.vue new file mode 100644 index 00000000000..3094e24241a --- /dev/null +++ b/app/assets/javascripts/integrations/edit/components/sections/google_play.vue @@ -0,0 +1,75 @@ +<script> +import { mapGetters } from 'vuex'; +import { sprintf, s__ } from '~/locale'; +import UploadDropzoneField from '../upload_dropzone_field.vue'; +import Connection from './connection.vue'; + +export default { + name: 'IntegrationSectionGooglePlay', + components: { + Connection, + UploadDropzoneField, + }, + data() { + return { + dropzoneAllowList: ['.json'], + }; + }, + i18n: { + dropzoneDescription: s__( + 'GooglePlay|Drag your key file here or %{linkStart}click to upload%{linkEnd}.', + ), + dropzoneErrorMessage: s__( + "GooglePlay|Error: The file you're trying to upload is not a service account key.", + ), + dropzoneConfirmMessage: s__('GooglePlay|Drag your key file to start the upload.'), + dropzoneEmptyInputName: s__('GooglePlay|Service account key (.json)'), + dropzoneNonEmptyInputName: s__( + 'GooglePlay|Upload a new service account key (replace %{currentFileName})', + ), + dropzoneNoneEmpyInputHelp: s__( + 'GooglePlay|Leave empty to use your current service account key.', + ), + }, + computed: { + ...mapGetters(['propsSource']), + dynamicFields() { + return this.propsSource.fields.filter( + (field) => field.name !== 'service_account_key_file_name', + ); + }, + fileNameField() { + return this.propsSource.fields.find( + (field) => field.name === 'service_account_key_file_name', + ); + }, + dropzoneLabel() { + return this.fileNameField.value + ? sprintf(this.$options.i18n.dropzoneNonEmptyInputName, { + currentFileName: this.fileNameField.value, + }) + : this.$options.i18n.dropzoneEmptyInputName; + }, + dropzoneHelpText() { + return this.fileNameField.value ? this.$options.i18n.dropzoneNoneEmpyInputHelp : ''; + }, + }, +}; +</script> + +<template> + <span> + <connection :fields="dynamicFields" /> + + <upload-dropzone-field + name="service[service_account_key]" + :label="dropzoneLabel" + :help-text="dropzoneHelpText" + file-input-name="service[service_account_key_file_name]" + :allow-list="dropzoneAllowList" + :description="$options.i18n.dropzoneDescription" + :error-message="$options.i18n.dropzoneErrorMessage" + :confirm-message="$options.i18n.dropzoneConfirmMessage" + /> + </span> +</template> |