Skip to content

Commit d8c4c08

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent aa84824 commit d8c4c08

File tree

68 files changed

+359
-445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+359
-445
lines changed

app/assets/javascripts/access_tokens/components/access_token_table_app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export default {
158158
:aria-label="$options.i18n.revokeButton"
159159
:data-confirm="modalMessage(name)"
160160
data-confirm-btn-variant="danger"
161-
data-qa-selector="revoke_button"
161+
data-testid="revoke-button"
162162
data-method="put"
163163
:href="revokePath"
164164
icon="remove"

app/assets/javascripts/access_tokens/components/expires_at_field.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default {
6868
:input-name="inputAttrs.name"
6969
:input-id="inputAttrs.id"
7070
:placeholder="inputAttrs.placeholder"
71-
data-qa-selector="expiry_date_field"
71+
data-testid="expiry-date-field"
7272
/>
7373
<template #description>
7474
<template v-if="description">

app/assets/javascripts/access_tokens/components/new_access_token_app.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default {
4545
formInputGroupProps() {
4646
return {
4747
id: this.$options.tokenInputId,
48-
'data-qa-selector': 'created_access_token_field',
48+
'data-testid': 'created-access-token-field',
4949
name: this.$options.tokenInputId,
5050
};
5151
},
@@ -110,7 +110,7 @@ export default {
110110
@[$options.EVENT_ERROR]="onError"
111111
@[$options.EVENT_SUCCESS]="onSuccess"
112112
>
113-
<div ref="container" data-testid="access-token-section" data-qa-selector="access_token_section">
113+
<div ref="container" data-testid="access-token-section">
114114
<gl-alert
115115
v-if="newToken"
116116
variant="success"

app/assets/javascripts/authentication/two_factor_auth/components/recovery_codes.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,10 @@ export default {
115115
</gl-sprintf>
116116
</p>
117117

118-
<gl-card
119-
class="codes-to-print gl-my-5"
120-
data-testid="recovery-codes"
121-
data-qa-selector="codes_content"
122-
>
118+
<gl-card class="codes-to-print gl-my-5" data-testid="recovery-codes">
123119
<ul class="gl-m-0 gl-pl-5">
124120
<li v-for="(code, index) in codes" :key="index">
125-
<span class="gl-font-monospace" data-qa-selector="code_content">{{ code }}</span>
121+
<span class="gl-font-monospace" data-testid="code-content">{{ code }}</span>
126122
</li>
127123
</ul>
128124
</gl-card>
@@ -131,7 +127,7 @@ export default {
131127
<clipboard-button
132128
:title="$options.i18n.copyButton"
133129
:text="codesAsString"
134-
data-qa-selector="copy_button"
130+
data-testid="copy-button"
135131
@click="handleButtonClick($options.copyButtonAction)"
136132
>
137133
{{ $options.i18n.copyButton }}
@@ -163,7 +159,7 @@ export default {
163159
:disabled="proceedButtonDisabled"
164160
:title="$options.i18n.proceedButton"
165161
variant="confirm"
166-
data-qa-selector="proceed_button"
162+
data-testid="proceed-button"
167163
data-track-action="click_button"
168164
:data-track-label="`${$options.trackingLabelPrefix}proceed_button`"
169165
>{{ $options.i18n.proceedButton }}</gl-button

app/assets/javascripts/invite_members/components/invite_group_trigger.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@ export default {
2828
</script>
2929

3030
<template>
31-
<gl-button
32-
:class="classes"
33-
data-qa-selector="invite_a_group_button"
34-
data-test-id="invite-group-button"
35-
@click="openModal"
36-
>
31+
<gl-button :class="classes" data-testid="invite-a-group-button" @click="openModal">
3732
{{ displayText }}
3833
</gl-button>
3934
</template>

app/assets/javascripts/invite_members/components/invite_members_trigger.vue

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { s__ } from '~/locale';
44
import eventHub from '../event_hub';
55
import {
66
TRIGGER_ELEMENT_BUTTON,
7-
TRIGGER_DEFAULT_QA_SELECTOR,
87
TRIGGER_ELEMENT_WITH_EMOJI,
98
TRIGGER_ELEMENT_DROPDOWN_WITH_EMOJI,
109
TRIGGER_ELEMENT_DISCLOSURE_DROPDOWN,
@@ -42,18 +41,12 @@ export default {
4241
required: false,
4342
default: 'button',
4443
},
45-
qaSelector: {
46-
type: String,
47-
required: false,
48-
default: TRIGGER_DEFAULT_QA_SELECTOR,
49-
},
5044
},
5145
computed: {
5246
componentAttributes() {
5347
return {
5448
class: this.classes,
55-
'data-qa-selector': this.qaSelector,
56-
'data-test-id': 'invite-members-button',
49+
'data-testid': 'invite-members-button',
5750
};
5851
},
5952
item() {

app/assets/javascripts/invite_members/components/invite_modal_base.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ export default {
173173
variant: 'confirm',
174174
disabled: this.submitDisabled,
175175
loading: this.isLoading,
176-
'data-qa-selector': 'invite_button',
177176
},
178177
};
179178
},
@@ -311,7 +310,7 @@ export default {
311310
<gl-form-select
312311
:id="dropdownId"
313312
v-model="selectedAccessLevel"
314-
data-qa-selector="access_level_dropdown"
313+
data-testid="access-level-dropdown"
315314
:options="accessLevelsOptions"
316315
/>
317316
</gl-form-group>

app/assets/javascripts/invite_members/components/members_token_select.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export default {
102102
textInputAttrs() {
103103
return {
104104
'data-testid': 'members-token-select-input',
105-
'data-qa-selector': 'members_token_select_input',
106105
id: this.inputId,
107106
};
108107
},

app/assets/javascripts/invite_members/constants.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const TRIGGER_ELEMENT_WITH_EMOJI = 'text-emoji';
2020
export const TRIGGER_ELEMENT_DROPDOWN_WITH_EMOJI = 'dropdown-text-emoji';
2121
export const TRIGGER_ELEMENT_DISCLOSURE_DROPDOWN = 'dropdown-text';
2222
export const INVITE_MEMBER_MODAL_TRACKING_CATEGORY = 'invite_members_modal';
23-
export const TRIGGER_DEFAULT_QA_SELECTOR = 'invite_members_button';
2423
export const IMPORT_PROJECT_MEMBERS_MODAL_TRACKING_CATEGORY = 'invite_project_members_modal';
2524
export const IMPORT_PROJECT_MEMBERS_MODAL_TRACKING_LABEL = 'project-members-page';
2625
export const MEMBERS_MODAL_DEFAULT_TITLE = s__('InviteMembersModal|Invite members');

app/assets/javascripts/pages/profiles/two_factor_auths/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const skippable = twoFactorNode ? parseBoolean(twoFactorNode.dataset.twoFactorSk
88

99
if (skippable) {
1010
const button = `<div class="gl-alert-actions">
11-
<a class="btn gl-button btn-md btn-confirm gl-alert-action" data-qa-selector="configure_it_later_button" data-method="patch" href="${twoFactorNode.dataset.two_factor_skip_url}">Configure it later</a>
11+
<a class="btn gl-button btn-md btn-confirm gl-alert-action" data-testid="configure-it-later-button" data-method="patch" href="${twoFactorNode.dataset.two_factor_skip_url}">Configure it later</a>
1212
</div>`;
1313
const flashAlert = document.querySelector('.flash-alert');
1414
if (flashAlert) {

app/assets/javascripts/profile/account/components/delete_account_modal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default {
4242
text: __('Delete account'),
4343
attributes: {
4444
variant: 'danger',
45-
'data-qa-selector': 'confirm_delete_account_button',
45+
'data-testid': 'confirm-delete-account-button',
4646
category: 'primary',
4747
disabled: !this.canSubmit,
4848
},
@@ -128,7 +128,7 @@ Once you confirm %{deleteAccount}, it cannot be undone or recovered.`),
128128
name="password"
129129
class="form-control"
130130
type="password"
131-
data-qa-selector="password_confirmation_field"
131+
data-testid="password-confirmation-field"
132132
aria-labelledby="input-label"
133133
/>
134134
<input

app/assets/javascripts/super_sidebar/components/user_menu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default {
8888
text: this.$options.i18n.editProfile,
8989
href: this.data.settings.profile_path,
9090
extraAttrs: {
91-
'data-testid': 'edit_profile_link',
91+
'data-testid': 'edit-profile-link',
9292
...USER_MENU_TRACKING_DEFAULTS,
9393
'data-track-label': 'user_edit_profile',
9494
},
@@ -235,7 +235,7 @@ export default {
235235
:entity-name="data.name"
236236
:src="data.avatar_url"
237237
aria-hidden="true"
238-
data-testid="user_avatar_content"
238+
data-testid="user-avatar-content"
239239
/>
240240
<span
241241
v-if="showNotificationDot"

app/assets/javascripts/terms/components/app.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default {
6666

6767
<template>
6868
<div>
69-
<div class="gl-relative gl-pb-0 gl-px-0" data-qa-selector="terms_content">
69+
<div class="gl-relative gl-pb-0 gl-px-0" data-testid="terms-content">
7070
<div
7171
class="terms-fade gl-absolute gl-left-5 gl-right-5 gl-bottom-0 gl-h-11 gl-pointer-events-none"
7272
></div>
@@ -97,7 +97,7 @@ export default {
9797
type="submit"
9898
variant="confirm"
9999
:disabled="acceptDisabled"
100-
data-qa-selector="accept_terms_button"
100+
data-testid="accept-terms-button"
101101
>{{ $options.i18n.accept }}</gl-button
102102
>
103103
<input :value="$options.csrf.token" type="hidden" name="authenticity_token" />

app/assets/javascripts/vue_shared/alert_details/components/alert_details.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import AlertSidebar from './alert_sidebar.vue';
3030
import AlertSummaryRow from './alert_summary_row.vue';
3131
import SystemNote from './system_notes/system_note.vue';
3232
33-
const containerEl = document.querySelector('.page-with-contextual-sidebar');
33+
const containerEl = document.querySelector('.layout-page');
3434
3535
export default {
3636
i18n: {

app/assets/javascripts/vue_shared/components/confirm_danger/confirm_danger_modal.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default {
7272
attributes: {
7373
variant: 'danger',
7474
disabled: !this.isValid,
75-
'data-qa-selector': 'confirm_danger_modal_button',
75+
'data-testid': 'confirm-danger-modal-button',
7676
},
7777
};
7878
},
@@ -133,8 +133,7 @@ export default {
133133
id="confirm_name_input"
134134
v-model="confirmationPhrase"
135135
class="form-control"
136-
data-qa-selector="confirm_danger_field"
137-
data-testid="confirm-danger-input"
136+
data-testid="confirm-danger-field"
138137
type="text"
139138
/>
140139
</gl-form-group>

app/assets/javascripts/vue_shared/components/form/input_copy_toggle_visibility.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ export default {
176176
:aria-label="toggleVisibilityLabel"
177177
:icon="toggleVisibilityIcon"
178178
data-testid="toggle-visibility-button"
179-
data-qa-selector="toggle_visibility_button"
180179
@click.stop="handleToggleVisibilityButtonClick"
181180
/>
182181
<clipboard-button

app/helpers/auth_helper.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ def provider_has_icon?(name)
4747
provider_has_builtin_icon?(name) || provider_has_custom_icon?(name)
4848
end
4949

50-
def qa_selector_for_provider(provider)
50+
def test_id_for_provider(provider)
5151
{
52-
saml: 'saml_login_button',
53-
openid_connect: 'oidc_login_button',
54-
github: 'github_login_button',
55-
gitlab: 'gitlab_oauth_login_button',
56-
facebook: 'facebook_login_button'
52+
saml: 'saml-login-button',
53+
openid_connect: 'oidc-login-button',
54+
github: 'github-login-button',
55+
gitlab: 'gitlab-oauth-login-button',
56+
facebook: 'facebook-login-button'
5757
}[provider.to_sym]
5858
end
5959

app/services/admin/plan_limits/update_service.rb

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,35 +51,63 @@ def validate_storage_limits
5151

5252
def validate_notification_limit
5353
return unless parsed_params.include?(:notification_limit)
54-
return if notification_limit >= storage_size_limit && notification_limit <= enforcement_limit
54+
return if unlimited_value?(:notification_limit)
5555

56-
plan_limits.errors.add(:notification_limit, "must be greater than or equal to " \
57-
"storage_size_limit (Dashboard limit): #{storage_size_limit} " \
58-
"and less than or equal to enforcement_limit: #{enforcement_limit}")
56+
if storage_size_limit > 0 && notification_limit < storage_size_limit
57+
plan_limits.errors.add(
58+
:notification_limit, "must be greater than or equal to the dashboard limit (#{storage_size_limit})"
59+
)
60+
end
61+
62+
return unless enforcement_limit > 0 && notification_limit > enforcement_limit
63+
64+
plan_limits.errors.add(
65+
:notification_limit, "must be less than or equal to the enforcement limit (#{enforcement_limit})"
66+
)
5967
end
6068

6169
def validate_enforcement_limit
6270
return unless parsed_params.include?(:enforcement_limit)
63-
return if enforcement_limit >= storage_size_limit && enforcement_limit >= notification_limit
71+
return if unlimited_value?(:enforcement_limit)
72+
73+
if storage_size_limit > 0 && enforcement_limit < storage_size_limit
74+
plan_limits.errors.add(
75+
:enforcement_limit, "must be greater than or equal to the dashboard limit (#{storage_size_limit})"
76+
)
77+
end
78+
79+
return unless notification_limit > 0 && enforcement_limit < notification_limit
6480

65-
plan_limits.errors.add(:enforcement_limit, "must be greater than or equal to " \
66-
"storage_size_limit (Dashboard limit): #{storage_size_limit} and " \
67-
"greater than or equal to notification_limit: #{notification_limit}")
81+
plan_limits.errors.add(
82+
:enforcement_limit, "must be greater than or equal to the notification limit (#{notification_limit})"
83+
)
6884
end
6985

7086
def validate_storage_size_limit
7187
return unless parsed_params.include?(:storage_size_limit)
72-
return if storage_size_limit <= enforcement_limit && storage_size_limit <= notification_limit
88+
return if unlimited_value?(:storage_size_limit)
7389

74-
plan_limits.errors.add(:storage_size_limit, "(Dashboard limit) must be less than or equal to " \
75-
"enforcement_limit: #{enforcement_limit} " \
76-
"and notification_limit: #{notification_limit}")
90+
if enforcement_limit > 0 && storage_size_limit > enforcement_limit
91+
plan_limits.errors.add(
92+
:dashboard_limit, "must be less than or equal to the enforcement limit (#{enforcement_limit})"
93+
)
94+
end
95+
96+
return unless notification_limit > 0 && storage_size_limit > notification_limit
97+
98+
plan_limits.errors.add(
99+
:dashboard_limit, "must be less than or equal to the notification limit (#{notification_limit})"
100+
)
77101
end
78102

79103
# Overridden in EE
80104
def parsed_params
81105
params
82106
end
107+
108+
def unlimited_value?(limit)
109+
parsed_params[limit] == 0
110+
end
83111
end
84112
end
85113
end

app/views/devise/passwords/edit.html.haml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
= f.hidden_field :reset_password_token
88
.form-group.gl-px-5
99
= f.label _('New password'), for: "user_password"
10-
= f.password_field :password, autocomplete: 'new-password', class: "form-control gl-form-input top js-password-complexity-validation", required: true, title: _('This field is required.'), data: { qa_selector: 'password_field'}
10+
= f.password_field :password, autocomplete: 'new-password', class: "form-control gl-form-input top js-password-complexity-validation", required: true, title: _('This field is required.'), data: { testid: 'password-field'}
1111
= render_if_exists 'shared/password_requirements_list'
1212
.form-group.gl-px-5
1313
= f.label _('Confirm new password'), for: "user_password_confirmation"
14-
= f.password_field :password_confirmation, autocomplete: 'new-password', class: "form-control gl-form-input bottom", title: _('This field is required.'), data: { qa_selector: 'password_confirmation_field' }, required: true
14+
= f.password_field :password_confirmation, autocomplete: 'new-password', class: "form-control gl-form-input bottom", title: _('This field is required.'), data: { testid: 'password-confirmation-field' }, required: true
1515
.clearfix.gl-px-5.gl-pb-5
16-
= render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { data: { qa_selector: 'change_password_button' } }) do
16+
= render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { data: { testid: 'change-password-button' } }) do
1717
= _('Change your password')
1818

1919
.clearfix.prepend-top-20

app/views/devise/sessions/_new_base.html.haml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
= gitlab_ui_form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'gl-p-5 gl-show-field-errors js-arkose-labs-form', aria: { live: 'assertive' }, data: { testid: 'sign-in-form' }}) do |f|
22
.form-group
33
= f.label :login, _('Username or primary email')
4-
= f.text_field :login, value: @invite_email, class: 'form-control gl-form-input js-username-field', autocomplete: 'username', autofocus: 'autofocus', autocapitalize: 'off', autocorrect: 'off', required: true, title: _('This field is required.'), data: { qa_selector: 'login_field', testid: 'username-field' }
4+
= f.text_field :login, value: @invite_email, class: 'form-control gl-form-input js-username-field', autocomplete: 'username', autofocus: 'autofocus', autocapitalize: 'off', autocorrect: 'off', required: true, title: _('This field is required.'), data: { testid: 'username-field' }
55
.form-group
66
= f.label :password, _('Password')
77
= f.password_field :password, class: 'form-control gl-form-input js-password', data: { id: "#{resource_name}_password",
8-
qa_selector: 'password_field',
98
testid: 'password-field',
109
name: "#{resource_name}[password]" }
1110
.form-text.gl-text-right
@@ -22,5 +21,5 @@
2221
.form-group
2322
= f.gitlab_ui_checkbox_component :remember_me, _('Remember me'), checkbox_options: { autocomplete: 'off' }
2423

25-
= render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { class: 'js-sign-in-button', data: { qa_selector: 'sign_in_button', testid: 'sign-in-button' } }) do
24+
= render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { class: 'js-sign-in-button', data: { testid: 'sign-in-button' } }) do
2625
= _('Sign in')

app/views/devise/sessions/_new_ldap.html.haml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
= gitlab_ui_form_for(provider, url: omniauth_callback_path(:user, provider), html: { class: 'gl-p-5 gl-show-field-errors', aria: { live: 'assertive' }, data: { testid: 'new_ldap_user' }}) do |f|
77
.form-group
88
= f.label :username, _('Username')
9-
= f.text_field :username, name: :username, autocomplete: :username, class: 'form-control gl-form-input', title: _('This field is required.'), autofocus: 'autofocus', data: { qa_selector: 'username_field' }, required: true
9+
= f.text_field :username, name: :username, autocomplete: :username, class: 'form-control gl-form-input', title: _('This field is required.'), autofocus: 'autofocus', data: { testid: 'username-field' }, required: true
1010
.form-group
1111
= f.label :password, _('Password')
12-
%input.form-control.gl-form-input.js-password{ data: { id: "#{provider}_password", name: 'password', qa_selector: 'password_field' } }
12+
%input.form-control.gl-form-input.js-password{ data: { id: "#{provider}_password", name: 'password', testid: 'password-field' } }
1313

1414
- if render_remember_me
1515
= f.gitlab_ui_checkbox_component :remember_me, _('Remember me'), checkbox_options: { name: :remember_me, autocomplete: 'off' }
1616

17-
= render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { data: { qa_selector: 'sign_in_button' } }) do
17+
= render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { data: { testid: 'sign-in-button' } }) do
1818
= submit_message

0 commit comments

Comments
 (0)