diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /app/assets/javascripts/pages/projects | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'app/assets/javascripts/pages/projects')
23 files changed, 105 insertions, 41 deletions
diff --git a/app/assets/javascripts/pages/projects/blob/show/index.js b/app/assets/javascripts/pages/projects/blob/show/index.js index b365e039191..2fc9a111405 100644 --- a/app/assets/javascripts/pages/projects/blob/show/index.js +++ b/app/assets/javascripts/pages/projects/blob/show/index.js @@ -1,5 +1,6 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; +import VueRouter from 'vue-router'; import TableOfContents from '~/blob/components/table_contents.vue'; import PipelineTourSuccessModal from '~/blob/pipeline_tour_success_modal.vue'; import { BlobViewer, initAuxiliaryViewer } from '~/blob/viewer/index'; @@ -12,11 +13,14 @@ import BlobContentViewer from '~/repository/components/blob_content_viewer.vue'; import '~/sourcegraph/load'; Vue.use(VueApollo); +Vue.use(VueRouter); const apolloProvider = new VueApollo({ defaultClient: createDefaultClient(), }); +const router = new VueRouter({ mode: 'history' }); + const viewBlobEl = document.querySelector('#js-view-blob-app'); if (viewBlobEl) { @@ -25,6 +29,7 @@ if (viewBlobEl) { // eslint-disable-next-line no-new new Vue({ el: viewBlobEl, + router, apolloProvider, provide: { targetBranch, @@ -41,6 +46,7 @@ if (viewBlobEl) { }); initAuxiliaryViewer(); + initBlob(); } else { new BlobViewer(); // eslint-disable-line no-new initBlob(); diff --git a/app/assets/javascripts/pages/projects/branches/index/index.js b/app/assets/javascripts/pages/projects/branches/index/index.js index 97dc76908af..d279c4cbb08 100644 --- a/app/assets/javascripts/pages/projects/branches/index/index.js +++ b/app/assets/javascripts/pages/projects/branches/index/index.js @@ -1,13 +1,11 @@ import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior'; import AjaxLoadingSpinner from '~/branches/ajax_loading_spinner'; import BranchSortDropdown from '~/branches/branch_sort_dropdown'; -import DeleteModal from '~/branches/branches_delete_modal'; import initDiverganceGraph from '~/branches/divergence_graph'; import initDeleteBranchButton from '~/branches/init_delete_branch_button'; import initDeleteBranchModal from '~/branches/init_delete_branch_modal'; AjaxLoadingSpinner.init(); -new DeleteModal(); // eslint-disable-line no-new const { divergingCountsEndpoint, defaultBranch } = document.querySelector( '.js-branch-list', diff --git a/app/assets/javascripts/pages/projects/edit/index.js b/app/assets/javascripts/pages/projects/edit/index.js index 100ca5b36d9..c0eb2a8fd77 100644 --- a/app/assets/javascripts/pages/projects/edit/index.js +++ b/app/assets/javascripts/pages/projects/edit/index.js @@ -1,5 +1,4 @@ import { PROJECT_BADGE } from '~/badges/constants'; -import initLegacyConfirmDangerModal from '~/confirm_danger_modal'; import initConfirmDanger from '~/init_confirm_danger'; import dirtySubmitFactory from '~/dirty_submit/dirty_submit_factory'; import initFilePickers from '~/file_pickers'; @@ -15,7 +14,6 @@ import initProjectPermissionsSettings from '../shared/permissions'; import initProjectLoadingSpinner from '../shared/save_project_loader'; initFilePickers(); -initLegacyConfirmDangerModal(); initConfirmDanger(); initSettingsPanels(); initProjectDeleteButton(); diff --git a/app/assets/javascripts/pages/projects/find_file/show/index.js b/app/assets/javascripts/pages/projects/find_file/show/index.js index a8225167c6b..f47888f0cb8 100644 --- a/app/assets/javascripts/pages/projects/find_file/show/index.js +++ b/app/assets/javascripts/pages/projects/find_file/show/index.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import ShortcutsFindFile from '~/behaviors/shortcuts/shortcuts_find_file'; -import ProjectFindFile from '~/project_find_file'; +import ProjectFindFile from '~/projects/project_find_file'; const findElement = document.querySelector('.js-file-finder'); const projectFindFile = new ProjectFindFile($('.file-finder-holder'), { diff --git a/app/assets/javascripts/pages/projects/imports/show/index.js b/app/assets/javascripts/pages/projects/imports/show/index.js index 8397826f8eb..21d07e04ddc 100644 --- a/app/assets/javascripts/pages/projects/imports/show/index.js +++ b/app/assets/javascripts/pages/projects/imports/show/index.js @@ -1,3 +1,3 @@ -import ProjectImport from '~/project_import'; +import ProjectImport from '~/projects/project_import'; new ProjectImport(); // eslint-disable-line no-new diff --git a/app/assets/javascripts/pages/projects/incidents/show/index.js b/app/assets/javascripts/pages/projects/incidents/show/index.js index 4633eaef8f9..5a8cfcf8462 100644 --- a/app/assets/javascripts/pages/projects/incidents/show/index.js +++ b/app/assets/javascripts/pages/projects/incidents/show/index.js @@ -1,6 +1,6 @@ +import { initShow } from '~/issues'; import initRelatedIssues from '~/related_issues'; import initSidebarBundle from '~/sidebar/sidebar_bundle'; -import initShow from '~/issues/show'; initShow(); initSidebarBundle(); diff --git a/app/assets/javascripts/pages/projects/init_blob.js b/app/assets/javascripts/pages/projects/init_blob.js index 06aba866ccf..7db34816cfe 100644 --- a/app/assets/javascripts/pages/projects/init_blob.js +++ b/app/assets/javascripts/pages/projects/init_blob.js @@ -2,8 +2,8 @@ import ShortcutsBlob from '~/behaviors/shortcuts/shortcuts_blob'; import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; import BlobForkSuggestion from '~/blob/blob_fork_suggestion'; import BlobLinePermalinkUpdater from '~/blob/blob_line_permalink_updater'; +import LineHighlighter from '~/blob/line_highlighter'; import initBlobBundle from '~/blob_edit/blob_bundle'; -import LineHighlighter from '~/line_highlighter'; export default () => { new LineHighlighter(); // eslint-disable-line no-new diff --git a/app/assets/javascripts/pages/projects/issues/edit/index.js b/app/assets/javascripts/pages/projects/issues/edit/index.js index aa00d1f58bd..06dcd2c2d94 100644 --- a/app/assets/javascripts/pages/projects/issues/edit/index.js +++ b/app/assets/javascripts/pages/projects/issues/edit/index.js @@ -1,3 +1,3 @@ -import initForm from 'ee_else_ce/issues/form'; +import { initForm } from 'ee_else_ce/issues'; initForm(); diff --git a/app/assets/javascripts/pages/projects/issues/index/index.js b/app/assets/javascripts/pages/projects/issues/index/index.js index e937713044c..44b1d5277d1 100644 --- a/app/assets/javascripts/pages/projects/issues/index/index.js +++ b/app/assets/javascripts/pages/projects/issues/index/index.js @@ -1,8 +1,8 @@ import IssuableFilteredSearchTokenKeys from 'ee_else_ce/filtered_search/issuable_filtered_search_token_keys'; import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; import { initCsvImportExportButtons, initIssuableByEmail } from '~/issuable'; -import issuableInitBulkUpdateSidebar from '~/issuable/bulk_update_sidebar/issuable_init_bulk_update_sidebar'; -import { mountIssuablesListApp, mountIssuesListApp, mountJiraIssuesListApp } from '~/issues_list'; +import { initBulkUpdateSidebar, initIssueStatusSelect } from '~/issuable/bulk_update_sidebar'; +import { mountIssuesListApp, mountJiraIssuesListApp } from '~/issues/list'; import initManualOrdering from '~/issues/manual_ordering'; import { FILTERED_SEARCH } from '~/filtered_search/constants'; import { ISSUABLE_INDEX } from '~/issuable/constants'; @@ -20,16 +20,13 @@ if (gon.features?.vueIssuesList) { useDefaultState: true, }); - issuableInitBulkUpdateSidebar.init(ISSUABLE_INDEX.ISSUE); + initBulkUpdateSidebar(ISSUABLE_INDEX.ISSUE); + initIssueStatusSelect(); new UsersSelect(); // eslint-disable-line no-new initCsvImportExportButtons(); initIssuableByEmail(); initManualOrdering(); - - if (gon.features?.vueIssuablesList) { - mountIssuablesListApp(); - } } new ShortcutsNavigation(); // eslint-disable-line no-new diff --git a/app/assets/javascripts/pages/projects/issues/new/index.js b/app/assets/javascripts/pages/projects/issues/new/index.js index aa00d1f58bd..06dcd2c2d94 100644 --- a/app/assets/javascripts/pages/projects/issues/new/index.js +++ b/app/assets/javascripts/pages/projects/issues/new/index.js @@ -1,3 +1,3 @@ -import initForm from 'ee_else_ce/issues/form'; +import { initForm } from 'ee_else_ce/issues'; initForm(); diff --git a/app/assets/javascripts/pages/projects/issues/service_desk/index.js b/app/assets/javascripts/pages/projects/issues/service_desk/index.js index 69639d17f8a..7dd128fedb9 100644 --- a/app/assets/javascripts/pages/projects/issues/service_desk/index.js +++ b/app/assets/javascripts/pages/projects/issues/service_desk/index.js @@ -1,8 +1,3 @@ -import { mountIssuablesListApp } from '~/issues_list'; -import { initFilteredSearchServiceDesk } from '~/issues/init_filtered_search_service_desk'; +import { initFilteredSearchServiceDesk } from '~/issues'; initFilteredSearchServiceDesk(); - -if (gon.features?.vueIssuablesList) { - mountIssuablesListApp(); -} diff --git a/app/assets/javascripts/pages/projects/issues/show/index.js b/app/assets/javascripts/pages/projects/issues/show/index.js index d0b1942f2a4..46a34c025b6 100644 --- a/app/assets/javascripts/pages/projects/issues/show/index.js +++ b/app/assets/javascripts/pages/projects/issues/show/index.js @@ -1,7 +1,7 @@ +import { initShow } from '~/issues'; import { store } from '~/notes/stores'; import initRelatedIssues from '~/related_issues'; import initSidebarBundle from '~/sidebar/sidebar_bundle'; -import initShow from '~/issues/show'; initShow(); initSidebarBundle(store); diff --git a/app/assets/javascripts/pages/projects/labels/edit/index.js b/app/assets/javascripts/pages/projects/labels/edit/index.js index c4d7af39767..cb554e3d4da 100644 --- a/app/assets/javascripts/pages/projects/labels/edit/index.js +++ b/app/assets/javascripts/pages/projects/labels/edit/index.js @@ -1,3 +1,5 @@ import Labels from 'ee_else_ce/labels/labels'; +import { initDeleteLabelModal } from '~/labels'; new Labels(); // eslint-disable-line no-new +initDeleteLabelModal(); diff --git a/app/assets/javascripts/pages/projects/merge_requests/index/index.js b/app/assets/javascripts/pages/projects/merge_requests/index/index.js index acd1731a700..e284e7b2c5e 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/index/index.js +++ b/app/assets/javascripts/pages/projects/merge_requests/index/index.js @@ -2,13 +2,14 @@ import addExtraTokensForMergeRequests from 'ee_else_ce/filtered_search/add_extra import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; import IssuableFilteredSearchTokenKeys from '~/filtered_search/issuable_filtered_search_token_keys'; import { initCsvImportExportButtons, initIssuableByEmail } from '~/issuable'; -import issuableInitBulkUpdateSidebar from '~/issuable/bulk_update_sidebar/issuable_init_bulk_update_sidebar'; +import { initBulkUpdateSidebar, initIssueStatusSelect } from '~/issuable/bulk_update_sidebar'; import { FILTERED_SEARCH } from '~/filtered_search/constants'; import { ISSUABLE_INDEX } from '~/issuable/constants'; import initFilteredSearch from '~/pages/search/init_filtered_search'; import UsersSelect from '~/users_select'; -issuableInitBulkUpdateSidebar.init(ISSUABLE_INDEX.MERGE_REQUEST); +initBulkUpdateSidebar(ISSUABLE_INDEX.MERGE_REQUEST); +initIssueStatusSelect(); addExtraTokensForMergeRequests(IssuableFilteredSearchTokenKeys); IssuableFilteredSearchTokenKeys.removeTokensForKeys('iteration'); diff --git a/app/assets/javascripts/pages/projects/new/index.js b/app/assets/javascripts/pages/projects/new/index.js index d89b4d0e0a3..5d830872ed9 100644 --- a/app/assets/javascripts/pages/projects/new/index.js +++ b/app/assets/javascripts/pages/projects/new/index.js @@ -1,5 +1,5 @@ import { initNewProjectCreation, initNewProjectUrlSelect } from '~/projects/new'; -import initProjectVisibilitySelector from '~/project_visibility'; +import initProjectVisibilitySelector from '~/projects/project_visibility'; import initProjectNew from '~/projects/project_new'; initProjectVisibilitySelector(); diff --git a/app/assets/javascripts/pages/projects/packages/packages/index.js b/app/assets/javascripts/pages/projects/packages/packages/index.js new file mode 100644 index 00000000000..cbe08565cfa --- /dev/null +++ b/app/assets/javascripts/pages/projects/packages/packages/index.js @@ -0,0 +1,8 @@ +import packageApp from '~/packages_and_registries/package_registry/index'; + +const app = packageApp(); + +if (app) { + app.attachBreadcrumb(); + app.attachMainComponent(); +} diff --git a/app/assets/javascripts/pages/projects/packages/packages/index/index.js b/app/assets/javascripts/pages/projects/packages/packages/index/index.js deleted file mode 100644 index 174973a9fad..00000000000 --- a/app/assets/javascripts/pages/projects/packages/packages/index/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import packageApp from '~/packages_and_registries/package_registry/index'; - -packageApp(); diff --git a/app/assets/javascripts/pages/projects/packages/packages/show/index.js b/app/assets/javascripts/pages/projects/packages/packages/show/index.js deleted file mode 100644 index 2dee87985cb..00000000000 --- a/app/assets/javascripts/pages/projects/packages/packages/show/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import initPackageDetails from '~/packages_and_registries/package_registry/pages/details'; - -initPackageDetails(); diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/timezone_dropdown.js b/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/timezone_dropdown.js index e92b9b30fa4..277d2e0d30a 100644 --- a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/timezone_dropdown.js +++ b/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/timezone_dropdown.js @@ -1,6 +1,6 @@ import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown'; -const defaultTimezone = { name: 'UTC', offset: 0 }; +const defaultTimezone = { identifier: 'Etc/UTC', name: 'UTC', offset: 0 }; const defaults = { $inputEl: null, $dropdownEl: null, @@ -70,7 +70,7 @@ export default class TimezoneDropdown { setDropdownValue(timezone) { this.$dropdownToggle.text(this.displayFormat(timezone)); - this.$input.val(timezone.name); + this.$input.val(timezone.identifier); } handleDropdownChange({ selectedObj, e }) { diff --git a/app/assets/javascripts/pages/projects/services/edit/index.js b/app/assets/javascripts/pages/projects/services/edit/index.js index a2b18d86240..2048d3dfc37 100644 --- a/app/assets/javascripts/pages/projects/services/edit/index.js +++ b/app/assets/javascripts/pages/projects/services/edit/index.js @@ -2,7 +2,7 @@ import initIntegrationSettingsForm from '~/integrations/edit'; import PrometheusAlerts from '~/prometheus_alerts'; import CustomMetrics from '~/prometheus_metrics/custom_metrics'; -initIntegrationSettingsForm('.js-integration-settings-form'); +initIntegrationSettingsForm(); const prometheusSettingsSelector = '.js-prometheus-metrics-monitoring'; const prometheusSettingsWrapper = document.querySelector(prometheusSettingsSelector); diff --git a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue index 384ee1f5034..d5e00f54e91 100644 --- a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue +++ b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue @@ -1,6 +1,6 @@ <script> -import { GlIcon, GlSprintf, GlLink, GlFormCheckbox, GlToggle } from '@gitlab/ui'; - +import { GlButton, GlIcon, GlSprintf, GlLink, GlFormCheckbox, GlToggle } from '@gitlab/ui'; +import ConfirmDanger from '~/vue_shared/components/confirm_danger/confirm_danger.vue'; import settingsMixin from 'ee_else_ce/pages/projects/shared/permissions/mixins/settings_pannel_mixin'; import { __, s__ } from '~/locale'; import { @@ -41,16 +41,19 @@ export default { pucWarningHelpText: s__( 'ProjectSettings|Highlight the usage of hidden unicode characters. These have innocent uses for right-to-left languages, but can also be used in potential exploits.', ), + confirmButtonText: __('Save changes'), }, components: { projectFeatureSetting, projectSettingRow, + GlButton, GlIcon, GlSprintf, GlLink, GlFormCheckbox, GlToggle, + ConfirmDanger, }, mixins: [settingsMixin], @@ -163,6 +166,15 @@ export default { required: false, default: '', }, + confirmationPhrase: { + type: String, + required: true, + }, + showVisibilityConfirmModal: { + type: Boolean, + required: false, + default: false, + }, }, data() { const defaults = { @@ -274,6 +286,12 @@ export default { cveIdRequestIsDisabled() { return this.visibilityLevel !== visibilityOptions.PUBLIC; }, + isVisibilityReduced() { + return ( + this.showVisibilityConfirmModal && + this.visibilityLevel < this.currentSettings.visibilityLevel + ); + }, }, watch: { @@ -774,5 +792,23 @@ export default { <template #help>{{ $options.i18n.pucWarningHelpText }}</template> </gl-form-checkbox> </project-setting-row> + <confirm-danger + v-if="isVisibilityReduced" + button-variant="confirm" + :disabled="false" + :phrase="confirmationPhrase" + :button-text="$options.i18n.confirmButtonText" + data-testid="project-features-save-button" + @confirm="$emit('confirm')" + /> + <gl-button + v-else + type="submit" + variant="confirm" + data-testid="project-features-save-button" + data-qa-selector="visibility_features_permissions_save_button" + > + {{ $options.i18n.confirmButtonText }} + </gl-button> </div> </template> diff --git a/app/assets/javascripts/pages/projects/shared/permissions/index.js b/app/assets/javascripts/pages/projects/shared/permissions/index.js index d7bae44e96e..de8b1cc400e 100644 --- a/app/assets/javascripts/pages/projects/shared/permissions/index.js +++ b/app/assets/javascripts/pages/projects/shared/permissions/index.js @@ -1,4 +1,5 @@ import Vue from 'vue'; +import { parseBoolean } from '~/lib/utils/common_utils'; import settingsPanel from './components/settings_panel.vue'; export default function initProjectPermissionsSettings() { @@ -6,8 +7,36 @@ export default function initProjectPermissionsSettings() { const componentPropsEl = document.querySelector('.js-project-permissions-form-data'); const componentProps = JSON.parse(componentPropsEl.innerHTML); + const { + targetFormId, + additionalInformation, + confirmDangerMessage, + confirmButtonText, + showVisibilityConfirmModal, + htmlConfirmationMessage, + phrase: confirmationPhrase, + } = mountPoint.dataset; + return new Vue({ el: mountPoint, - render: (createElement) => createElement(settingsPanel, { props: { ...componentProps } }), + provide: { + additionalInformation, + confirmDangerMessage, + confirmButtonText, + htmlConfirmationMessage: parseBoolean(htmlConfirmationMessage), + }, + render: (createElement) => + createElement(settingsPanel, { + props: { + ...componentProps, + confirmationPhrase, + showVisibilityConfirmModal: parseBoolean(showVisibilityConfirmModal), + }, + on: { + confirm: () => { + if (targetFormId) document.getElementById(targetFormId)?.submit(); + }, + }, + }), }); } diff --git a/app/assets/javascripts/pages/projects/show/index.js b/app/assets/javascripts/pages/projects/show/index.js index 31d69a731fe..71c6773c176 100644 --- a/app/assets/javascripts/pages/projects/show/index.js +++ b/app/assets/javascripts/pages/projects/show/index.js @@ -1,16 +1,16 @@ import initTree from 'ee_else_ce/repository'; import Activities from '~/activities'; import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; -import { BlobViewer } from '~/blob/viewer/index'; +import { BlobViewer } from '~/blob/viewer'; import { initUploadForm } from '~/blob_edit/blob_bundle'; import initInviteMembersModal from '~/invite_members/init_invite_members_modal'; import initInviteMembersTrigger from '~/invite_members/init_invite_members_trigger'; import leaveByUrl from '~/namespaces/leave_by_url'; import initVueNotificationsDropdown from '~/notifications'; +import Star from '~/projects/star'; import { initUploadFileTrigger } from '~/projects/upload_file'; import initReadMore from '~/read_more'; import UserCallout from '~/user_callout'; -import Star from '../../../star'; initReadMore(); new Star(); // eslint-disable-line no-new |