diff --git a/.eslintrc.js b/.eslintrc.js index 14fee57dc4..f155eea6c4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -14,20 +14,6 @@ module.exports = { plugins: [ 'cypress', ], - ignorePatterns: [ - 'src/components/NcAppContent*/*.vue', - 'src/components/NcAppNavigation*/*.vue', - 'src/components/NcAppSettings*/*.vue', - 'src/components/NcAppSidebar*/*.vue', - 'src/components/NcBreadcrumb*/*.vue', - 'src/components/NcContent/*.vue', - 'src/components/NcDashboard*/*.vue', - 'src/components/NcRelatedResourcesPanel*/*.vue', - 'src/components/NcRich*/**/*.vue', - 'src/components/NcUserBubble*/*.vue', - 'src/components/NcVNodes*/*.vue', - 'src/utils/IsMobileState.js', - ], parserOptions: { babelOptions: { plugins: [ diff --git a/cypress/component/richtext.cy.ts b/cypress/component/richtext.cy.ts index 28ae7e6f77..9a156b91bb 100644 --- a/cypress/component/richtext.cy.ts +++ b/cypress/component/richtext.cy.ts @@ -1,7 +1,7 @@ // Markdown guide: https://www.markdownguide.org/basic-syntax/ // Reference tests: https://github.com/nextcloud-deps/CDMarkdownKit/tree/master/CDMarkdownKitTests -import { mount } from 'cypress/vue2' +import { mount } from 'cypress/vue' import NcRichText from '../../src/components/NcRichText/NcRichText.vue' describe('NcRichText', () => { @@ -9,7 +9,7 @@ describe('NcRichText', () => { describe('normal text', () => { it('XML-like text (escaped and unescaped)', () => { mount(NcRichText, { - propsData: { + props: { text: 'text</span>', useMarkdown: true, }, @@ -31,7 +31,7 @@ describe('NcRichText', () => { ] mount(NcRichText, { - propsData: { + props: { text: testCases.map(i => i.input).join('\n'), useMarkdown: true, }, @@ -44,7 +44,7 @@ describe('NcRichText', () => { it('ignored heading (with hash (#) syntax padded to the text)', () => { mount(NcRichText, { - propsData: { + props: { text: '#heading', useMarkdown: true, }, @@ -55,7 +55,7 @@ describe('NcRichText', () => { it('heading 1 (with equal (=) syntax on the next line)', () => { mount(NcRichText, { - propsData: { + props: { text: 'heading 1\n==', useMarkdown: true, }, @@ -66,7 +66,7 @@ describe('NcRichText', () => { it('heading 2 (with dash (-) syntax on the next line)', () => { mount(NcRichText, { - propsData: { + props: { text: 'heading 2\n--', useMarkdown: true, }, @@ -79,7 +79,7 @@ describe('NcRichText', () => { describe('bold text', () => { it('bold text (single with asterisk syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '**bold asterisk**', useMarkdown: true, }, @@ -90,7 +90,7 @@ describe('NcRichText', () => { it('bold text (single with underscore syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '__bold underscore__', useMarkdown: true, }, @@ -102,7 +102,7 @@ describe('NcRichText', () => { it('bold text (several in line with different syntax)', () => { const outputs = ['bold underscore', 'bold asterisk'] mount(NcRichText, { - propsData: { + props: { text: 'normal text __bold underscore__ normal text **bold asterisk** normal text', useMarkdown: true, }, @@ -116,7 +116,7 @@ describe('NcRichText', () => { it('bold text (between normal texts with asterisk syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'text**bold**text', useMarkdown: true, }, @@ -127,7 +127,7 @@ describe('NcRichText', () => { it('ignored bold text (between normal texts with underscore syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'text__bold__text', useMarkdown: true, }, @@ -139,7 +139,7 @@ describe('NcRichText', () => { it('normal text (between bold texts with asterisk syntax)', () => { const outputs = ['bold asterisk', 'bold asterisk'] mount(NcRichText, { - propsData: { + props: { text: '**bold asterisk**normal text**bold asterisk**', useMarkdown: true, }, @@ -155,7 +155,7 @@ describe('NcRichText', () => { describe('italic text', () => { it('italic text (single with asterisk syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '*italic asterisk*', useMarkdown: true, }, @@ -166,7 +166,7 @@ describe('NcRichText', () => { it('italic text (single with underscore syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '_italic underscore_', useMarkdown: true, }, @@ -178,7 +178,7 @@ describe('NcRichText', () => { it('italic text (several in line with different syntax)', () => { const outputs = ['italic underscore', 'italic asterisk'] mount(NcRichText, { - propsData: { + props: { text: 'normal text _italic underscore_ normal text *italic asterisk* normal text', useMarkdown: true, }, @@ -192,7 +192,7 @@ describe('NcRichText', () => { it('italic text (between normal texts with asterisk syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'text*italic*text', useMarkdown: true, }, @@ -203,7 +203,7 @@ describe('NcRichText', () => { it('ignored italic text (between normal texts with underscore syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'text_italic_text', useMarkdown: true, }, @@ -215,7 +215,7 @@ describe('NcRichText', () => { it('normal text (between italic texts with asterisk syntax)', () => { const outputs = ['italic asterisk', 'italic asterisk'] mount(NcRichText, { - propsData: { + props: { text: '*italic asterisk*normal text*italic asterisk*', useMarkdown: true, }, @@ -231,7 +231,7 @@ describe('NcRichText', () => { describe('inline code', () => { it('inline code (single with backticks syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'normal text `inline code` normal text', useMarkdown: true, }, @@ -242,7 +242,7 @@ describe('NcRichText', () => { it('inline code (single with double backticks syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'normal text ``inline code`` normal text', useMarkdown: true, }, @@ -253,7 +253,7 @@ describe('NcRichText', () => { it('inline code (single with triple backticks syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'normal text ```inline code``` normal text', useMarkdown: true, }, @@ -265,7 +265,7 @@ describe('NcRichText', () => { it('inline code (several in line )', () => { const outputs = ['inline code 1', 'inline code 2'] mount(NcRichText, { - propsData: { + props: { text: 'normal text `inline code 1`normal text ``inline code 2`` normal text', useMarkdown: true, }, @@ -279,7 +279,7 @@ describe('NcRichText', () => { it('inline code (between normal texts)', () => { mount(NcRichText, { - propsData: { + props: { text: 'text`inline code`text', useMarkdown: true, }, @@ -290,7 +290,7 @@ describe('NcRichText', () => { it('inline code (with ignored bold, italic, XML-like syntax))', () => { mount(NcRichText, { - propsData: { + props: { text: '`inline code **bold text** _italic text_ text</span>`', useMarkdown: true, }, @@ -303,7 +303,7 @@ describe('NcRichText', () => { describe('multiline code', () => { it('multiline code (with triple backticks syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '```\nmultiline code\n```', useMarkdown: true, }, @@ -314,7 +314,7 @@ describe('NcRichText', () => { it('multiline code (ignored info)', () => { mount(NcRichText, { - propsData: { + props: { text: '```vue\nmultiline code\n```', useMarkdown: true, }, @@ -325,7 +325,7 @@ describe('NcRichText', () => { it('empty multiline code', () => { mount(NcRichText, { - propsData: { + props: { text: '``````', useMarkdown: true, }, @@ -336,7 +336,7 @@ describe('NcRichText', () => { it('empty multiline code (with new line)', () => { mount(NcRichText, { - propsData: { + props: { text: '```\n```', useMarkdown: true, }, @@ -347,7 +347,7 @@ describe('NcRichText', () => { it('multiline code (with several lines)', () => { mount(NcRichText, { - propsData: { + props: { text: '```\nline 1\nline 2\nline 3\n```', useMarkdown: true, }, @@ -359,7 +359,7 @@ describe('NcRichText', () => { it('multiline code (with ignored bold, italic, inline code, XML-like syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '```\n**bold text**\n_italic text_\n`inline code`\ntext</span>\n```', useMarkdown: true, }, @@ -372,7 +372,7 @@ describe('NcRichText', () => { describe('blockquote', () => { it('blockquote (with greater then (>) syntax - normal)', () => { mount(NcRichText, { - propsData: { + props: { text: '> blockquote', useMarkdown: true, }, @@ -383,7 +383,7 @@ describe('NcRichText', () => { it('blockquote (with greater then (>) syntax - escaped)', () => { mount(NcRichText, { - propsData: { + props: { text: '> blockquote', useMarkdown: true, }, @@ -394,7 +394,7 @@ describe('NcRichText', () => { it('blockquote (with bold, italic text, inline code)', () => { mount(NcRichText, { - propsData: { + props: { text: '> blockquote **bold text** _italic text_ `inline code`', useMarkdown: true, }, @@ -408,7 +408,7 @@ describe('NcRichText', () => { it('blockquote (with several lines)', () => { mount(NcRichText, { - propsData: { + props: { text: '> line 1\nline 2\n line 3', useMarkdown: true, }, @@ -419,7 +419,7 @@ describe('NcRichText', () => { it('blockquote (divided from normal text)', () => { mount(NcRichText, { - propsData: { + props: { text: 'normal text\n> line 1\nline 2\n\nnormal text', useMarkdown: true, }, @@ -430,7 +430,7 @@ describe('NcRichText', () => { it('blockquote (with several paragraphs)', () => { mount(NcRichText, { - propsData: { + props: { text: '> line 1\n>\n> line 3', useMarkdown: true, }, @@ -441,7 +441,7 @@ describe('NcRichText', () => { it('blockquote (with nested blockquote)', () => { mount(NcRichText, { - propsData: { + props: { text: '> blockquote\n>\n>> nested blockquote', useMarkdown: true, }, @@ -460,7 +460,7 @@ describe('NcRichText', () => { ] mount(NcRichText, { - propsData: { + props: { text: testCases.map(i => i.input).join('\n'), useMarkdown: true, }, @@ -481,7 +481,7 @@ describe('NcRichText', () => { ] mount(NcRichText, { - propsData: { + props: { text: testCases.map(i => i.input).join('\n'), useMarkdown: true, }, @@ -502,7 +502,7 @@ describe('NcRichText', () => { ] mount(NcRichText, { - propsData: { + props: { text: testCases.map(i => i.input).join('\n'), useMarkdown: true, }, @@ -518,7 +518,7 @@ describe('NcRichText', () => { describe('dividers', () => { it('dividers (with different syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '***\n---\n___', useMarkdown: true, }, diff --git a/src/components/NcAppContent/NcAppContent.vue b/src/components/NcAppContent/NcAppContent.vue index 725886192f..d03327bbfc 100644 --- a/src/components/NcAppContent/NcAppContent.vue +++ b/src/components/NcAppContent/NcAppContent.vue @@ -81,7 +81,7 @@ The list size must be between the min and the max width value.
- + diff --git a/src/components/NcAppContent/NcAppDetailsToggle.vue b/src/components/NcAppContent/NcAppDetailsToggle.vue index 0390069b00..c60e14cbaf 100644 --- a/src/components/NcAppContent/NcAppDetailsToggle.vue +++ b/src/components/NcAppContent/NcAppDetailsToggle.vue @@ -59,7 +59,7 @@ export default { this.toggleAppNavigationButton(true) }, - beforeDestroy() { + beforeUnmount() { this.toggleAppNavigationButton(false) }, diff --git a/src/components/NcAppNavigation/NcAppNavigation.vue b/src/components/NcAppNavigation/NcAppNavigation.vue index bfc8c334ee..daccd0beaa 100644 --- a/src/components/NcAppNavigation/NcAppNavigation.vue +++ b/src/components/NcAppNavigation/NcAppNavigation.vue @@ -92,6 +92,9 @@ export default { data() { return { open: true, + // Watching an injected property directly does not work + // so we watch a data property instead. + localIsMobile: this.isMobile, } }, computed: { @@ -101,12 +104,14 @@ export default { }, watch: { - isMobile() { - this.open = !this.isMobile + localIsMobile(isMobile) { + this.open = !isMobile }, }, mounted() { + // Sync the state + this.open = !this.localIsMobile subscribe('toggle-navigation', this.toggleNavigationByEventBus) // Emit an event with the initial state of the navigation emit('navigation-toggled', { diff --git a/src/components/NcAppNavigationCaption/NcAppNavigationCaption.vue b/src/components/NcAppNavigationCaption/NcAppNavigationCaption.vue index c37dbff266..0064f07b64 100644 --- a/src/components/NcAppNavigationCaption/NcAppNavigationCaption.vue +++ b/src/components/NcAppNavigationCaption/NcAppNavigationCaption.vue @@ -91,8 +91,7 @@
- + @@ -161,7 +161,7 @@ export default { overflow-y: hidden !important; } -.slide-up-enter, +.slide-up-enter-from, .slide-up-leave-to { max-height: 0 !important; padding: 0 10px !important; diff --git a/src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue b/src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue index 33a3c8183a..ff90fd8df9 100644 --- a/src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue +++ b/src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue @@ -29,7 +29,7 @@ providing the section's name prop. You can put your settings within each