diff options
Diffstat (limited to 'app/assets/javascripts/pages')
40 files changed, 79 insertions, 1026 deletions
diff --git a/app/assets/javascripts/pages/admin/abuse_reports/abuse_reports.js b/app/assets/javascripts/pages/admin/abuse_reports/abuse_reports.js deleted file mode 100644 index 29e92a8abad..00000000000 --- a/app/assets/javascripts/pages/admin/abuse_reports/abuse_reports.js +++ /dev/null @@ -1,38 +0,0 @@ -import $ from 'jquery'; -import { parseBoolean } from '~/lib/utils/common_utils'; -import { truncate } from '~/lib/utils/text_utility'; - -const MAX_MESSAGE_LENGTH = 500; -const MESSAGE_CELL_SELECTOR = '.abuse-reports .message'; - -export default class AbuseReports { - constructor() { - $(MESSAGE_CELL_SELECTOR).each(this.truncateLongMessage); - $(document) - .off('click', MESSAGE_CELL_SELECTOR) - .on('click', MESSAGE_CELL_SELECTOR, this.toggleMessageTruncation); - } - - truncateLongMessage() { - const $messageCellElement = $(this); - const reportMessage = $messageCellElement.text(); - if (reportMessage.length > MAX_MESSAGE_LENGTH) { - $messageCellElement.data('originalMessage', reportMessage); - $messageCellElement.data('messageTruncated', 'true'); - $messageCellElement.text(truncate(reportMessage, MAX_MESSAGE_LENGTH)); - } - } - - toggleMessageTruncation() { - const $messageCellElement = $(this); - const originalMessage = $messageCellElement.data('originalMessage'); - if (!originalMessage) return; - if (parseBoolean($messageCellElement.data('messageTruncated'))) { - $messageCellElement.data('messageTruncated', 'false'); - $messageCellElement.text(originalMessage); - } else { - $messageCellElement.data('messageTruncated', 'true'); - $messageCellElement.text(truncate(originalMessage, MAX_MESSAGE_LENGTH)); - } - } -} diff --git a/app/assets/javascripts/pages/admin/abuse_reports/index.js b/app/assets/javascripts/pages/admin/abuse_reports/index.js index 7634f131e4d..78fef1b5531 100644 --- a/app/assets/javascripts/pages/admin/abuse_reports/index.js +++ b/app/assets/javascripts/pages/admin/abuse_reports/index.js @@ -1,10 +1,3 @@ import { initAbuseReportsApp } from '~/admin/abuse_reports'; -import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior'; -import UsersSelect from '~/users_select'; -import AbuseReports from './abuse_reports'; -new AbuseReports(); /* eslint-disable-line no-new */ -new UsersSelect(); /* eslint-disable-line no-new */ - -initDeprecatedRemoveRowBehavior(); initAbuseReportsApp(); diff --git a/app/assets/javascripts/pages/admin/application_settings/general/index.js b/app/assets/javascripts/pages/admin/application_settings/general/index.js index 8a810ca649c..d0593c82ac1 100644 --- a/app/assets/javascripts/pages/admin/application_settings/general/index.js +++ b/app/assets/javascripts/pages/admin/application_settings/general/index.js @@ -1,3 +1,4 @@ +import { initSilentModeSettings } from '~/silent_mode_settings'; import initAccountAndLimitsSection from '../account_and_limits'; import initGitpod from '../gitpod'; import initSignupRestrictions from '../signup_restrictions'; @@ -6,4 +7,5 @@ import initSignupRestrictions from '../signup_restrictions'; initAccountAndLimitsSection(); initGitpod(); initSignupRestrictions(); + initSilentModeSettings(); })(); diff --git a/app/assets/javascripts/pages/admin/jobs/components/cancel_jobs.vue b/app/assets/javascripts/pages/admin/jobs/components/cancel_jobs.vue deleted file mode 100644 index 72cfc005782..00000000000 --- a/app/assets/javascripts/pages/admin/jobs/components/cancel_jobs.vue +++ /dev/null @@ -1,37 +0,0 @@ -<script> -import { GlButton, GlModalDirective, GlTooltipDirective } from '@gitlab/ui'; -import CancelJobsModal from './cancel_jobs_modal.vue'; -import { CANCEL_JOBS_MODAL_ID, CANCEL_JOBS_BUTTON_TEXT, CANCEL_BUTTON_TOOLTIP } from './constants'; - -export default { - name: 'CancelJobs', - components: { - GlButton, - CancelJobsModal, - }, - directives: { - GlModal: GlModalDirective, - GlTooltip: GlTooltipDirective, - }, - props: { - url: { - type: String, - required: true, - }, - }, - modalId: CANCEL_JOBS_MODAL_ID, - buttonText: CANCEL_JOBS_BUTTON_TEXT, - buttonTooltip: CANCEL_BUTTON_TOOLTIP, -}; -</script> -<template> - <div> - <gl-button - v-gl-modal="$options.modalId" - v-gl-tooltip="$options.buttonTooltip" - variant="danger" - >{{ $options.buttonText }}</gl-button - > - <cancel-jobs-modal :modal-id="$options.modalId" :url="url" @confirm="$emit('confirm')" /> - </div> -</template> diff --git a/app/assets/javascripts/pages/admin/jobs/components/cancel_jobs_modal.vue b/app/assets/javascripts/pages/admin/jobs/components/cancel_jobs_modal.vue deleted file mode 100644 index b2c5326fefd..00000000000 --- a/app/assets/javascripts/pages/admin/jobs/components/cancel_jobs_modal.vue +++ /dev/null @@ -1,66 +0,0 @@ -<script> -import { GlModal } from '@gitlab/ui'; -import { createAlert } from '~/alert'; -import axios from '~/lib/utils/axios_utils'; -import { redirectTo } from '~/lib/utils/url_utility'; // eslint-disable-line import/no-deprecated -import { - CANCEL_TEXT, - CANCEL_JOBS_FAILED_TEXT, - CANCEL_JOBS_MODAL_TITLE, - CANCEL_JOBS_WARNING, - PRIMARY_ACTION_TEXT, -} from './constants'; - -export default { - components: { - GlModal, - }, - props: { - url: { - type: String, - required: true, - }, - modalId: { - type: String, - required: true, - }, - }, - methods: { - onSubmit() { - return axios - .post(this.url) - .then((response) => { - // follow the rediect to refresh the page - redirectTo(response.request.responseURL); // eslint-disable-line import/no-deprecated - }) - .catch((error) => { - createAlert({ - message: CANCEL_JOBS_FAILED_TEXT, - }); - throw error; - }); - }, - }, - primaryAction: { - text: PRIMARY_ACTION_TEXT, - attributes: { variant: 'danger' }, - }, - cancelAction: { - text: CANCEL_TEXT, - }, - CANCEL_JOBS_WARNING, - CANCEL_JOBS_MODAL_TITLE, -}; -</script> - -<template> - <gl-modal - :modal-id="modalId" - :action-primary="$options.primaryAction" - :action-cancel="$options.cancelAction" - :title="$options.CANCEL_JOBS_MODAL_TITLE" - @primary="onSubmit" - > - {{ $options.CANCEL_JOBS_WARNING }} - </gl-modal> -</template> diff --git a/app/assets/javascripts/pages/admin/jobs/components/constants.js b/app/assets/javascripts/pages/admin/jobs/components/constants.js deleted file mode 100644 index 4af8cb355fc..00000000000 --- a/app/assets/javascripts/pages/admin/jobs/components/constants.js +++ /dev/null @@ -1,35 +0,0 @@ -import { s__, __ } from '~/locale'; -import { RAW_TEXT_WARNING } from '~/jobs/components/table/constants'; - -export const JOBS_COUNT_ERROR_MESSAGE = __('There was an error fetching the number of jobs.'); -export const JOBS_FETCH_ERROR_MSG = __('There was an error fetching the jobs.'); -export const LOADING_ARIA_LABEL = __('Loading'); -export const CANCELABLE_JOBS_ERROR_MSG = __('There was an error fetching the cancelable jobs.'); -export const CANCEL_JOBS_MODAL_ID = 'cancel-jobs-modal'; -export const CANCEL_JOBS_MODAL_TITLE = s__('AdminArea|Are you sure?'); -export const CANCEL_JOBS_BUTTON_TEXT = s__('AdminArea|Cancel all jobs'); -export const CANCEL_BUTTON_TOOLTIP = s__('AdminArea|Cancel all running and pending jobs'); -export const CANCEL_TEXT = __('Cancel'); -export const CANCEL_JOBS_FAILED_TEXT = s__('AdminArea|Canceling jobs failed'); -export const PRIMARY_ACTION_TEXT = s__('AdminArea|Yes, proceed'); -export const CANCEL_JOBS_WARNING = s__( - "AdminArea|You're about to cancel all running and pending jobs across this instance. Do you want to proceed?", -); -export const RUNNER_EMPTY_TEXT = __('None'); -export const RUNNER_NO_DESCRIPTION = s__('Runners|No description'); - -/* Admin Table constants */ -/* The field list is based on app/assets/javascripts/jobs/components/table/constants.js */ -export const DEFAULT_FIELDS_ADMIN = [ - { key: 'status', label: __('Status'), columnClass: 'gl-w-15p' }, - { key: 'job', label: __('Job'), columnClass: 'gl-w-20p' }, - { key: 'project', label: __('Project'), columnClass: 'gl-w-20p' }, - { key: 'runner', label: __('Runner'), columnClass: 'gl-w-15p' }, - { key: 'pipeline', label: __('Pipeline'), columnClass: 'gl-w-10p' }, - { key: 'stage', label: __('Stage'), columnClass: 'gl-w-10p' }, - { key: 'name', label: __('Name'), columnClass: 'gl-w-15p' }, - { key: 'duration', label: __('Duration'), columnClass: 'gl-w-15p' }, - { key: 'actions', label: '', columnClass: 'gl-w-10p' }, -]; - -export const RAW_TEXT_WARNING_ADMIN = RAW_TEXT_WARNING; diff --git a/app/assets/javascripts/pages/admin/jobs/components/jobs_skeleton_loader.vue b/app/assets/javascripts/pages/admin/jobs/components/jobs_skeleton_loader.vue deleted file mode 100644 index c305e09af0d..00000000000 --- a/app/assets/javascripts/pages/admin/jobs/components/jobs_skeleton_loader.vue +++ /dev/null @@ -1,26 +0,0 @@ -<script> -import { GlSkeletonLoader } from '@gitlab/ui'; - -export default { - components: { - GlSkeletonLoader, - }, -}; -</script> - -<template> - <gl-skeleton-loader :width="1248" :height="73"> - <circle cx="748.031" cy="37.7193" r="15.0307" /> - <circle cx="787.241" cy="37.7193" r="15.0307" /> - <circle cx="827.759" cy="37.7193" r="15.0307" /> - <circle cx="866.969" cy="37.7193" r="15.0307" /> - <circle cx="380" cy="37" r="18" /> - <rect x="432" y="19" width="126.587" height="15" /> - <rect x="432" y="41" width="247" height="15" /> - <rect x="158" y="19" width="86.1" height="15" /> - <rect x="158" y="41" width="168" height="15" /> - <rect x="22" y="19" width="96" height="36" /> - <rect x="924" y="30" width="96" height="15" /> - <rect x="1057" y="20" width="166" height="35" /> - </gl-skeleton-loader> -</template> diff --git a/app/assets/javascripts/pages/admin/jobs/components/table/admin_jobs_table_app.vue b/app/assets/javascripts/pages/admin/jobs/components/table/admin_jobs_table_app.vue deleted file mode 100644 index daa4119f44d..00000000000 --- a/app/assets/javascripts/pages/admin/jobs/components/table/admin_jobs_table_app.vue +++ /dev/null @@ -1,259 +0,0 @@ -<script> -import { GlAlert, GlIntersectionObserver, GlLoadingIcon } from '@gitlab/ui'; -import { setUrlParams, updateHistory, queryToObject } from '~/lib/utils/url_utility'; -import { validateQueryString } from '~/jobs/components/filtered_search/utils'; -import JobsTable from '~/jobs/components/table/jobs_table.vue'; -import JobsTableTabs from '~/jobs/components/table/jobs_table_tabs.vue'; -import JobsFilteredSearch from '~/jobs/components/filtered_search/jobs_filtered_search.vue'; -import JobsTableEmptyState from '~/jobs/components/table/jobs_table_empty_state.vue'; -import { createAlert } from '~/alert'; -import JobsSkeletonLoader from '../jobs_skeleton_loader.vue'; -import { - DEFAULT_FIELDS_ADMIN, - RAW_TEXT_WARNING_ADMIN, - JOBS_COUNT_ERROR_MESSAGE, - JOBS_FETCH_ERROR_MSG, - LOADING_ARIA_LABEL, - CANCELABLE_JOBS_ERROR_MSG, -} from '../constants'; -import GetAllJobs from './graphql/queries/get_all_jobs.query.graphql'; -import GetAllJobsCount from './graphql/queries/get_all_jobs_count.query.graphql'; -import CancelableJobs from './graphql/queries/get_cancelable_jobs_count.query.graphql'; - -export default { - i18n: { - jobsCountErrorMsg: JOBS_COUNT_ERROR_MESSAGE, - jobsFetchErrorMsg: JOBS_FETCH_ERROR_MSG, - loadingAriaLabel: LOADING_ARIA_LABEL, - cancelableJobsErrorMsg: CANCELABLE_JOBS_ERROR_MSG, - }, - filterSearchBoxStyles: - 'gl-my-0 gl-p-5 gl-bg-gray-10 gl-text-gray-900 gl-border-b gl-border-gray-100', - components: { - JobsSkeletonLoader, - JobsTableEmptyState, - GlAlert, - JobsFilteredSearch, - JobsTable, - JobsTableTabs, - GlIntersectionObserver, - GlLoadingIcon, - }, - inject: { - jobStatuses: { - default: null, - required: false, - }, - url: { - default: '', - required: false, - }, - emptyStateSvgPath: { - default: '', - required: false, - }, - }, - apollo: { - jobs: { - query: GetAllJobs, - variables() { - return this.variables; - }, - update(data) { - const { jobs: { nodes: list = [], pageInfo = {} } = {} } = data || {}; - return { - list, - pageInfo, - }; - }, - error() { - this.error = this.$options.i18n.jobsFetchErrorMsg; - }, - }, - jobsCount: { - query: GetAllJobsCount, - update(data) { - return data?.jobs?.count || 0; - }, - context: { - isSingleRequest: true, - }, - error() { - this.error = this.$options.i18n.jobsCountErrorMsg; - }, - }, - cancelable: { - query: CancelableJobs, - update(data) { - this.isCancelable = data.cancelable.count !== 0; - }, - error() { - this.error = this.$options.i18n.cancelableJobsErrorMsg; - }, - }, - }, - data() { - return { - jobs: { - list: [], - }, - error: '', - count: 0, - scope: null, - infiniteScrollingTriggered: false, - filterSearchTriggered: false, - DEFAULT_FIELDS_ADMIN, - isCancelable: false, - jobsCount: null, - }; - }, - computed: { - loading() { - return this.$apollo.queries.jobs.loading; - }, - // Show when on All tab with no jobs - // Show only when not loading and filtered search has not been triggered - // So we don't show empty state when results are empty on a filtered search - showEmptyState() { - return ( - this.jobs.list.length === 0 && !this.scope && !this.loading && !this.filterSearchTriggered - ); - }, - hasNextPage() { - return this.jobs?.pageInfo?.hasNextPage; - }, - variables() { - return { ...this.validatedQueryString }; - }, - validatedQueryString() { - const queryStringObject = queryToObject(window.location.search); - - return validateQueryString(queryStringObject); - }, - showFilteredSearch() { - return !this.scope; - }, - showLoadingSpinner() { - return this.loading && this.infiniteScrollingTriggered; - }, - showSkeletonLoader() { - return this.loading && !this.showLoadingSpinner; - }, - }, - watch: { - // this watcher ensures that the count on the all tab - // is not updated when switching to the finished tab - jobsCount(newCount) { - if (this.scope) return; - - this.count = newCount; - }, - }, - methods: { - updateHistoryAndFetchCount(status = null) { - this.$apollo.queries.jobsCount.refetch({ statuses: status }); - - updateHistory({ - url: setUrlParams({ statuses: status }, window.location.href, true), - }); - }, - fetchJobsByStatus(scope) { - this.infiniteScrollingTriggered = false; - - if (this.scope === scope) return; - - this.scope = scope; - - if (!this.scope) this.updateHistoryAndFetchCount(); - - this.$apollo.queries.jobs.refetch({ statuses: scope }); - }, - fetchMoreJobs() { - if (!this.loading) { - this.infiniteScrollingTriggered = true; - - const parameters = this.variables; - parameters.after = this.jobs?.pageInfo?.endCursor; - - this.$apollo.queries.jobs.fetchMore({ - variables: parameters, - }); - } - }, - filterJobsBySearch(filters) { - this.infiniteScrollingTriggered = false; - this.filterSearchTriggered = true; - - // all filters have been cleared reset query param - // and refetch jobs/count with defaults - if (!filters.length) { - this.updateHistoryAndFetchCount(); - this.$apollo.queries.jobs.refetch({ statuses: null }); - - return; - } - - // Eventually there will be more tokens available - // this code is written to scale for those tokens - filters.forEach((filter) => { - // Raw text input in filtered search does not have a type - // when a user enters raw text we alert them that it is - // not supported and we do not make an additional API call - if (!filter.type) { - createAlert({ - message: RAW_TEXT_WARNING_ADMIN, - type: 'warning', - }); - } - - if (filter.type === 'status') { - this.updateHistoryAndFetchCount(filter.value.data); - this.$apollo.queries.jobs.refetch({ statuses: filter.value.data }); - } - }); - }, - }, -}; -</script> - -<template> - <div> - <gl-alert v-if="error" class="gl-mt-2" variant="danger" dismissible @dismiss="error = ''"> - {{ error }} - </gl-alert> - - <jobs-table-tabs - :all-jobs-count="count" - :loading="loading" - :show-cancel-all-jobs-button="isCancelable" - @fetchJobsByStatus="fetchJobsByStatus" - /> - - <div v-if="showFilteredSearch" :class="$options.filterSearchBoxStyles"> - <jobs-filtered-search - :query-string="validatedQueryString" - @filterJobsBySearch="filterJobsBySearch" - /> - </div> - - <jobs-skeleton-loader v-if="showSkeletonLoader" class="gl-mt-5" /> - - <jobs-table-empty-state v-else-if="showEmptyState" /> - - <jobs-table - v-else - :jobs="jobs.list" - :table-fields="DEFAULT_FIELDS_ADMIN" - admin - class="gl-table-no-top-border" - /> - - <gl-intersection-observer v-if="hasNextPage" @appear="fetchMoreJobs"> - <gl-loading-icon - v-if="showLoadingSpinner" - size="lg" - :aria-label="$options.i18n.loadingAriaLabel" - /> - </gl-intersection-observer> - </div> -</template> diff --git a/app/assets/javascripts/pages/admin/jobs/components/table/cell/project_cell.vue b/app/assets/javascripts/pages/admin/jobs/components/table/cell/project_cell.vue deleted file mode 100644 index cbb80a5175f..00000000000 --- a/app/assets/javascripts/pages/admin/jobs/components/table/cell/project_cell.vue +++ /dev/null @@ -1,28 +0,0 @@ -<script> -import { GlLink } from '@gitlab/ui'; - -export default { - components: { - GlLink, - }, - props: { - job: { - type: Object, - required: true, - }, - }, - computed: { - projectName() { - return this.job.pipeline?.project?.fullPath; - }, - projectUrl() { - return this.job.pipeline?.project?.webUrl; - }, - }, -}; -</script> -<template> - <div class="gl-text-truncate"> - <gl-link :href="projectUrl"> {{ projectName }}</gl-link> - </div> -</template> diff --git a/app/assets/javascripts/pages/admin/jobs/components/table/cells/runner_cell.vue b/app/assets/javascripts/pages/admin/jobs/components/table/cells/runner_cell.vue deleted file mode 100644 index 33bcee5b34b..00000000000 --- a/app/assets/javascripts/pages/admin/jobs/components/table/cells/runner_cell.vue +++ /dev/null @@ -1,39 +0,0 @@ -<script> -import { GlLink } from '@gitlab/ui'; -import { RUNNER_EMPTY_TEXT, RUNNER_NO_DESCRIPTION } from '~/pages/admin/jobs/components/constants'; - -export default { - i18n: { - emptyRunnerText: RUNNER_EMPTY_TEXT, - noRunnerDescription: RUNNER_NO_DESCRIPTION, - }, - components: { - GlLink, - }, - props: { - job: { - type: Object, - required: true, - }, - }, - computed: { - adminUrl() { - return this.job.runner?.adminUrl; - }, - description() { - return this.job.runner?.description - ? this.job.runner.description - : this.$options.i18n.noRunnerDescription; - }, - }, -}; -</script> - -<template> - <div class="gl-text-truncate"> - <gl-link v-if="adminUrl" :href="adminUrl"> - {{ description }} - </gl-link> - <span v-else data-testid="empty-runner-text"> {{ $options.i18n.emptyRunnerText }}</span> - </div> -</template> diff --git a/app/assets/javascripts/pages/admin/jobs/components/table/graphql/cache_config.js b/app/assets/javascripts/pages/admin/jobs/components/table/graphql/cache_config.js deleted file mode 100644 index fd7ee2a6f8c..00000000000 --- a/app/assets/javascripts/pages/admin/jobs/components/table/graphql/cache_config.js +++ /dev/null @@ -1,62 +0,0 @@ -import { isEqual } from 'lodash'; - -export default { - typePolicies: { - Query: { - fields: { - jobs: { - keyArgs: ['statuses'], - }, - }, - }, - CiJobConnection: { - merge(existing = {}, incoming, { args = {} }) { - if (incoming.nodes) { - let nodes; - - const areNodesEqual = isEqual(existing.nodes, incoming.nodes); - const statuses = Array.isArray(args.statuses) ? [...args.statuses] : args.statuses; - const { pageInfo } = incoming; - - if (Object.keys(existing).length !== 0 && isEqual(existing?.statuses, args?.statuses)) { - if (areNodesEqual) { - if (incoming.pageInfo.hasNextPage) { - nodes = [...existing.nodes, ...incoming.nodes]; - } else { - nodes = [...incoming.nodes]; - } - } else { - if (!existing.pageInfo?.hasNextPage) { - nodes = [...incoming.nodes]; - - return { - nodes, - statuses, - pageInfo, - count: incoming.count, - }; - } - - nodes = [...existing.nodes, ...incoming.nodes]; - } - } else { - nodes = [...incoming.nodes]; - } - - return { - nodes, - statuses, - pageInfo, - count: incoming.count, - }; - } - - return { - nodes: existing.nodes, - pageInfo: existing.pageInfo, - statuses: args.statuses, - }; - }, - }, - }, -}; diff --git a/app/assets/javascripts/pages/admin/jobs/components/table/graphql/queries/get_all_jobs.query.graphql b/app/assets/javascripts/pages/admin/jobs/components/table/graphql/queries/get_all_jobs.query.graphql deleted file mode 100644 index 9e2795966e0..00000000000 --- a/app/assets/javascripts/pages/admin/jobs/components/table/graphql/queries/get_all_jobs.query.graphql +++ /dev/null @@ -1,85 +0,0 @@ -query getAllJobs($after: String, $first: Int = 50, $statuses: [CiJobStatus!]) { - jobs(after: $after, first: $first, statuses: $statuses) { - pageInfo { - endCursor - hasNextPage - hasPreviousPage - startCursor - } - nodes { - runner { - id - description - adminUrl - } - artifacts { - nodes { - id - downloadPath - fileType - } - } - allowFailure - status - scheduledAt - manualJob - triggered - createdByTag - detailedStatus { - id - detailsPath - group - icon - label - text - tooltip - action { - id - buttonTitle - icon - method - path - title - } - } - id - refName - refPath - tags - shortSha - commitPath - pipeline { - id - project { - id - fullPath - webUrl - } - path - user { - id - webPath - avatarUrl - } - } - stage { - id - name - } - name - duration - finishedAt - coverage - retryable - playable - cancelable - active - stuck - userPermissions { - readBuild - readJobArtifacts - updateBuild - } - } - } -} diff --git a/app/assets/javascripts/pages/admin/jobs/components/table/graphql/queries/get_all_jobs_count.query.graphql b/app/assets/javascripts/pages/admin/jobs/components/table/graphql/queries/get_all_jobs_count.query.graphql deleted file mode 100644 index 8c59230b2b8..00000000000 --- a/app/assets/javascripts/pages/admin/jobs/components/table/graphql/queries/get_all_jobs_count.query.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getAllJobsCount($statuses: [CiJobStatus!]) { - jobs(statuses: $statuses) { - count - } -} diff --git a/app/assets/javascripts/pages/admin/jobs/components/table/graphql/queries/get_cancelable_jobs_count.query.graphql b/app/assets/javascripts/pages/admin/jobs/components/table/graphql/queries/get_cancelable_jobs_count.query.graphql deleted file mode 100644 index 9b90abebbf7..00000000000 --- a/app/assets/javascripts/pages/admin/jobs/components/table/graphql/queries/get_cancelable_jobs_count.query.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query canelableJobs { - cancelable: jobs(statuses: [PENDING, RUNNING]) { - count - } -} diff --git a/app/assets/javascripts/pages/admin/jobs/index/index.js b/app/assets/javascripts/pages/admin/jobs/index/index.js index 9c2a255a1a3..52e4d5dd19f 100644 --- a/app/assets/javascripts/pages/admin/jobs/index/index.js +++ b/app/assets/javascripts/pages/admin/jobs/index/index.js @@ -1,12 +1,9 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; -import { BV_SHOW_MODAL } from '~/lib/utils/constants'; import Translate from '~/vue_shared/translate'; import createDefaultClient from '~/lib/graphql'; -import { CANCEL_JOBS_MODAL_ID } from '../components/constants'; -import CancelJobsModal from '../components/cancel_jobs_modal.vue'; -import AdminJobsTableApp from '../components/table/admin_jobs_table_app.vue'; -import cacheConfig from '../components/table/graphql/cache_config'; +import AdminJobsTableApp from '~/ci/admin/jobs_table/admin_jobs_table_app.vue'; +import cacheConfig from '~/ci/admin/jobs_table/graphql/cache_config'; Vue.use(Translate); Vue.use(VueApollo); @@ -17,35 +14,7 @@ const apolloProvider = new VueApollo({ defaultClient: client, }); -function initJobs() { - const buttonId = 'js-stop-jobs-button'; - const cancelJobsButton = document.getElementById(buttonId); - if (cancelJobsButton) { - // eslint-disable-next-line no-new - new Vue({ - el: `#js-${CANCEL_JOBS_MODAL_ID}`, - components: { - CancelJobsModal, - }, - mounted() { - cancelJobsButton.classList.remove('disabled'); - cancelJobsButton.addEventListener('click', () => { - this.$root.$emit(BV_SHOW_MODAL, CANCEL_JOBS_MODAL_ID, `#${buttonId}`); - }); - }, - render(createElement) { - return createElement(CANCEL_JOBS_MODAL_ID, { - props: { - url: cancelJobsButton.dataset.url, - modalId: CANCEL_JOBS_MODAL_ID, - }, - }); - }, - }); - } -} - -export function initAdminJobsApp() { +const initAdminJobsApp = () => { const containerEl = document.getElementById('admin-jobs-app'); if (!containerEl) return false; @@ -64,10 +33,6 @@ export function initAdminJobsApp() { return createElement(AdminJobsTableApp); }, }); -} +}; -if (gon.features.adminJobsVue) { - initAdminJobsApp(); -} else { - initJobs(); -} +initAdminJobsApp(); diff --git a/app/assets/javascripts/pages/dashboard/groups/index/index.js b/app/assets/javascripts/pages/dashboard/groups/index/index.js index c14848c4798..fbfc6c07904 100644 --- a/app/assets/javascripts/pages/dashboard/groups/index/index.js +++ b/app/assets/javascripts/pages/dashboard/groups/index/index.js @@ -1,3 +1,4 @@ +import EmptyState from '~/groups/components/empty_states/groups_dashboard_empty_state.vue'; import initGroupsList from '~/groups'; -initGroupsList(); +initGroupsList(EmptyState); diff --git a/app/assets/javascripts/pages/explore/groups/index.js b/app/assets/javascripts/pages/explore/groups/index.js index 9b60b1f51a8..c6a9cf50d9a 100644 --- a/app/assets/javascripts/pages/explore/groups/index.js +++ b/app/assets/javascripts/pages/explore/groups/index.js @@ -1,8 +1,9 @@ +import EmptyState from '~/groups/components/empty_states/groups_explore_empty_state.vue'; import initGroupsList from '~/groups'; import Landing from '~/groups/landing'; function exploreGroups() { - initGroupsList(); + initGroupsList(EmptyState); const landingElement = document.querySelector('.js-explore-groups-landing'); if (!landingElement) return; const exploreGroupsLanding = new Landing( diff --git a/app/assets/javascripts/pages/import/bitbucket_server/status/components/bitbucket_server_status_table.vue b/app/assets/javascripts/pages/import/bitbucket_server/status/components/bitbucket_server_status_table.vue index f0c4ecbe3eb..3a73d0c9f40 100644 --- a/app/assets/javascripts/pages/import/bitbucket_server/status/components/bitbucket_server_status_table.vue +++ b/app/assets/javascripts/pages/import/bitbucket_server/status/components/bitbucket_server_status_table.vue @@ -19,9 +19,14 @@ export default { <template> <bitbucket-status-table v-bind="$attrs"> <template #actions> - <gl-button variant="info" class="gl-ml-3" data-method="post" :href="reconfigurePath">{{ - __('Reconfigure') - }}</gl-button> + <gl-button + category="secondary" + variant="confirm" + class="gl-ml-3" + data-method="post" + :href="reconfigurePath" + >{{ __('Reconfigure') }}</gl-button + > </template> </bitbucket-status-table> </template> diff --git a/app/assets/javascripts/pages/organizations/organizations/show/index.js b/app/assets/javascripts/pages/organizations/organizations/show/index.js new file mode 100644 index 00000000000..f9f9d2db692 --- /dev/null +++ b/app/assets/javascripts/pages/organizations/organizations/show/index.js @@ -0,0 +1,3 @@ +import { initOrganizationsShow } from '~/organizations/show'; + +initOrganizationsShow(); diff --git a/app/assets/javascripts/pages/projects/incidents/show/index.js b/app/assets/javascripts/pages/projects/incidents/show/index.js index a83c4f1c0d2..a2ff45b454a 100644 --- a/app/assets/javascripts/pages/projects/incidents/show/index.js +++ b/app/assets/javascripts/pages/projects/incidents/show/index.js @@ -1,7 +1,3 @@ import { initShow } from '~/issues'; -import initSidebarBundle from '~/sidebar/sidebar_bundle'; -import initWorkItemLinks from '~/work_items/components/work_item_links'; initShow(); -initSidebarBundle(); -initWorkItemLinks(); 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 0844e322de2..ead15143072 100644 --- a/app/assets/javascripts/pages/projects/issues/service_desk/index.js +++ b/app/assets/javascripts/pages/projects/issues/service_desk/index.js @@ -1,5 +1,5 @@ import { initFilteredSearchServiceDesk } from '~/issues'; -import { mountServiceDeskListApp } from '~/service_desk'; +import { mountServiceDeskListApp } from '~/issues/service_desk'; initFilteredSearchServiceDesk(); diff --git a/app/assets/javascripts/pages/projects/issues/show/index.js b/app/assets/javascripts/pages/projects/issues/show/index.js index c92958cd8c7..a2ff45b454a 100644 --- a/app/assets/javascripts/pages/projects/issues/show/index.js +++ b/app/assets/javascripts/pages/projects/issues/show/index.js @@ -1,10 +1,3 @@ import { initShow } from '~/issues'; -import { store } from '~/notes/stores'; -import { initRelatedIssues } from '~/related_issues'; -import initSidebarBundle from '~/sidebar/sidebar_bundle'; -import initWorkItemLinks from '~/work_items/components/work_item_links'; initShow(); -initSidebarBundle(store); -initRelatedIssues(); -initWorkItemLinks(); diff --git a/app/assets/javascripts/pages/projects/jobs/index/index.js b/app/assets/javascripts/pages/projects/jobs/index/index.js index eb3a24f38a8..9b5ad804750 100644 --- a/app/assets/javascripts/pages/projects/jobs/index/index.js +++ b/app/assets/javascripts/pages/projects/jobs/index/index.js @@ -1,3 +1,3 @@ -import initJobsTable from '~/jobs/components/table'; +import initJobsPage from '~/ci/jobs_page'; -initJobsTable(); +initJobsPage(); diff --git a/app/assets/javascripts/pages/projects/jobs/show/index.js b/app/assets/javascripts/pages/projects/jobs/show/index.js index 6fef057dee0..cd83f2b7b64 100644 --- a/app/assets/javascripts/pages/projects/jobs/show/index.js +++ b/app/assets/javascripts/pages/projects/jobs/show/index.js @@ -1,3 +1,3 @@ -import initJobDetails from '~/jobs'; +import initJobDetails from '~/ci/job_details'; initJobDetails(); diff --git a/app/assets/javascripts/pages/projects/merge_requests/creations/new/branch_finder.js b/app/assets/javascripts/pages/projects/merge_requests/creations/new/branch_finder.js new file mode 100644 index 00000000000..ee84f54978a --- /dev/null +++ b/app/assets/javascripts/pages/projects/merge_requests/creations/new/branch_finder.js @@ -0,0 +1 @@ +export const findTargetBranch = async () => {}; diff --git a/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js b/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js index f71a1041068..d23a0615bb8 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js +++ b/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js @@ -2,6 +2,8 @@ import Vue from 'vue'; import { mountMarkdownEditor } from 'ee_else_ce/vue_shared/components/markdown/mount_markdown_editor'; +import { findTargetBranch } from 'ee_else_ce/pages/projects/merge_requests/creations/new/branch_finder'; + import initPipelines from '~/commit/pipelines/pipelines_bundle'; import MergeRequest from '~/merge_request'; import CompareApp from '~/merge_requests/components/compare_app.vue'; @@ -13,14 +15,15 @@ if (mrNewCompareNode) { const targetCompareEl = document.getElementById('js-target-project-dropdown'); const sourceCompareEl = document.getElementById('js-source-project-dropdown'); const compareEl = document.querySelector('.js-merge-request-new-compare'); + const targetBranch = Vue.observable({ name: '' }); + const currentSourceBranch = JSON.parse(sourceCompareEl.dataset.currentBranch); // eslint-disable-next-line no-new new Vue({ el: sourceCompareEl, name: 'SourceCompareApp', provide: { currentProject: JSON.parse(sourceCompareEl.dataset.currentProject), - currentBranch: JSON.parse(sourceCompareEl.dataset.currentBranch), branchCommitPath: compareEl.dataset.sourceBranchUrl, inputs: { project: { @@ -40,20 +43,35 @@ if (mrNewCompareNode) { project: 'js-source-project', branch: 'js-source-branch gl-font-monospace', }, - branchQaSelector: 'source_branch_dropdown', + }, + methods: { + async selectedBranch(branchName) { + const targetBranchName = await findTargetBranch(branchName); + + if (targetBranchName) { + targetBranch.name = targetBranchName; + } + }, }, render(h) { - return h(CompareApp); + return h(CompareApp, { + props: { + currentBranch: currentSourceBranch, + }, + on: { + 'select-branch': this.selectedBranch, + }, + }); }, }); + const currentTargetBranch = JSON.parse(targetCompareEl.dataset.currentBranch); // eslint-disable-next-line no-new new Vue({ el: targetCompareEl, name: 'TargetCompareApp', provide: { currentProject: JSON.parse(targetCompareEl.dataset.currentProject), - currentBranch: JSON.parse(targetCompareEl.dataset.currentBranch), projectsPath: targetCompareEl.dataset.targetProjectsPath, branchCommitPath: compareEl.dataset.targetBranchUrl, inputs: { @@ -75,8 +93,17 @@ if (mrNewCompareNode) { branch: 'js-target-branch gl-font-monospace', }, }, + computed: { + currentBranch() { + if (targetBranch.name) { + return { text: targetBranch.name, value: targetBranch.name }; + } + + return currentTargetBranch; + }, + }, render(h) { - return h(CompareApp); + return h(CompareApp, { props: { currentBranch: this.currentBranch } }); }, }); } else { diff --git a/app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js b/app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js index 30734f0b698..2cdbf0fb830 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js +++ b/app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js @@ -4,7 +4,7 @@ import { s__ } from '~/locale'; import ShortcutsIssuable from '~/behaviors/shortcuts/shortcuts_issuable'; import { initPipelineCountListener } from '~/commit/pipelines/utils'; import { initIssuableSidebar } from '~/issuable'; -import StatusBox from '~/issuable/components/status_box.vue'; +import MergeRequestStatusBadge from '~/merge_requests/components/merge_request_status_badge.vue'; import createDefaultClient from '~/lib/graphql'; import initSourcegraph from '~/sourcegraph'; import ZenMode from '~/zen_mode'; @@ -24,24 +24,24 @@ export default function initMergeRequestShow() { initMrExperienceSurvey(); const el = document.querySelector('.js-mr-status-box'); - const { iid, issuableType, projectPath } = el.dataset; - const apolloProvider = new VueApollo({ - defaultClient: createDefaultClient(), - }); + const { iid, issuableType, projectPath, state } = el.dataset; + // eslint-disable-next-line no-new new Vue({ el, name: 'IssuableStatusBoxRoot', - apolloProvider, + apolloProvider: new VueApollo({ + defaultClient: createDefaultClient(), + }), provide: { query: getStateQuery, iid, projectPath, }, - render(h) { - return h(StatusBox, { + render(createElement) { + return createElement(MergeRequestStatusBadge, { props: { - initialState: el.dataset.state, + initialState: state, issuableType, }, }); diff --git a/app/assets/javascripts/pages/projects/merge_requests/page.js b/app/assets/javascripts/pages/projects/merge_requests/page.js index 75e308e706f..f7b522f7c85 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/page.js +++ b/app/assets/javascripts/pages/projects/merge_requests/page.js @@ -1,8 +1,8 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; import initMrNotes from 'ee_else_ce/mr_notes'; +import { mountHeaderMetadata } from '~/merge_requests'; import StickyHeader from '~/merge_requests/components/sticky_header.vue'; -import { initIssuableHeaderWarnings } from '~/issuable'; import { start as startCodeReviewMessaging } from '~/code_review/signals'; import diffsEventHub from '~/diffs/event_hub'; import store from '~/mr_notes/stores'; @@ -24,7 +24,7 @@ export function initMrPage() { requestIdleCallback(() => { initSidebarBundle(store); - initIssuableHeaderWarnings(store); + mountHeaderMetadata(store); const el = document.getElementById('js-merge-sticky-header'); diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/edit/index.js b/app/assets/javascripts/pages/projects/pipeline_schedules/edit/index.js index a51c2e9c47b..f48c38b776f 100644 --- a/app/assets/javascripts/pages/projects/pipeline_schedules/edit/index.js +++ b/app/assets/javascripts/pages/projects/pipeline_schedules/edit/index.js @@ -1,8 +1,3 @@ import initPipelineSchedulesFormApp from '~/ci/pipeline_schedules/mount_pipeline_schedules_form_app'; -import initForm from '../shared/init_form'; -if (gon.features?.pipelineSchedulesVue) { - initPipelineSchedulesFormApp('#pipeline-schedules-form-edit', true); -} else { - initForm(); -} +initPipelineSchedulesFormApp('#pipeline-schedules-form-edit', true); diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js b/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js index 4bdbb70d942..0eff9110412 100644 --- a/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js +++ b/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js @@ -1,75 +1,3 @@ -import Vue from 'vue'; -import { BV_SHOW_MODAL } from '~/lib/utils/constants'; import initPipelineSchedulesApp from '~/ci/pipeline_schedules/mount_pipeline_schedules_app'; -import PipelineSchedulesTakeOwnershipModalLegacy from '~/ci/pipeline_schedules/components/take_ownership_modal_legacy.vue'; -import PipelineSchedulesCallout from '../shared/components/pipeline_schedules_callout.vue'; -function initPipelineSchedulesCallout() { - const el = document.getElementById('pipeline-schedules-callout'); - - if (!el) { - return; - } - - const { docsUrl, illustrationUrl } = el.dataset; - - // eslint-disable-next-line no-new - new Vue({ - el, - name: 'PipelineSchedulesCalloutRoot', - provide: { - docsUrl, - illustrationUrl, - }, - render(createElement) { - return createElement(PipelineSchedulesCallout); - }, - }); -} - -// TODO: move take ownership feature into new Vue app -// located in directory app/assets/javascripts/pipeline_schedules/components -function initTakeownershipModal() { - const modalId = 'pipeline-take-ownership-modal'; - const buttonSelector = 'js-take-ownership-button'; - const el = document.getElementById(modalId); - const takeOwnershipButtons = document.querySelectorAll(`.${buttonSelector}`); - - if (!el) { - return; - } - - // eslint-disable-next-line no-new - new Vue({ - el, - data() { - return { - url: '', - }; - }, - mounted() { - takeOwnershipButtons.forEach((button) => { - button.addEventListener('click', () => { - const { url } = button.dataset; - - this.url = url; - this.$root.$emit(BV_SHOW_MODAL, modalId, `.${buttonSelector}`); - }); - }); - }, - render(createElement) { - return createElement(PipelineSchedulesTakeOwnershipModalLegacy, { - props: { - ownershipUrl: this.url, - }, - }); - }, - }); -} - -if (gon.features?.pipelineSchedulesVue) { - initPipelineSchedulesApp(); -} else { - initPipelineSchedulesCallout(); - initTakeownershipModal(); -} +initPipelineSchedulesApp(); diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/new/index.js b/app/assets/javascripts/pages/projects/pipeline_schedules/new/index.js index d8ba7bbd752..672e3d014bd 100644 --- a/app/assets/javascripts/pages/projects/pipeline_schedules/new/index.js +++ b/app/assets/javascripts/pages/projects/pipeline_schedules/new/index.js @@ -1,8 +1,3 @@ import initPipelineSchedulesFormApp from '~/ci/pipeline_schedules/mount_pipeline_schedules_form_app'; -import initForm from '../shared/init_form'; -if (gon.features?.pipelineSchedulesVue) { - initPipelineSchedulesFormApp('#pipeline-schedules-form-new'); -} else { - initForm(); -} +initPipelineSchedulesFormApp('#pipeline-schedules-form-new'); diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input.vue b/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input.vue index 5f6a73782c3..642fd56eab1 100644 --- a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input.vue +++ b/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input.vue @@ -69,7 +69,8 @@ export default { formattedTime() { if (this.randomHour > 12) { return `${this.randomHour - 12}:00pm`; - } else if (this.randomHour === 12) { + } + if (this.randomHour === 12) { return `12:00pm`; } return `${this.randomHour}:00am`; diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedules_callout.vue b/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedules_callout.vue deleted file mode 100644 index b3ad50f395b..00000000000 --- a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedules_callout.vue +++ /dev/null @@ -1,62 +0,0 @@ -<script> -import { GlButton } from '@gitlab/ui'; -import Vue from 'vue'; -import { getCookie, setCookie, parseBoolean } from '~/lib/utils/common_utils'; -import Translate from '~/vue_shared/translate'; - -Vue.use(Translate); - -const cookieKey = 'pipeline_schedules_callout_dismissed'; - -export default { - name: 'PipelineSchedulesCallout', - components: { - GlButton, - }, - inject: ['docsUrl', 'illustrationUrl'], - data() { - return { - calloutDismissed: parseBoolean(getCookie(cookieKey)), - }; - }, - methods: { - dismissCallout() { - this.calloutDismissed = true; - setCookie(cookieKey, this.calloutDismissed); - }, - }, -}; -</script> -<template> - <div v-if="!calloutDismissed" class="pipeline-schedules-user-callout user-callout"> - <div class="bordered-box landing content-block gl-p-5!" data-testid="innerContent"> - <gl-button - category="tertiary" - icon="close" - :aria-label="__('Dismiss')" - class="gl-absolute gl-top-2 gl-right-2" - @click="dismissCallout" - /> - <div class="svg-content"> - <img :src="illustrationUrl" /> - </div> - <div class="user-callout-copy"> - <h4>{{ __('Scheduling Pipelines') }}</h4> - <p> - {{ - __(`The pipelines schedule runs pipelines in the future, -repeatedly, for specific branches or tags. -Those scheduled pipelines will inherit limited project access based on their associated user.`) - }} - </p> - <p> - {{ __('Learn more in the') }} - <a :href="docsUrl" target="_blank" rel="nofollow"> - {{ __('pipeline schedules documentation') }}</a - >. - <!-- oneline to prevent extra space before period --> - </p> - </div> - </div> - </div> -</template> diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/init_form.js b/app/assets/javascripts/pages/projects/pipeline_schedules/shared/init_form.js deleted file mode 100644 index 8440d0e77cd..00000000000 --- a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/init_form.js +++ /dev/null @@ -1,94 +0,0 @@ -import $ from 'jquery'; -import Vue from 'vue'; -import { __ } from '~/locale'; -import RefSelector from '~/ref/components/ref_selector.vue'; -import { REF_TYPE_BRANCHES, REF_TYPE_TAGS } from '~/ref/constants'; -import setupNativeFormVariableList from '~/ci/ci_variable_list/native_form_variable_list'; -import GlFieldErrors from '~/gl_field_errors'; -import Translate from '~/vue_shared/translate'; -import { initTimezoneDropdown } from '../../../profiles/init_timezone_dropdown'; -import IntervalPatternInput from './components/interval_pattern_input.vue'; - -Vue.use(Translate); - -function initIntervalPatternInput() { - const intervalPatternMount = document.getElementById('interval-pattern-input'); - const initialCronInterval = intervalPatternMount?.dataset?.initialInterval; - const dailyLimit = intervalPatternMount.dataset?.dailyLimit; - - return new Vue({ - el: intervalPatternMount, - components: { - IntervalPatternInput, - }, - render(createElement) { - return createElement('interval-pattern-input', { - props: { - initialCronInterval, - dailyLimit, - }, - }); - }, - }); -} - -function getEnabledRefTypes() { - return [REF_TYPE_BRANCHES, REF_TYPE_TAGS]; -} - -function initTargetRefDropdown() { - const $refField = document.getElementById('schedule_ref'); - const el = document.querySelector('.js-target-ref-dropdown'); - const { projectId, defaultBranch } = el.dataset; - - if (!$refField.value) { - $refField.value = defaultBranch; - } - - const refDropdown = new Vue({ - el, - render(h) { - return h(RefSelector, { - props: { - enabledRefTypes: getEnabledRefTypes(), - projectId, - value: $refField.value, - useSymbolicRefNames: true, - translations: { - dropdownHeader: __('Select target branch or tag'), - }, - }, - class: 'gl-w-full', - }); - }, - }); - - refDropdown.$children[0].$on('input', (newRef) => { - $refField.value = newRef; - }); - - return refDropdown; -} - -export default () => { - /* Most of the form is written in haml, but for fields with more complex behaviors, - * you should mount individual Vue components here. If at some point components need - * to share state, it may make sense to refactor the whole form to Vue */ - - initIntervalPatternInput(); - - // Initialize non-Vue JS components in the form - - const formElement = document.getElementById('new-pipeline-schedule-form'); - - gl.pipelineScheduleFieldErrors = new GlFieldErrors(formElement); - - initTargetRefDropdown(); - - setupNativeFormVariableList({ - container: $('.js-ci-variable-list-section'), - formField: 'schedule', - }); -}; - -initTimezoneDropdown(); diff --git a/app/assets/javascripts/pages/projects/pipelines/index/index.js b/app/assets/javascripts/pages/projects/pipelines/index/index.js index 63b1f2bf975..a0ddf96ede2 100644 --- a/app/assets/javascripts/pages/projects/pipelines/index/index.js +++ b/app/assets/javascripts/pages/projects/pipelines/index/index.js @@ -1,3 +1,3 @@ -import { initPipelinesIndex } from '~/pipelines/pipelines_index'; +import { initPipelinesIndex } from '~/ci/pipeline_details/pipelines_index'; initPipelinesIndex(); diff --git a/app/assets/javascripts/pages/projects/pipelines/show/index.js b/app/assets/javascripts/pages/projects/pipelines/show/index.js index d3f46b7e025..225479c5194 100644 --- a/app/assets/javascripts/pages/projects/pipelines/show/index.js +++ b/app/assets/javascripts/pages/projects/pipelines/show/index.js @@ -1,4 +1,4 @@ -import initPipelineDetails from '~/pipelines/pipeline_details_bundle'; +import initPipelineDetails from '~/ci/pipeline_details/pipeline_details_bundle'; import initPipelines from '../init_pipelines'; initPipelines(); diff --git a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js index 4a5d5580c08..dce40c1f322 100644 --- a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js +++ b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js @@ -12,7 +12,6 @@ import initSettingsPanels from '~/settings_panels'; import { initTokenAccess } from '~/token_access'; import { initCiSecureFiles } from '~/ci_secure_files'; import initDeployTokens from '~/deploy_tokens'; -import { initProjectRunners } from '~/ci/runner/project_runners'; import { initProjectRunnersRegistrationDropdown } from '~/ci/runner/project_runners/register'; import { initGeneralPipelinesOptions } from '~/ci_settings_general_pipeline'; @@ -45,7 +44,6 @@ initDeployFreeze(); initSettingsPipelinesTriggers(); initArtifactsSettings(); -initProjectRunners(); initProjectRunnersRegistrationDropdown(); initSharedRunnersToggle(); initRefSwitcherBadges(); diff --git a/app/assets/javascripts/pages/projects/show/index.js b/app/assets/javascripts/pages/projects/show/index.js index c43a0eb597c..bee0731d711 100644 --- a/app/assets/javascripts/pages/projects/show/index.js +++ b/app/assets/javascripts/pages/projects/show/index.js @@ -1,13 +1,11 @@ import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; - import initClustersDeprecationAlert from '~/projects/clusters_deprecation_alert'; import leaveByUrl from '~/namespaces/leave_by_url'; import initVueNotificationsDropdown from '~/notifications'; -import Star from '~/projects/star'; +import { initStarButton } from '~/projects/project_star_button'; import initTerraformNotification from '~/projects/terraform_notification'; import { initUploadFileTrigger } from '~/projects/upload_file'; import initReadMore from '~/read_more'; - import initForksButton from '~/forks/init_forks_button'; // Project show page loads different overview content based on user preferences @@ -46,7 +44,7 @@ initClustersDeprecationAlert(); initTerraformNotification(); initReadMore(); -new Star(); // eslint-disable-line no-new +initStarButton(); if (document.querySelector('.js-autodevops-banner')) { import(/* webpackChunkName: 'userCallOut' */ '~/user_callout') diff --git a/app/assets/javascripts/pages/projects/tracing/index/index.js b/app/assets/javascripts/pages/projects/tracing/index/index.js deleted file mode 100644 index 64ca303f8ba..00000000000 --- a/app/assets/javascripts/pages/projects/tracing/index/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { initSimpleApp } from '~/helpers/init_simple_app_helper'; -import ListIndex from '~/tracing/list_index.vue'; - -initSimpleApp('#js-tracing', ListIndex); diff --git a/app/assets/javascripts/pages/projects/tracing/show/index.js b/app/assets/javascripts/pages/projects/tracing/show/index.js deleted file mode 100644 index 107c004aa5f..00000000000 --- a/app/assets/javascripts/pages/projects/tracing/show/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { initSimpleApp } from '~/helpers/init_simple_app_helper'; -import DetailsIndex from '~/tracing/details_index.vue'; - -initSimpleApp('#js-tracing-details', DetailsIndex); |