Skip to content

Commit 1e3441e

Browse files
author
pusztaienike
committed
Merge branch 'release/2021-04'
2 parents 07a01f0 + 30b3b0d commit 1e3441e

File tree

540 files changed

+17882
-8804
lines changed

Some content is hidden

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

540 files changed

+17882
-8804
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ packages/**/dist/*
55
examples/**/build/*
66
examples/**/storybook-static/*
77
apps/**/bundle/*
8+
apps/**/instrumented/*
89
webpack.*

.eslintrc.js

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ module.exports = {
88
'plugin:import/recommended',
99
'plugin:import/react',
1010
'plugin:import/typescript',
11-
'prettier',
12-
'prettier/react',
13-
'prettier/@typescript-eslint',
11+
'plugin:prettier/recommended',
1412
],
1513
parser: '@typescript-eslint/parser',
16-
plugins: ['@typescript-eslint', 'prettier', 'react', 'cypress', 'jsdoc', 'import', 'react-hooks'],
14+
plugins: ['@typescript-eslint', 'react', 'cypress', 'jsdoc', 'import', 'react-hooks'],
1715
env: { browser: true, node: true, es6: true, jest: true, 'cypress/globals': true },
1816
parserOptions: {
1917
ecmaVersion: 6,
@@ -27,32 +25,29 @@ module.exports = {
2725
version: 'detect',
2826
},
2927
jsdoc: { exemptEmptyFunctions: false },
28+
'import/parsers': {
29+
'@typescript-eslint/parser': ['.ts', '.tsx'],
30+
},
31+
'import/resolver': {
32+
typescript: {
33+
project: 'packages/*/tsconfig.json',
34+
},
35+
},
3036
},
3137
rules: {
32-
'arrow-parens': ['error', 'always'],
33-
'no-unused-vars': 'off',
34-
'no-console': 'off',
3538
'react/prop-types': 0,
3639
'@typescript-eslint/ban-ts-comment': 'off',
3740
'@typescript-eslint/ban-types': 'off',
38-
'@typescript-eslint/no-unused-vars': 'off', // Use Typescript own check for this
3941
'@typescript-eslint/no-empty-function': 'off',
4042
'@typescript-eslint/explicit-module-boundary-types': 'off',
4143
'@typescript-eslint/no-parameter-properties': 'off',
4244
'@typescript-eslint/no-explicit-any': 'off',
43-
'@typescript-eslint/no-extra-non-null-assertion': 'off',
44-
'@typescript-eslint/no-extra-semi': 'off',
4545
'@typescript-eslint/no-non-null-assertion': 'off',
46-
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
4746
'@typescript-eslint/array-type': ['error', { default: 'array-simple', readonly: 'array-simple' }],
48-
'@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
49-
'@typescript-eslint/prefer-as-const': 'off',
50-
'no-unused-expressions': 'off',
51-
'prettier/prettier': 'error',
5247
'require-jsdoc': 1,
5348
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
5449
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
55-
'import/no-unresolved': 'off',
50+
'import/default': 0,
5651
'import/order': [
5752
'error',
5853
{
@@ -77,16 +72,10 @@ module.exports = {
7772
],
7873
'object-shorthand': 'error',
7974
'dot-notation': 'error',
80-
'no-caller': 'error',
8175
'no-useless-concat': 'error',
82-
'no-undef': 0, // This is checked by typescript noUnusedLocals option
8376
radix: 'error',
8477
yoda: 'error',
8578
'prefer-arrow-callback': 'error',
86-
'prefer-rest-params': 'error',
87-
'no-var': 'error',
88-
'prefer-const': 'error',
89-
'prefer-spread': 'error',
9079
'no-shadow': 'off',
9180
'@typescript-eslint/no-shadow': ['error'],
9281
'@typescript-eslint/no-useless-constructor': 'error',
@@ -106,8 +95,6 @@ module.exports = {
10695
{
10796
files: ['**/test/**/*.{ts,tsx}'],
10897
rules: {
109-
'@typescript-eslint/no-explicit-any': 'off',
110-
'@typescript-eslint/no-non-null-assertion': 'off',
11198
'dot-notation': 'off',
11299
},
113100
},

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jobs:
2020
env:
2121
CYPRESS_INSTALL_BINARY: 0
2222

23+
- name: build
24+
run: yarn build
25+
2326
- name: lint
2427
run: yarn lint
2528

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn lint-staged

apps/sensenet/cypress/integration/groups/groups.spec.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,51 @@ describe('Groups', () => {
3737
cy.get('[data-test="viewtitle"').should('have.text', 'Edit Editors')
3838
cy.get('[data-test="cancel"]').click()
3939
})
40+
41+
it('ensures that creation of a new group is working properly', () => {
42+
const groupName = 'test'
43+
44+
cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()
45+
46+
cy.get('[data-test="groups"]').click()
47+
cy.get('[data-test="add-button"]').should('not.be.disabled').click()
48+
49+
cy.get('[data-test="listitem-group"]')
50+
.click()
51+
.then(() => {
52+
cy.get('[data-test="viewtitle"]').should('contain.text', 'New Group')
53+
54+
cy.get('#Name').type(groupName)
55+
56+
cy.contains('Submit').click()
57+
58+
cy.get('[data-test="snackbar-close"]').click()
59+
cy.get(`[data-test="table-cell-${groupName}`).should('have.text', groupName)
60+
})
61+
})
62+
63+
it('ensures that deletion of a group is working properly', () => {
64+
cy.intercept({
65+
method: 'GET',
66+
url: '/Root/Trash',
67+
}).as('getTrashChildren')
68+
69+
cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()
70+
71+
cy.get('[data-test="groups"]').click()
72+
cy.get('[data-test="table-cell-test"]')
73+
.rightclick()
74+
.then(() => {
75+
cy.get('[data-test="content-context-menu-delete"]').click()
76+
cy.get('[data-test="button-delete-confirm"]').click()
77+
78+
cy.get('[data-test="table-cell-test"]').should('not.exist')
79+
80+
cy.get('[data-test="drawer-menu-item-trash"]').click()
81+
82+
cy.wait('@getTrashChildren').then((_interception) => {
83+
cy.get('[data-test="table-cell-test"]').should('not.exist')
84+
})
85+
})
86+
})
4087
})
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { PATHS, resolvePathParams } from '../../src/application-paths'
2+
import { pathWithQueryParams } from '../../src/services/query-string-builder'
3+
4+
describe('Organizational units', () => {
5+
beforeEach(() => {
6+
cy.login()
7+
cy.visit(
8+
pathWithQueryParams({
9+
path: resolvePathParams({ path: PATHS.usersAndGroups.appPath, params: { browseType: 'explorer' } }),
10+
newParams: { repoUrl: Cypress.env('repoUrl') },
11+
}),
12+
)
13+
})
14+
15+
it('ensure that creating a new org unit works as it is expected', () => {
16+
cy.get('[data-test="add-button"]').should('not.be.disabled').click()
17+
cy.get('[data-test="listitem-organizational-unit"]')
18+
.click()
19+
.then(() => {
20+
cy.get('#Name').type('test1')
21+
cy.contains('Submit').click()
22+
23+
cy.get('[data-test="snackbar-close"]').click()
24+
cy.get(`[data-test="menu-item-test1"]`).should('exist')
25+
})
26+
})
27+
28+
it('ensure that organizational units build a tree', () => {
29+
cy.get(`[data-test="menu-item-test1"]`).click()
30+
31+
cy.get('[data-test="add-button"]').should('not.be.disabled').click()
32+
cy.get('[data-test="listitem-organizational-unit"]')
33+
.click()
34+
.then(() => {
35+
cy.get('#Name').type('test2')
36+
cy.contains('Submit').click()
37+
38+
cy.get(`[data-test="menu-item-test1"]`).then((element) => {
39+
const paddingLeftOfParent = element.css('padding-left')
40+
41+
cy.get(`[data-test="menu-item-test2"]`).should('exist')
42+
cy.get(`[data-test="menu-item-test1"]`).should('have.class', 'Mui-selected')
43+
44+
cy.get(`[data-test="menu-item-test2"]`).should((nestedElement) => {
45+
expect(nestedElement).to.have.css('padding-left', `${parseInt(paddingLeftOfParent, 10) + 20}px`)
46+
})
47+
})
48+
})
49+
})
50+
51+
it('ensure that organizational units tree is deletable', () => {
52+
cy.get(`[data-test="menu-item-test1"]`).click().rightclick()
53+
54+
cy.get('[data-test="content-context-menu-delete"]').click()
55+
cy.get('[data-test="delete-permanently"] input[type="checkbox"]').check()
56+
cy.get('[data-test="button-delete-confirm"]').click()
57+
58+
cy.get('[data-test="menu-item-test1').should('not.exist')
59+
cy.get('[data-test="menu-item-test2').should('not.exist')
60+
})
61+
})

apps/sensenet/cypress/integration/users-and-groups.spec.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,68 @@ describe('Users menu', () => {
6464
})
6565
cy.get('[data-test="cancel"]').click()
6666
})
67+
68+
it('ensures that deletion of users is working properly', () => {
69+
cy.intercept({
70+
method: 'GET',
71+
url: '/Root/Trash',
72+
}).as('getTrashChildren')
73+
74+
cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()
75+
76+
cy.get('[data-test="table-cell-developer-dog"]')
77+
.rightclick()
78+
.then(() => {
79+
cy.get('[data-test="content-context-menu-delete"]').click()
80+
cy.get('[data-test="button-delete-confirm"]').click()
81+
82+
cy.get('[data-test="table-celll-developer-dog"]').should('not.exist')
83+
84+
cy.get('[data-test="drawer-menu-item-trash"]').click()
85+
86+
cy.wait('@getTrashChildren').then((_interception) => {
87+
cy.get('[data-test="table-celll-developer-dog"]').should('not.exist')
88+
})
89+
})
90+
})
91+
92+
it('ensures that the creation of a new users is working properly', () => {
93+
const newUser = {
94+
loginName: 'devdog',
95+
fullName: 'Developer Dog',
96+
97+
password: 'devdog',
98+
}
99+
100+
cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()
101+
102+
cy.get('[data-test="add-button"]').should('not.be.disabled').click()
103+
104+
cy.get('[data-test="listitem-user"]')
105+
.click()
106+
.then(() => {
107+
cy.get('[data-test="viewtitle"]').should('contain.text', 'New User')
108+
109+
cy.get('#LoginName').type(newUser.loginName)
110+
cy.get('#FullName').type(newUser.fullName)
111+
cy.get('#Email').type(newUser.email)
112+
cy.get('#Password').type(newUser.password)
113+
114+
cy.contains('Submit').click()
115+
116+
cy.get('[data-test="snackbar-close"]').click()
117+
cy.get(`[data-test="table-cell-${newUser.fullName.replace(/\s+/g, '-').toLowerCase()}`).should(
118+
'have.text',
119+
newUser.fullName,
120+
)
121+
})
122+
})
123+
124+
it('ensures that we can enable a user by clicking on its status checkbox in the User list', () => {
125+
cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()
126+
127+
cy.get(`[data-test="switcher-${'Developer Dog'.replace(/\s+/g, '-').toLowerCase()}`).as('StatusSwitcher')
128+
cy.get('@StatusSwitcher').click()
129+
cy.get('@StatusSwitcher').find('.MuiSwitch-input').first().should('be.checked')
130+
})
67131
})

apps/sensenet/package.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@sensenet/sn-app",
3-
"version": "1.18.0",
2+
"name": "@app/sensenet",
3+
"version": "1.19.0",
44
"main": "dist/index.js",
55
"files": [
66
"dist",
@@ -38,41 +38,41 @@
3838
]
3939
},
4040
"devDependencies": {
41-
"@cypress/code-coverage": "^3.9.2",
41+
"@cypress/code-coverage": "^3.9.3",
4242
"@relative-ci/agent": "^1.5.0",
4343
"@types/autosuggest-highlight": "^3.1.1",
44-
"@types/react": "^17.0.2",
45-
"@types/react-autosuggest": "^10.1.2",
46-
"@types/react-dom": "^17.0.1",
44+
"@types/react": "^17.0.3",
45+
"@types/react-autosuggest": "^10.1.3",
46+
"@types/react-dom": "^17.0.3",
4747
"@types/react-responsive": "^8.0.2",
48-
"@types/react-router": "^5.1.11",
48+
"@types/react-router": "^5.1.12",
4949
"@types/react-router-dom": "^5.1.7",
5050
"@types/react-virtualized": "^9.21.11",
5151
"@types/uuid": "^8.0.1",
5252
"clean-webpack-plugin": "^3.0.0",
5353
"compression-webpack-plugin": "7.1.2",
54-
"copy-webpack-plugin": "^7.0.0",
55-
"css-loader": "^5.0.2",
56-
"css-minimizer-webpack-plugin": "^1.2.0",
57-
"cypress": "^6.5.0",
58-
"cypress-file-upload": "^5.0.2",
54+
"copy-webpack-plugin": "^8.1.0",
55+
"css-loader": "^5.2.0",
56+
"css-minimizer-webpack-plugin": "^1.3.0",
57+
"cypress": "^6.8.0",
58+
"cypress-file-upload": "^5.0.3",
5959
"cypress-xpath": "^1.6.2",
6060
"file-loader": "^6.1.1",
61-
"fork-ts-checker-webpack-plugin": "^6.1.0",
62-
"html-webpack-plugin": "^5.2.0",
63-
"mini-css-extract-plugin": "^1.3.8",
64-
"monaco-editor-webpack-plugin": "^2.1.0",
61+
"fork-ts-checker-webpack-plugin": "^6.2.0",
62+
"html-webpack-plugin": "^5.3.1",
63+
"mini-css-extract-plugin": "^1.3.9",
64+
"monaco-editor-webpack-plugin": "^3.0.1",
6565
"nyc": "^15.1.0",
6666
"nyc-config-tsx": "^0.1.0",
6767
"react-router": "^5.2.0",
6868
"react-router-dom": "^5.2.0",
6969
"source-map-support": "^0.5.19",
7070
"style-loader": "^2.0.0",
7171
"terser-webpack-plugin": "^5.1.1",
72-
"ts-loader": "^8.0.17",
72+
"ts-loader": "^8.0.18",
7373
"ts-node": "^9.1.1",
7474
"url-loader": "^4.1.1",
75-
"webpack": "^5.24.1",
75+
"webpack": "^5.28.0",
7676
"webpack-bundle-analyzer": "^4.4.0",
7777
"webpack-cli": "^4.5.0",
7878
"webpack-dev-server": "^3.11.2",
@@ -82,27 +82,27 @@
8282
"@material-ui/core": "^4.11.3",
8383
"@material-ui/icons": "^4.11.2",
8484
"@material-ui/lab": "^4.0.0-alpha.57",
85-
"@sensenet/authentication-oidc-react": "^2.1.0",
86-
"@sensenet/client-core": "^3.9.0",
87-
"@sensenet/client-utils": "^2.0.2",
88-
"@sensenet/controls-react": "^7.0.0",
89-
"@sensenet/default-content-types": "^4.0.0",
90-
"@sensenet/document-viewer-react": "^4.0.2",
91-
"@sensenet/hooks-react": "^1.4.5",
92-
"@sensenet/list-controls-react": "^2.0.0",
93-
"@sensenet/pickers-react": "^2.0.2",
94-
"@sensenet/query": "^2.0.0",
95-
"@sensenet/repository-events": "^2.0.5",
85+
"@sensenet/authentication-oidc-react": "^2.2.0",
86+
"@sensenet/client-core": "^3.10.0",
87+
"@sensenet/client-utils": "^2.1.0",
88+
"@sensenet/controls-react": "^7.1.0",
89+
"@sensenet/default-content-types": "^4.1.0",
90+
"@sensenet/document-viewer-react": "^4.1.0",
91+
"@sensenet/hooks-react": "^1.5.0",
92+
"@sensenet/list-controls-react": "^2.1.0",
93+
"@sensenet/pickers-react": "^2.1.0",
94+
"@sensenet/query": "^2.1.0",
95+
"@sensenet/repository-events": "^2.1.0",
9696
"autosuggest-highlight": "^3.1.1",
9797
"clsx": "^1.1.1",
98-
"date-fns": "^2.17.0",
98+
"date-fns": "^2.19.0",
9999
"filesize": "^6.1.0",
100100
"react": "^16.13.0",
101101
"react-autosuggest": "^10.1.0",
102-
"react-day-picker": "^7.4.8",
102+
"react-day-picker": "^7.4.10",
103103
"react-dom": "^16.13.0",
104104
"react-markdown": "^5.0.3",
105-
"react-monaco-editor": "0.42.0",
105+
"react-monaco-editor": "0.43.0",
106106
"react-responsive": "^8.2.0",
107107
"react-virtualized": "^9.22.3",
108108
"semaphore-async-await": "^1.5.1",

0 commit comments

Comments
 (0)