diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-13 21:09:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-13 21:09:22 +0300 |
commit | d4a7d0bec23c624bd0e7d690bdc0cb3fe8387378 (patch) | |
tree | 6e48b3268a3ccdc49f576018f606985c6a285744 /app/assets/javascripts/access_tokens | |
parent | c4eeda2d3d048e84b331f416472e99ed0e116904 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/access_tokens')
3 files changed, 6 insertions, 10 deletions
diff --git a/app/assets/javascripts/access_tokens/components/access_token_table_app.vue b/app/assets/javascripts/access_tokens/components/access_token_table_app.vue index 5fe285c0896..944a2ef7f64 100644 --- a/app/assets/javascripts/access_tokens/components/access_token_table_app.vue +++ b/app/assets/javascripts/access_tokens/components/access_token_table_app.vue @@ -10,6 +10,7 @@ import { EVENT_SUCCESS, FIELDS, FORM_SELECTOR, INITIAL_PAGE, PAGE_SIZE } from '. export default { EVENT_SUCCESS, + FORM_SELECTOR, PAGE_SIZE, name: 'AccessTokenTableApp', components: { @@ -55,9 +56,6 @@ export default { filteredFields() { return this.showRole ? FIELDS : FIELDS.filter((field) => field.key !== 'role'); }, - formSelector() { - return `#${FORM_SELECTOR}`; - }, header() { return sprintf(this.$options.i18n.header, { accessTokenTypePlural: this.accessTokenTypePlural, @@ -97,7 +95,7 @@ export default { </script> <template> - <dom-element-listener :selector="formSelector" @[$options.EVENT_SUCCESS]="onSuccess"> + <dom-element-listener :selector="$options.FORM_SELECTOR" @[$options.EVENT_SUCCESS]="onSuccess"> <div> <hr /> <h5>{{ header }}</h5> diff --git a/app/assets/javascripts/access_tokens/components/constants.js b/app/assets/javascripts/access_tokens/components/constants.js index 197f20ae24c..84e50bc099f 100644 --- a/app/assets/javascripts/access_tokens/components/constants.js +++ b/app/assets/javascripts/access_tokens/components/constants.js @@ -2,7 +2,7 @@ import { __, s__ } from '~/locale'; export const EVENT_ERROR = 'ajax:error'; export const EVENT_SUCCESS = 'ajax:success'; -export const FORM_SELECTOR = 'js-new-access-token-form'; +export const FORM_SELECTOR = '#js-new-access-token-form'; export const INITIAL_PAGE = 1; export const PAGE_SIZE = 100; diff --git a/app/assets/javascripts/access_tokens/components/new_access_token_app.vue b/app/assets/javascripts/access_tokens/components/new_access_token_app.vue index a34f3c7dedf..904052688f3 100644 --- a/app/assets/javascripts/access_tokens/components/new_access_token_app.vue +++ b/app/assets/javascripts/access_tokens/components/new_access_token_app.vue @@ -9,6 +9,7 @@ import { EVENT_ERROR, EVENT_SUCCESS, FORM_SELECTOR } from './constants'; export default { EVENT_ERROR, EVENT_SUCCESS, + FORM_SELECTOR, name: 'NewAccessTokenApp', components: { DomElementListener, GlAlert, InputCopyToggleVisibility }, i18n: { @@ -46,16 +47,13 @@ export default { name: this.$options.tokenInputId, }; }, - formSelector() { - return `#${FORM_SELECTOR}`; - }, label() { return sprintf(this.$options.i18n.label, { accessTokenType: this.accessTokenType }); }, }, mounted() { /** @type {HTMLFormElement} */ - this.form = document.getElementById(FORM_SELECTOR); + this.form = document.querySelector(FORM_SELECTOR); /** @type {HTMLInputElement} */ this.submitButton = this.form.querySelector('input[type=submit]'); @@ -92,7 +90,7 @@ export default { <template> <dom-element-listener - :selector="formSelector" + :selector="$options.FORM_SELECTOR" @[$options.EVENT_ERROR]="onError" @[$options.EVENT_SUCCESS]="onSuccess" > |