Skip to content

Commit f2a4482

Browse files
author
Julien Veyssier
committed
fix conflicts with non-image-media-attachments
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2 parents 01e519c + ccd70c9 commit f2a4482

File tree

498 files changed

+39077
-37628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

498 files changed

+39077
-37628
lines changed

.github/workflows/cypress.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
node-version: [14]
22+
node-version: [16]
2323
containers: [1, 2, 3, 4]
2424
php-versions: [ '7.4' ]
2525
databases: [ 'sqlite' ]
@@ -31,9 +31,6 @@ jobs:
3131
with:
3232
node-version: ${{ matrix.node-version }}
3333

34-
- name: Set up npm7
35-
run: npm i -g npm@7
36-
3734
- name: Checkout server
3835
uses: actions/checkout@v3
3936
with:

.github/workflows/dependabot-approve-merge.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@ name: Dependabot
88
on:
99
pull_request_target:
1010
branches:
11+
- main
1112
- master
1213
- stable*
1314

15+
permissions:
16+
contents: read
17+
1418
jobs:
1519
auto-approve-merge:
1620
if: github.actor == 'dependabot[bot]'
1721
runs-on: ubuntu-latest
22+
permissions:
23+
# for hmarr/auto-approve-action to approve PRs
24+
pull-requests: write
1825

1926
steps:
2027
# Github actions bot approve

.github/workflows/lint.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ jobs:
2727
- name: Set up Node
2828
uses: actions/setup-node@v1
2929
with:
30-
node-version: 14.x
31-
- name: Set up npm7
32-
run: npm i -g npm@7
30+
node-version: 16.x
3331
- name: npm install
3432
run: npm ci
3533
- name: eslint

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
],
1919
"require": {
20-
"php": "^7.3|^8.0"
20+
"php": "^7.4|^8.0"
2121
},
2222
"scripts": {
2323
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",

composer.lock

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/prosemirror.scss

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
/* Document rendering styles */
44
div.ProseMirror {
5-
margin-top: 44px;
65
height: 100%;
76
position: relative;
87
word-wrap: break-word;
@@ -26,6 +25,14 @@ div.ProseMirror {
2625
-webkit-user-select: text;
2726
user-select: text;
2827
font-size: 14px;
28+
29+
&:focus, &:focus-visible {
30+
box-shadow: none !important;
31+
}
32+
33+
* {
34+
-webkit-user-modify: read-write-plaintext-only;
35+
}
2936
}
3037

3138
.checkbox-item {
@@ -51,10 +58,16 @@ div.ProseMirror {
5158
background-position: center;
5259
cursor: pointer;
5360
}
54-
&.checked:before {
55-
background-image: url('../../img/checkbox-mark.svg');
56-
background-color: var(--color-primary-element);
57-
border-color: var(--color-primary-element);
61+
&.checked{
62+
&:before {
63+
background-image: url('../../img/checkbox-mark.svg');
64+
background-color: var(--color-primary-element);
65+
border-color: var(--color-primary-element);
66+
}
67+
label {
68+
color: var(--color-text-maxcontrast);
69+
text-decoration: line-through;
70+
}
5871
}
5972
label {
6073
display: block;
@@ -149,6 +162,18 @@ div.ProseMirror {
149162
margin-bottom: 1em;
150163
}
151164

165+
pre.frontmatter {
166+
margin-bottom: 2em;
167+
border-left: 4px solid var(--color-primary-element);
168+
}
169+
170+
pre.frontmatter::before {
171+
display: block;
172+
content: attr(data-title);
173+
color: var(--color-text-maxcontrast);
174+
padding-bottom: 0.5em;
175+
}
176+
152177
p code {
153178
background-color: var(--color-background-dark);
154179
border-radius: var(--border-radius);

css/style.scss

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ li.ProseMirror-selectednode:after {
6161
animation: rotate var(--animation-duration, 0.8s) linear infinite;
6262
}
6363

64+
[data-handler="text"] {
65+
background-color: var(--color-main-background);
66+
border-top: 3px solid var(--color-primary-element);
67+
.modal-title {
68+
font-weight: bold;
69+
}
70+
}
71+
6472
// from https://github.com/animate-css/animate.css/blob/main/source/fading_entrances/fadeInDown.css
6573
@keyframes fadeInDown {
6674
from {
@@ -73,3 +81,21 @@ li.ProseMirror-selectednode:after {
7381
transform: translate3d(0, 0, 0);
7482
}
7583
}
84+
85+
86+
// from https://github.com/animate-css/animate.css/blob/main/source/fading_entrances/fadeInLeft.css
87+
@keyframes fadeInLeft {
88+
from {
89+
opacity: 0;
90+
transform: translate3d(-100%, 0, 0);
91+
}
92+
93+
to {
94+
opacity: 1;
95+
transform: translate3d(0, 0, 0);
96+
}
97+
}
98+
99+
.fadeInLeft {
100+
animation-name: fadeInLeft;
101+
}

cypress/e2e/FrontMatter.spec.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* @copyright Copyright (c) 2022
3+
*
4+
* @license AGPL-3.0-or-later
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Affero General Public License as
8+
* published by the Free Software Foundation, either version 3 of the
9+
* License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Affero General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Affero General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
*/
20+
21+
import { initUserAndFiles, randHash } from '../utils/index.js'
22+
23+
const randUser = randHash()
24+
25+
describe('Front matter support', function() {
26+
before(function() {
27+
initUserAndFiles(randUser, 'frontmatter.md', 'empty.md')
28+
})
29+
30+
beforeEach(function() {
31+
cy.login(randUser, 'password')
32+
})
33+
34+
it('Open file with front matter', function() {
35+
cy.openFile('frontmatter.md').then(() => {
36+
expect(cy.getContent().find('pre.frontmatter').length === 1)
37+
})
38+
})
39+
40+
it('Add front matter', function() {
41+
cy.openFile('empty.md').clearContent().then(() => {
42+
cy.getContent()
43+
.type('---')
44+
.type('test')
45+
cy.getContent().find('pre.frontmatter').should(pre => {
46+
expect(pre.length === 1)
47+
expect(pre[0].text === 'test')
48+
})
49+
})
50+
})
51+
52+
it('Do not add multiple front matter', function() {
53+
cy.openFile('empty.md').clearContent().then(() => {
54+
cy.getContent()
55+
.type('---test')
56+
.type('{downArrow}')
57+
.type('---test')
58+
cy.getContent().find('pre.frontmatter').should(pre => expect(pre.length === 1))
59+
cy.getContent().find('hr').should(hr => expect(hr.length === 1))
60+
})
61+
})
62+
})

cypress/e2e/ImageView.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { randHash } from '../utils/index.js'
22

33
const currentUser = randHash()
44

5-
const refresh = () => cy.get('#controls .crumb:not(.hidden) a')
5+
const refresh = () => cy.get('.files-controls .crumb:not(.hidden) a')
66
.last()
77
.click({ force: true })
88

@@ -85,7 +85,7 @@ describe('Image View', () => {
8585
})
8686

8787
it('with preview', () => {
88-
cy.get('#fileList tr[data-file="github.png"]')
88+
cy.get('.files-fileList tr[data-file="github.png"]')
8989
.should('have.attr', 'data-id')
9090
.then(imageId => {
9191
const fileName = `${Cypress.currentTest.title}.md`
@@ -103,7 +103,7 @@ describe('Image View', () => {
103103
})
104104

105105
describe('fail to load', () => {
106-
it.only('direct access', () => {
106+
it('direct access', () => {
107107
const fileName = `${Cypress.currentTest.title}.md`
108108

109109
createMarkdown(fileName, '# from root\n\n ![yaha](/yaha.png)')

cypress/e2e/files.spec.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,24 @@
2020
*
2121
*/
2222

23-
describe('Files default view', function() {
24-
beforeEach(function() {
25-
cy.login('admin', 'admin')
23+
import { randHash } from '../utils/index.js'
24+
25+
const randUser = randHash()
26+
27+
describe('Files default view', () => {
28+
before(() => {
29+
cy.nextcloudCreateUser(randUser, randUser)
30+
})
31+
32+
beforeEach(() => {
33+
cy.login(randUser, randUser)
2634
})
2735

28-
it('See the default files list', function() {
29-
cy.get('#fileList tr').should('contain', 'welcome.txt')
36+
it('See the default files list', () => {
37+
cy.get('#app-content-files table tr').should('contain', 'welcome.txt')
3038
})
3139

32-
it('Take screenshot', function() {
40+
it('Take screenshot', () => {
3341
cy.screenshot()
3442
})
3543
})

0 commit comments

Comments
 (0)