Skip to content

Commit 73152d3

Browse files
committed
Port settings to vue
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent 52a0537 commit 73152d3

50 files changed

Lines changed: 8122 additions & 9018 deletions

Some content is hidden

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

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ js/activity-dashboard.js binary
22
js/activity-sidebar.js binary
33
js/*.LICENCE.map binary
44
js/*.js.map binary
5+
js/activity-*.js binary
56
package-lock.json binary
67
src/test/__snapshots__/*.snap

css/settings.css

Lines changed: 0 additions & 29 deletions
This file was deleted.

cypress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"projectId": "hx9gqy",
44
"viewportWidth": 1280,
55
"viewportHeight": 720
6-
}
6+
}

cypress/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/nextcloud/continuous-integration-server:latest
1+
FROM nextcloudci/server:latest
22

33
RUN mkdir /var/www/html/data
44
RUN chown -R www-data:www-data /var/www/html/data
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/**
2+
* @copyright Copyright (c) 2021 Louis Chemineau <louis@chmn.me>
3+
*
4+
* @author Louis Chemineau <louis@chmn.me>
5+
*
6+
* @license GNU AGPL version 3 or any later version
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Affero General Public License as
10+
* published by the Free Software Foundation, either version 3 of the
11+
* License, or (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Affero General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Affero General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
23+
/// <reference types="Cypress" />
24+
25+
import { randHash } from '../utils'
26+
const randUser = randHash()
27+
28+
describe('Check that user\'s settings survive a reload', () => {
29+
before(() => {
30+
cy.nextcloudCreateUser(randUser, 'password')
31+
cy.login(randUser, 'password')
32+
cy.visit('/settings/user/notifications')
33+
cy.wait(1000)
34+
})
35+
36+
after(() => {
37+
cy.logout()
38+
})
39+
40+
it('Form survive a reload', () => {
41+
cy.get("#app-content input[type='checkbox']").uncheck({force: true}).should('not.be.checked')
42+
43+
cy.reload()
44+
45+
cy.get("#app-content input[type='checkbox']").uncheck({force: true}).should('not.be.checked')
46+
47+
cy.get("#file_changed_notification").check({force: true})
48+
cy.contains("A calendar was modified").click()
49+
cy.contains("Comments for files").click()
50+
cy.contains("Your password or email was modified").click()
51+
52+
cy.reload()
53+
54+
cy.get("#file_changed_email").should('not.be.checked')
55+
cy.get("#file_changed_notification").should('be.checked')
56+
cy.get("#shared_email").should('not.be.checked')
57+
cy.get("#shared_notification").should('not.be.checked')
58+
cy.get("#remote_share_email").should('not.be.checked')
59+
cy.get("#remote_share_notification").should('not.be.checked')
60+
cy.get("#public_links_email").should('not.be.checked')
61+
cy.get("#public_links_notification").should('not.be.checked')
62+
cy.get("#calendar_email").should('be.checked')
63+
cy.get("#calendar_notification").should('be.checked')
64+
cy.get("#calendar_event_email").should('not.be.checked')
65+
cy.get("#calendar_event_notification").should('not.be.checked')
66+
cy.get("#calendar_todo_email").should('not.be.checked')
67+
cy.get("#calendar_todo_notification").should('not.be.checked')
68+
cy.get("#contacts_email").should('not.be.checked')
69+
cy.get("#contacts_notification").should('not.be.checked')
70+
cy.get("#group_settings_email").should('not.be.checked')
71+
cy.get("#group_settings_notification").should('not.be.checked')
72+
cy.get("#personal_settings_email").should('not.be.checked')
73+
cy.get("#personal_settings_notification").should('be.checked')
74+
cy.get("#security_email").should('be.checked')
75+
cy.get("#security_notification").should('not.be.checked')
76+
cy.get("#comments_email").should('be.checked')
77+
cy.get("#comments_notification").should('be.checked')
78+
cy.get("#systemtags_email").should('not.be.checked')
79+
cy.get("#systemtags_notification").should('not.be.checked')
80+
})
81+
82+
it('Notification frequency survive a reload', () => {
83+
cy.get(".notification-frequency__select").select("Weekly")
84+
85+
cy.wait(200)
86+
cy.reload()
87+
88+
cy.get('.notification-frequency__select').find(':selected').contains('Weekly')
89+
cy.get(".notification-frequency__select").select("Hourly")
90+
91+
cy.wait(200)
92+
cy.reload()
93+
94+
cy.get('.notification-frequency__select').find(':selected').contains('Hourly')
95+
})
96+
97+
it('Activity summary survive a reload', () => {
98+
let input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section').children('input')
99+
100+
input.check({force: true})
101+
input.should('be.checked')
102+
103+
cy.reload()
104+
input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section').children('input')
105+
106+
input.should('be.checked')
107+
108+
input.uncheck({force: true})
109+
110+
cy.reload()
111+
input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section').children('input')
112+
113+
input.should('not.be.checked')
114+
})
115+
})
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/**
2+
* @copyright Copyright (c) 2021 Louis Chemineau <louis@chmn.me>
3+
*
4+
* @author Louis Chemineau <louis@chmn.me>
5+
*
6+
* @license GNU AGPL version 3 or any later version
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Affero General Public License as
10+
* published by the Free Software Foundation, either version 3 of the
11+
* License, or (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Affero General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Affero General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
23+
/// <reference types="Cypress" />
24+
25+
import { randHash } from '../utils'
26+
const randUser = randHash()
27+
28+
describe('Check activity listing in the sidebar', function() {
29+
before(function() {
30+
cy.nextcloudCreateUser(randUser, 'password')
31+
cy.login(randUser, 'password')
32+
33+
cy.visit('/apps/files')
34+
35+
cy.wait(1000)
36+
})
37+
38+
after(function() {
39+
cy.logout()
40+
})
41+
42+
it('Has creation activity', function() {
43+
cy.showActivityTab('welcome.txt')
44+
cy.get('.activity-entry').eq(0).should('contains.text', 'You created')
45+
})
46+
47+
it('Has favorite activity', function() {
48+
cy.addToFavorites('welcome.txt')
49+
cy.showActivityTab('welcome.txt')
50+
cy.get('.activity-entry').eq(0).should('contains.text', 'Added to favorites')
51+
52+
cy.removeFromFavorites('welcome.txt')
53+
cy.showActivityTab('welcome.txt')
54+
cy.get('.activity-entry').eq(0).should('contains.text', 'Removed from favorites')
55+
})
56+
57+
it('Has share activity', function() {
58+
cy.createPublicShare('welcome.txt')
59+
cy.showActivityTab('welcome.txt')
60+
cy.get('.activity-entry').eq(0).should('contains.text', 'Shared as public link')
61+
})
62+
63+
it('Has rename activity', function() {
64+
cy.renameFile('welcome.txt', 'new name')
65+
cy.renameFile('new name.txt', 'welcome')
66+
67+
cy.showActivityTab('welcome.txt')
68+
cy.get('.activity-entry').eq(0).should('contains.text', 'You renamed')
69+
})
70+
71+
it('Has move activity', function() {
72+
cy.createFolder('Test folder')
73+
cy.moveFile('welcome.txt', 'Test folder')
74+
cy.goToDir('Test folder')
75+
76+
cy.showActivityTab('welcome.txt')
77+
cy.get('.activity-entry').eq(0).should('contains.text', 'You moved')
78+
})
79+
80+
it('Has tag activity', function() {
81+
cy.addTag('welcome.txt', 'my_tag')
82+
83+
cy.showActivityTab('welcome.txt')
84+
cy.get('.activity-entry').eq(0).should('contains.text', 'Added system tag')
85+
})
86+
87+
it('Has comment activity', function() {
88+
cy.addComment('welcome.txt', 'A comment')
89+
90+
cy.showActivityTab('welcome.txt')
91+
cy.get('.activity-entry').eq(0).should('contains.text', 'You commented')
92+
})
93+
94+
})

cypress/support/commands.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
*/
2222

23-
import axios from '@nextcloud/axios'
23+
/// <reference types="Cypress" />
2424

2525
const url = Cypress.config('baseUrl').replace(/\/index.php\/?$/g, '')
2626
Cypress.env('baseUrl', url)
@@ -33,7 +33,7 @@ Cypress.Commands.add('login', (user, password, route = '/apps/files') => {
3333
cy.visit(route)
3434
cy.get('input[name=user]').type(user)
3535
cy.get('input[name=password]').type(password)
36-
cy.get('.submit-wrapper input[type=submit]').click()
36+
cy.get('form[name=login] .button-vue[type=submit]').click()
3737
cy.url().should('include', route)
3838
})
3939

cypress/support/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@
1313
// https://on.cypress.io/configuration
1414
// ***********************************************************
1515

16-
// Import commands.js using ES2015 syntax:
1716
import './commands'
18-
19-
// Alternatively you can use CommonJS syntax:
20-
// require('./commands')
17+
import './sidebar'

0 commit comments

Comments
 (0)