From c19944d9970b788d8523cee6ee05217a8afd7646 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 7 Mar 2023 21:13:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../authentication/webauthn/authenticate.js | 3 +- .../webauthn/components/registration.vue | 4 +-- .../authentication/webauthn/constants.js | 2 ++ .../javascripts/authentication/webauthn/error.js | 7 ++-- .../authentication/webauthn/register.js | 3 +- .../javascripts/authentication/webauthn/util.js | 3 -- .../issues/create_merge_request_dropdown.js | 2 +- app/assets/javascripts/issues/issue.js | 2 +- .../issues/list/components/issues_list_app.vue | 2 +- app/assets/javascripts/issues/manual_ordering.js | 2 +- .../issues/related_merge_requests/store/actions.js | 2 +- .../javascripts/issues/show/components/app.vue | 15 +++------ .../issues/show/components/description.vue | 2 +- .../issues/show/components/header_actions.vue | 2 +- .../components/incidents/create_timeline_event.vue | 2 +- .../show/components/incidents/incident_tabs.vue | 2 +- .../components/incidents/timeline_events_list.vue | 2 +- .../issues/show/components/incidents/utils.js | 2 +- .../pages/groups/new/components/app.vue | 9 ++++- app/assets/javascripts/pages/groups/new/index.js | 2 ++ .../pages/projects/commit/show/index.js | 2 +- .../javascripts/pages/users/activity_calendar.js | 2 ++ app/assets/javascripts/pages/users/user_tabs.js | 2 +- .../javascripts/projects/new/components/app.vue | 10 ++++-- app/assets/javascripts/projects/new/index.js | 2 ++ .../components/system_notes/system_note.vue | 6 +++- .../filtered_search_bar/tokens/branch_token.vue | 2 +- .../tokens/crm_contact_token.vue | 2 +- .../filtered_search_bar/tokens/release_token.vue | 2 +- .../filtered_search_bar/tokens/user_token.vue | 2 +- .../components/user_popover/user_popover.vue | 2 +- .../merge_request_artifact_download.vue | 2 +- .../security_reports/security_reports_app.vue | 2 +- app/graphql/mutations/design_management/update.rb | 39 ++++++++++++++++++++++ app/graphql/types/design_management/design_type.rb | 7 ++++ app/graphql/types/mutation_type.rb | 1 + app/policies/issue_policy.rb | 1 + app/policies/project_policy.rb | 2 ++ .../resource_access_tokens/create_service.rb | 28 +++++++--------- app/views/groups/new.html.haml | 2 +- app/views/projects/new.html.haml | 10 +++++- 41 files changed, 135 insertions(+), 63 deletions(-) create mode 100644 app/graphql/mutations/design_management/update.rb (limited to 'app') diff --git a/app/assets/javascripts/authentication/webauthn/authenticate.js b/app/assets/javascripts/authentication/webauthn/authenticate.js index 47cb7a40f76..748945a680b 100644 --- a/app/assets/javascripts/authentication/webauthn/authenticate.js +++ b/app/assets/javascripts/authentication/webauthn/authenticate.js @@ -1,3 +1,4 @@ +import { WEBAUTHN_AUTHENTICATE } from './constants'; import WebAuthnError from './error'; import WebAuthnFlow from './flow'; import { supported, convertGetParams, convertGetResponse } from './util'; @@ -44,7 +45,7 @@ export default class WebAuthnAuthenticate { this.renderAuthenticated(JSON.stringify(convertedResponse)); }) .catch((err) => { - this.flow.renderError(new WebAuthnError(err, 'authenticate')); + this.flow.renderError(new WebAuthnError(err, WEBAUTHN_AUTHENTICATE)); }); } diff --git a/app/assets/javascripts/authentication/webauthn/components/registration.vue b/app/assets/javascripts/authentication/webauthn/components/registration.vue index 1cc57046562..9a3644e0325 100644 --- a/app/assets/javascripts/authentication/webauthn/components/registration.vue +++ b/app/assets/javascripts/authentication/webauthn/components/registration.vue @@ -30,10 +30,10 @@ import { STATE_UNSUPPORTED, STATE_WAITING, WEBAUTHN_DOCUMENTATION_PATH, + WEBAUTHN_REGISTER, } from '~/authentication/webauthn/constants'; import WebAuthnError from '~/authentication/webauthn/error'; import { - FLOW_REGISTER, convertCreateParams, convertCreateResponse, isHTTPS, @@ -123,7 +123,7 @@ export default { this.credentials = JSON.stringify(convertCreateResponse(credentials)); this.state = STATE_SUCCESS; } catch (error) { - this.errorMessage = new WebAuthnError(error, FLOW_REGISTER).message(); + this.errorMessage = new WebAuthnError(error, WEBAUTHN_REGISTER).message(); this.state = STATE_ERROR; } }, diff --git a/app/assets/javascripts/authentication/webauthn/constants.js b/app/assets/javascripts/authentication/webauthn/constants.js index 6646cb2eb3f..c41e6d2bd58 100644 --- a/app/assets/javascripts/authentication/webauthn/constants.js +++ b/app/assets/javascripts/authentication/webauthn/constants.js @@ -38,6 +38,8 @@ export const STATE_SUCCESS = 'success'; export const STATE_UNSUPPORTED = 'unsupported'; export const STATE_WAITING = 'waiting'; +export const WEBAUTHN_AUTHENTICATE = 'authenticate'; +export const WEBAUTHN_REGISTER = 'register'; export const WEBAUTHN_DOCUMENTATION_PATH = helpPagePath( 'user/profile/account/two_factor_authentication', { anchor: 'set-up-a-webauthn-device' }, diff --git a/app/assets/javascripts/authentication/webauthn/error.js b/app/assets/javascripts/authentication/webauthn/error.js index a1a3f861c25..40dbecd8bc9 100644 --- a/app/assets/javascripts/authentication/webauthn/error.js +++ b/app/assets/javascripts/authentication/webauthn/error.js @@ -1,5 +1,6 @@ import { __ } from '~/locale'; -import { isHTTPS, FLOW_AUTHENTICATE, FLOW_REGISTER } from './util'; +import { WEBAUTHN_AUTHENTICATE, WEBAUTHN_REGISTER } from './constants'; +import { isHTTPS } from './util'; export default class WebAuthnError { constructor(error, flowType) { @@ -13,9 +14,9 @@ export default class WebAuthnError { message() { if (this.errorName === 'NotSupportedError') { return __('Your device is not compatible with GitLab. Please try another device'); - } else if (this.errorName === 'InvalidStateError' && this.flowType === FLOW_AUTHENTICATE) { + } else if (this.errorName === 'InvalidStateError' && this.flowType === WEBAUTHN_AUTHENTICATE) { return __('This device has not been registered with us.'); - } else if (this.errorName === 'InvalidStateError' && this.flowType === FLOW_REGISTER) { + } else if (this.errorName === 'InvalidStateError' && this.flowType === WEBAUTHN_REGISTER) { return __('This device has already been registered with us.'); } else if (this.errorName === 'SecurityError' && this.httpsDisabled) { return __( diff --git a/app/assets/javascripts/authentication/webauthn/register.js b/app/assets/javascripts/authentication/webauthn/register.js index 62ebf85abe4..c00d3ede2c1 100644 --- a/app/assets/javascripts/authentication/webauthn/register.js +++ b/app/assets/javascripts/authentication/webauthn/register.js @@ -2,6 +2,7 @@ import { __ } from '~/locale'; import WebAuthnError from './error'; import WebAuthnFlow from './flow'; import { supported, isHTTPS, convertCreateParams, convertCreateResponse } from './util'; +import { WEBAUTHN_REGISTER } from './constants'; // Register WebAuthn devices for users to authenticate with. // @@ -40,7 +41,7 @@ export default class WebAuthnRegister { publicKey: this.webauthnOptions, }) .then((cred) => this.renderRegistered(JSON.stringify(convertCreateResponse(cred)))) - .catch((err) => this.flow.renderError(new WebAuthnError(err, 'register'))); + .catch((err) => this.flow.renderError(new WebAuthnError(err, WEBAUTHN_REGISTER))); } renderSetup() { diff --git a/app/assets/javascripts/authentication/webauthn/util.js b/app/assets/javascripts/authentication/webauthn/util.js index 4e1409b9ed9..0ff0f0e6a29 100644 --- a/app/assets/javascripts/authentication/webauthn/util.js +++ b/app/assets/javascripts/authentication/webauthn/util.js @@ -8,9 +8,6 @@ export function isHTTPS() { return window.location.protocol.startsWith('https'); } -export const FLOW_AUTHENTICATE = 'authenticate'; -export const FLOW_REGISTER = 'register'; - /** * Converts a base64 string to an ArrayBuffer * diff --git a/app/assets/javascripts/issues/create_merge_request_dropdown.js b/app/assets/javascripts/issues/create_merge_request_dropdown.js index caf82e482ea..c821c18bcb9 100644 --- a/app/assets/javascripts/issues/create_merge_request_dropdown.js +++ b/app/assets/javascripts/issues/create_merge_request_dropdown.js @@ -7,7 +7,7 @@ import { import confidentialMergeRequestState from '~/confidential_merge_request/state'; import DropLab from '~/filtered_search/droplab/drop_lab_deprecated'; import ISetter from '~/filtered_search/droplab/plugins/input_setter'; -import { createAlert } from '~/flash'; +import { createAlert } from '~/alert'; import axios from '~/lib/utils/axios_utils'; import { __, sprintf } from '~/locale'; import { mergeUrlParams } from '~/lib/utils/url_utility'; diff --git a/app/assets/javascripts/issues/issue.js b/app/assets/javascripts/issues/issue.js index de1c689e590..b7fd99d8042 100644 --- a/app/assets/javascripts/issues/issue.js +++ b/app/assets/javascripts/issues/issue.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import { joinPaths } from '~/lib/utils/url_utility'; -import { createAlert } from '~/flash'; +import { createAlert } from '~/alert'; import { EVENT_ISSUABLE_VUE_APP_CHANGE } from '~/issuable/constants'; import axios from '~/lib/utils/axios_utils'; import { addDelimiter } from '~/lib/utils/text_utility'; diff --git a/app/assets/javascripts/issues/list/components/issues_list_app.vue b/app/assets/javascripts/issues/list/components/issues_list_app.vue index 35727566fba..f03ecdc4125 100644 --- a/app/assets/javascripts/issues/list/components/issues_list_app.vue +++ b/app/assets/javascripts/issues/list/components/issues_list_app.vue @@ -7,7 +7,7 @@ import IssueCardStatistics from 'ee_else_ce/issues/list/components/issue_card_st import IssueCardTimeInfo from 'ee_else_ce/issues/list/components/issue_card_time_info.vue'; import getIssuesQuery from 'ee_else_ce/issues/list/queries/get_issues.query.graphql'; import getIssuesCountsQuery from 'ee_else_ce/issues/list/queries/get_issues_counts.query.graphql'; -import { createAlert, VARIANT_INFO } from '~/flash'; +import { createAlert, VARIANT_INFO } from '~/alert'; import { TYPENAME_USER } from '~/graphql_shared/constants'; import { convertToGraphQLId, getIdFromGraphQLId } from '~/graphql_shared/utils'; import CsvImportExportButtons from '~/issuable/components/csv_import_export_buttons.vue'; diff --git a/app/assets/javascripts/issues/manual_ordering.js b/app/assets/javascripts/issues/manual_ordering.js index 1bb53dfd50d..f22062cf048 100644 --- a/app/assets/javascripts/issues/manual_ordering.js +++ b/app/assets/javascripts/issues/manual_ordering.js @@ -1,5 +1,5 @@ import Sortable from 'sortablejs'; -import { createAlert } from '~/flash'; +import { createAlert } from '~/alert'; import axios from '~/lib/utils/axios_utils'; import { s__ } from '~/locale'; import { getSortableDefaultOptions, sortableStart } from '~/sortable/utils'; diff --git a/app/assets/javascripts/issues/related_merge_requests/store/actions.js b/app/assets/javascripts/issues/related_merge_requests/store/actions.js index 4c81f1d9bc1..ad5b61424dc 100644 --- a/app/assets/javascripts/issues/related_merge_requests/store/actions.js +++ b/app/assets/javascripts/issues/related_merge_requests/store/actions.js @@ -1,4 +1,4 @@ -import { createAlert } from '~/flash'; +import { createAlert } from '~/alert'; import axios from '~/lib/utils/axios_utils'; import { normalizeHeaders } from '~/lib/utils/common_utils'; import { __ } from '~/locale'; diff --git a/app/assets/javascripts/issues/show/components/app.vue b/app/assets/javascripts/issues/show/components/app.vue index 0be11c5c537..851808b628e 100644 --- a/app/assets/javascripts/issues/show/components/app.vue +++ b/app/assets/javascripts/issues/show/components/app.vue @@ -1,7 +1,7 @@