diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /app/assets/javascripts/access_tokens | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'app/assets/javascripts/access_tokens')
-rw-r--r-- | app/assets/javascripts/access_tokens/index.js | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/app/assets/javascripts/access_tokens/index.js b/app/assets/javascripts/access_tokens/index.js index 43d56295f78..7f5f0403de6 100644 --- a/app/assets/javascripts/access_tokens/index.js +++ b/app/assets/javascripts/access_tokens/index.js @@ -1,20 +1,10 @@ import Vue from 'vue'; import createFlash from '~/flash'; +import { parseRailsFormFields } from '~/lib/utils/forms'; import { __ } from '~/locale'; import ExpiresAtField from './components/expires_at_field.vue'; -const getInputAttrs = (el) => { - const input = el.querySelector('input'); - - return { - id: input.id, - name: input.name, - value: input.value, - placeholder: input.placeholder, - }; -}; - export const initExpiresAtField = () => { const el = document.querySelector('.js-access-tokens-expires-at'); @@ -22,7 +12,7 @@ export const initExpiresAtField = () => { return null; } - const inputAttrs = getInputAttrs(el); + const { expiresAt: inputAttrs } = parseRailsFormFields(el); return new Vue({ el, @@ -43,7 +33,7 @@ export const initProjectsField = () => { return null; } - const inputAttrs = getInputAttrs(el); + const { projects: inputAttrs } = parseRailsFormFields(el); if (window.gon.features.personalAccessTokensScopedToProjects) { return new Promise((resolve) => { |