Commit 6f30fe22 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'kp-add-zen-mode-support-issuable-show' into 'master'

Add Zen Mode support to Issuable Show

See merge request gitlab-org/gitlab!58984
parents cfe48671 b37eb36d
...@@ -42,6 +42,10 @@ export default { ...@@ -42,6 +42,10 @@ export default {
type: Boolean, type: Boolean,
required: true, required: true,
}, },
enableZenMode: {
type: Boolean,
required: true,
},
enableTaskList: { enableTaskList: {
type: Boolean, type: Boolean,
required: false, required: false,
...@@ -144,6 +148,7 @@ export default { ...@@ -144,6 +148,7 @@ export default {
:issuable="issuable" :issuable="issuable"
:enable-autocomplete="enableAutocomplete" :enable-autocomplete="enableAutocomplete"
:enable-autosave="enableAutosave" :enable-autosave="enableAutosave"
:enable-zen-mode="enableZenMode"
:show-field-title="showFieldTitle" :show-field-title="showFieldTitle"
:description-preview-path="descriptionPreviewPath" :description-preview-path="descriptionPreviewPath"
:description-help-path="descriptionHelpPath" :description-help-path="descriptionHelpPath"
......
...@@ -4,6 +4,7 @@ import $ from 'jquery'; ...@@ -4,6 +4,7 @@ import $ from 'jquery';
import Autosave from '~/autosave'; import Autosave from '~/autosave';
import MarkdownField from '~/vue_shared/components/markdown/field.vue'; import MarkdownField from '~/vue_shared/components/markdown/field.vue';
import ZenMode from '~/zen_mode';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
...@@ -27,6 +28,10 @@ export default { ...@@ -27,6 +28,10 @@ export default {
type: Boolean, type: Boolean,
required: true, required: true,
}, },
enableZenMode: {
type: Boolean,
required: true,
},
showFieldTitle: { showFieldTitle: {
type: Boolean, type: Boolean,
required: true, required: true,
...@@ -62,6 +67,9 @@ export default { ...@@ -62,6 +67,9 @@ export default {
}, },
mounted() { mounted() {
if (this.enableAutosave) this.initAutosave(); if (this.enableAutosave) this.initAutosave();
// eslint-disable-next-line no-new
if (this.enableZenMode) new ZenMode();
}, },
beforeDestroy() { beforeDestroy() {
eventHub.$off('update.issuable', this.resetAutosave); eventHub.$off('update.issuable', this.resetAutosave);
......
...@@ -42,6 +42,11 @@ export default { ...@@ -42,6 +42,11 @@ export default {
required: false, required: false,
default: true, default: true,
}, },
enableZenMode: {
type: Boolean,
required: false,
default: true,
},
enableTaskList: { enableTaskList: {
type: Boolean, type: Boolean,
required: false, required: false,
...@@ -120,6 +125,7 @@ export default { ...@@ -120,6 +125,7 @@ export default {
:enable-edit="enableEdit" :enable-edit="enableEdit"
:enable-autocomplete="enableAutocomplete" :enable-autocomplete="enableAutocomplete"
:enable-autosave="enableAutosave" :enable-autosave="enableAutosave"
:enable-zen-mode="enableZenMode"
:enable-task-list="enableTaskList" :enable-task-list="enableTaskList"
:edit-form-visible="editFormVisible" :edit-form-visible="editFormVisible"
:show-field-title="showFieldTitle" :show-field-title="showFieldTitle"
......
...@@ -250,6 +250,7 @@ export default { ...@@ -250,6 +250,7 @@ export default {
:enable-edit="canEditRequirement" :enable-edit="canEditRequirement"
:enable-autocomplete="false" :enable-autocomplete="false"
:enable-autosave="false" :enable-autosave="false"
:enable-zen-mode="false"
:edit-form-visible="enableRequirementEdit || isCreate" :edit-form-visible="enableRequirementEdit || isCreate"
:show-field-title="true" :show-field-title="true"
:description-preview-path="descriptionPreviewPath" :description-preview-path="descriptionPreviewPath"
......
---
title: Make Zen Mode functional while editing Test Case description
merge_request: 58984
author:
type: fixed
...@@ -72,6 +72,15 @@ RSpec.describe 'Test Cases', :js do ...@@ -72,6 +72,15 @@ RSpec.describe 'Test Cases', :js do
end end
end end
it 'enters into zen mode when clicking on zen mode button' do
page.within('.test-case-container .issuable-details') do
page.find('.js-issuable-edit').click
page.find('.js-vue-markdown-field button.js-zen-enter').click
expect(page).to have_selector('.zen-backdrop.fullscreen')
end
end
it 'update title and description' do it 'update title and description' do
title = 'Updated title' title = 'Updated title'
description = 'Updated test case description.' description = 'Updated test case description.'
......
...@@ -32,6 +32,7 @@ export const mockIssuableShowProps = { ...@@ -32,6 +32,7 @@ export const mockIssuableShowProps = {
editFormVisible: false, editFormVisible: false,
enableAutocomplete: true, enableAutocomplete: true,
enableAutosave: true, enableAutosave: true,
enableZenMode: true,
enableTaskList: true, enableTaskList: true,
enableEdit: true, enableEdit: true,
showFieldTitle: false, showFieldTitle: false,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment