diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-08 15:13:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-08 15:13:55 +0300 |
commit | 571b02efc9442e73538c3438eb593a83d7807779 (patch) | |
tree | 96c4ecbdaa066fac502111a3192cc396d6f4a79a /app/assets/javascripts | |
parent | efe3186770a4218333e1a720f1e4d3794892673e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
5 files changed, 57 insertions, 34 deletions
diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js index efb462f4778..9514ad853b0 100644 --- a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js @@ -186,14 +186,6 @@ export default class Shortcuts { } static toggleMarkdownPreview(e) { - const $form = $(e.target).closest('form'); - const toggle = $('.js-md-preview-button', $form).get(0); - - if (!toggle) return; - - toggle.focus(); - toggle.click(); - $(document).triggerHandler('markdown-preview:toggle', [e]); } diff --git a/app/assets/javascripts/content_editor/components/formatting_toolbar.vue b/app/assets/javascripts/content_editor/components/formatting_toolbar.vue index e7e520a55da..1ef38df0f78 100644 --- a/app/assets/javascripts/content_editor/components/formatting_toolbar.vue +++ b/app/assets/javascripts/content_editor/components/formatting_toolbar.vue @@ -32,7 +32,7 @@ export default { class="gl-w-full gl-display-flex gl-align-items-center gl-flex-wrap gl-bg-gray-50 gl-px-2 gl-rounded-base gl-justify-content-space-between" data-testid="formatting-toolbar" > - <div class="gl-py-2 gl-display-flex gl-flex-wrap-wrap"> + <div class="gl-py-2 gl-display-flex gl-flex-wrap"> <toolbar-text-style-dropdown data-testid="text-styles" @execute="trackToolbarControlExecution" diff --git a/app/assets/javascripts/lib/utils/vue3compat/vue_router.js b/app/assets/javascripts/lib/utils/vue3compat/vue_router.js index 1a2f958fb78..aa2963ece31 100644 --- a/app/assets/javascripts/lib/utils/vue3compat/vue_router.js +++ b/app/assets/javascripts/lib/utils/vue3compat/vue_router.js @@ -84,7 +84,17 @@ const installed = new WeakMap(); export default class VueRouterCompat { constructor(options) { // eslint-disable-next-line no-constructor-return - return createRouter(transformOptions(options)); + return new Proxy(createRouter(transformOptions(options)), { + get(target, prop) { + const result = target[prop]; + // eslint-disable-next-line no-underscore-dangle + if (result?.__v_isRef) { + return result.value; + } + + return result; + }, + }); } static install() { diff --git a/app/assets/javascripts/ml/experiment_tracking/components/model_experiments_header.vue b/app/assets/javascripts/ml/experiment_tracking/components/model_experiments_header.vue new file mode 100644 index 00000000000..02869bacb66 --- /dev/null +++ b/app/assets/javascripts/ml/experiment_tracking/components/model_experiments_header.vue @@ -0,0 +1,35 @@ +<script> +import { GlBadge } from '@gitlab/ui'; +import { __ } from '~/locale'; +import { helpPagePath } from '~/helpers/help_page_helper'; + +export default { + components: { + GlBadge, + }, + props: { + pageTitle: { + type: String, + required: true, + }, + }, + i18n: { + experimentBadgeLabel: __('Experiment'), + }, + experimentDocHref: helpPagePath('user/project/ml/experiment_tracking/index.md'), +}; +</script> + +<template> + <div class="detail-page-header gl-flex-wrap"> + <div class="detail-page-header-body"> + <div class="page-title gl-flex-grow-1 gl-display-flex gl-align-items-center"> + <h3 class="gl-font-size-h-display gl-my-0">{{ pageTitle }}</h3> + <gl-badge class="gl-mx-4" variant="info" size="lg" :href="$options.experimentDocHref"> + {{ $options.i18n.experimentBadgeLabel }} + </gl-badge> + </div> + <slot></slot> + </div> + </div> +</template> diff --git a/app/assets/javascripts/ml/experiment_tracking/routes/candidates/show/ml_candidates_show.vue b/app/assets/javascripts/ml/experiment_tracking/routes/candidates/show/ml_candidates_show.vue index b671bdc47a6..cef5da726f3 100644 --- a/app/assets/javascripts/ml/experiment_tracking/routes/candidates/show/ml_candidates_show.vue +++ b/app/assets/javascripts/ml/experiment_tracking/routes/candidates/show/ml_candidates_show.vue @@ -1,7 +1,6 @@ <script> import { GlLink } from '@gitlab/ui'; -import { FEATURE_NAME, FEATURE_FEEDBACK_ISSUE } from '~/ml/experiment_tracking/constants'; -import IncubationAlert from '~/vue_shared/components/incubation/incubation_alert.vue'; +import ModelExperimentsHeader from '~/ml/experiment_tracking/components/model_experiments_header.vue'; import DeleteButton from '~/ml/experiment_tracking/components/delete_button.vue'; import { TITLE_LABEL, @@ -22,7 +21,7 @@ import { export default { name: 'MlCandidatesShow', components: { - IncubationAlert, + ModelExperimentsHeader, DeleteButton, GlLink, }, @@ -65,32 +64,19 @@ export default { ]; }, }, - FEATURE_NAME, - FEATURE_FEEDBACK_ISSUE, }; </script> <template> <div> - <incubation-alert - :feature-name="$options.FEATURE_NAME" - :link-to-feedback-issue="$options.FEATURE_FEEDBACK_ISSUE" - /> - - <div class="detail-page-header gl-flex-wrap"> - <div class="detail-page-header-body"> - <h1 class="page-title gl-font-size-h-display flex-fill"> - {{ $options.i18n.TITLE_LABEL }} - </h1> - - <delete-button - :delete-path="candidate.info.path" - :delete-confirmation-text="$options.i18n.DELETE_CANDIDATE_CONFIRMATION_MESSAGE" - :action-primary-text="$options.i18n.DELETE_CANDIDATE_PRIMARY_ACTION_LABEL" - :modal-title="$options.i18n.DELETE_CANDIDATE_MODAL_TITLE" - /> - </div> - </div> + <model-experiments-header :page-title="$options.i18n.TITLE_LABEL"> + <delete-button + :delete-path="candidate.info.path" + :delete-confirmation-text="$options.i18n.DELETE_CANDIDATE_CONFIRMATION_MESSAGE" + :action-primary-text="$options.i18n.DELETE_CANDIDATE_PRIMARY_ACTION_LABEL" + :modal-title="$options.i18n.DELETE_CANDIDATE_MODAL_TITLE" + /> + </model-experiments-header> <table class="candidate-details gl-w-full"> <tbody> |