Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4c5fbdb8
Commit
4c5fbdb8
authored
Jan 20, 2022
by
Sri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Confirm checkbox for Service Account creation
parent
b99ebc5d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
app/assets/javascripts/google_cloud/components/service_accounts_form.vue
...scripts/google_cloud/components/service_accounts_form.vue
+10
-2
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/frontend/google_cloud/components/service_accounts_form_spec.js
...end/google_cloud/components/service_accounts_form_spec.js
+15
-4
No files found.
app/assets/javascripts/google_cloud/components/service_accounts_form.vue
View file @
4c5fbdb8
<
script
>
<
script
>
import
{
GlButton
,
GlFormGroup
,
GlFormSelect
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlFormGroup
,
GlFormSelect
,
GlFormCheckbox
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
export
default
{
export
default
{
components
:
{
GlButton
,
GlFormGroup
,
GlFormSelect
},
components
:
{
GlButton
,
GlFormGroup
,
GlFormSelect
,
GlFormCheckbox
},
props
:
{
props
:
{
gcpProjects
:
{
required
:
true
,
type
:
Array
},
gcpProjects
:
{
required
:
true
,
type
:
Array
},
environments
:
{
required
:
true
,
type
:
Array
},
environments
:
{
required
:
true
,
type
:
Array
},
...
@@ -19,6 +19,9 @@ export default {
...
@@ -19,6 +19,9 @@ export default {
environmentDescription
:
__
(
'
Generated service account is linked to the selected environment
'
),
environmentDescription
:
__
(
'
Generated service account is linked to the selected environment
'
),
submitLabel
:
__
(
'
Create service account
'
),
submitLabel
:
__
(
'
Create service account
'
),
cancelLabel
:
__
(
'
Cancel
'
),
cancelLabel
:
__
(
'
Cancel
'
),
checkboxLabel
:
__
(
'
I understand the responsibilities involved with managing service account keys
'
,
),
},
},
};
};
</
script
>
</
script
>
...
@@ -59,6 +62,11 @@ export default {
...
@@ -59,6 +62,11 @@ export default {
</option>
</option>
</gl-form-select>
</gl-form-select>
</gl-form-group>
</gl-form-group>
<gl-form-group>
<gl-form-checkbox
name=
"confirmation"
required
>
{{
$options
.
i18n
.
checkboxLabel
}}
</gl-form-checkbox>
</gl-form-group>
<div
class=
"form-actions row"
>
<div
class=
"form-actions row"
>
<gl-button
type=
"submit"
category=
"primary"
variant=
"confirm"
>
<gl-button
type=
"submit"
category=
"primary"
variant=
"confirm"
>
...
...
locale/gitlab.pot
View file @
4c5fbdb8
...
@@ -17793,6 +17793,9 @@ msgstr ""
...
@@ -17793,6 +17793,9 @@ msgstr ""
msgid "I forgot my password"
msgid "I forgot my password"
msgstr ""
msgstr ""
msgid "I understand the responsibilities involved with managing service account keys"
msgstr ""
msgid "I want to explore GitLab to see if it’s worth switching to"
msgid "I want to explore GitLab to see if it’s worth switching to"
msgstr ""
msgstr ""
...
...
spec/frontend/google_cloud/components/service_accounts_form_spec.js
View file @
4c5fbdb8
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlButton
,
GlFormGroup
,
GlFormSelect
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlFormGroup
,
GlFormSelect
,
GlFormCheckbox
}
from
'
@gitlab/ui
'
;
import
ServiceAccountsForm
from
'
~/google_cloud/components/service_accounts_form.vue
'
;
import
ServiceAccountsForm
from
'
~/google_cloud/components/service_accounts_form.vue
'
;
describe
(
'
ServiceAccountsForm component
'
,
()
=>
{
describe
(
'
ServiceAccountsForm component
'
,
()
=>
{
...
@@ -9,11 +9,12 @@ describe('ServiceAccountsForm component', () => {
...
@@ -9,11 +9,12 @@ describe('ServiceAccountsForm component', () => {
const
findAllFormGroups
=
()
=>
wrapper
.
findAllComponents
(
GlFormGroup
);
const
findAllFormGroups
=
()
=>
wrapper
.
findAllComponents
(
GlFormGroup
);
const
findAllFormSelects
=
()
=>
wrapper
.
findAllComponents
(
GlFormSelect
);
const
findAllFormSelects
=
()
=>
wrapper
.
findAllComponents
(
GlFormSelect
);
const
findAllButtons
=
()
=>
wrapper
.
findAllComponents
(
GlButton
);
const
findAllButtons
=
()
=>
wrapper
.
findAllComponents
(
GlButton
);
const
findCheckbox
=
()
=>
wrapper
.
findComponent
(
GlFormCheckbox
);
const
propsData
=
{
gcpProjects
:
[],
environments
:
[],
cancelPath
:
'
#cancel-url
'
};
const
propsData
=
{
gcpProjects
:
[],
environments
:
[],
cancelPath
:
'
#cancel-url
'
};
beforeEach
(()
=>
{
beforeEach
(()
=>
{
wrapper
=
shallowMount
(
ServiceAccountsForm
,
{
propsData
});
wrapper
=
shallowMount
(
ServiceAccountsForm
,
{
propsData
,
stubs
:
{
GlFormCheckbox
}
});
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
@@ -35,8 +36,8 @@ describe('ServiceAccountsForm component', () => {
...
@@ -35,8 +36,8 @@ describe('ServiceAccountsForm component', () => {
});
});
it
(
'
contains Environments form group
'
,
()
=>
{
it
(
'
contains Environments form group
'
,
()
=>
{
const
formG
or
up
=
findAllFormGroups
().
at
(
1
);
const
formG
ro
up
=
findAllFormGroups
().
at
(
1
);
expect
(
formG
or
up
.
exists
()).
toBe
(
true
);
expect
(
formG
ro
up
.
exists
()).
toBe
(
true
);
});
});
it
(
'
contains Environments dropdown
'
,
()
=>
{
it
(
'
contains Environments dropdown
'
,
()
=>
{
...
@@ -56,4 +57,14 @@ describe('ServiceAccountsForm component', () => {
...
@@ -56,4 +57,14 @@ describe('ServiceAccountsForm component', () => {
expect
(
button
.
text
()).
toBe
(
ServiceAccountsForm
.
i18n
.
cancelLabel
);
expect
(
button
.
text
()).
toBe
(
ServiceAccountsForm
.
i18n
.
cancelLabel
);
expect
(
button
.
attributes
(
'
href
'
)).
toBe
(
'
#cancel-url
'
);
expect
(
button
.
attributes
(
'
href
'
)).
toBe
(
'
#cancel-url
'
);
});
});
it
(
'
contains Confirmation checkbox
'
,
()
=>
{
const
checkbox
=
findCheckbox
();
expect
(
checkbox
.
text
()).
toBe
(
ServiceAccountsForm
.
i18n
.
checkboxLabel
);
});
it
(
'
checkbox must be required
'
,
()
=>
{
const
checkbox
=
findCheckbox
();
expect
(
checkbox
.
attributes
(
'
required
'
)).
toBe
(
'
true
'
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment