@eeacms/volto-editing-progress 0.2.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ [ -n "$CI" ] && exit 0
2
+ yarn lint-staged
package/CHANGELOG.md CHANGED
@@ -4,6 +4,57 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [0.4.0](https://github.com/eea/volto-editing-progress/compare/0.3.0...0.4.0) - 19 February 2024
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: Improve editing progress, add propery option, remove property, change states - refs #262289 [dobri1408 - [`82c1ceb`](https://github.com/eea/volto-editing-progress/commit/82c1ceb2920b12e8eaf7225de944baad20382989)]
12
+
13
+ #### :house: Internal changes
14
+
15
+
16
+ #### :hammer_and_wrench: Others
17
+
18
+ - Release 0.4.0 [alin - [`13fc3ef`](https://github.com/eea/volto-editing-progress/commit/13fc3ef5bbeaeaa5f8086a9003e42b05bc06c30a)]
19
+ ### [0.3.0](https://github.com/eea/volto-editing-progress/compare/0.2.3...0.3.0) - 18 October 2023
20
+
21
+ #### :rocket: New Features
22
+
23
+ - feat: dynamically fetching states [Narcis2005 - [`57f2ef1`](https://github.com/eea/volto-editing-progress/commit/57f2ef1224609d374b0dd009d3d7956ddc106a10)]
24
+ - feat: changed dropdown labels [Narcis2005 - [`b62fd58`](https://github.com/eea/volto-editing-progress/commit/b62fd58133357f6849d5b7805b01d6316a4a605b)]
25
+ - feat: added sidebar search and fixed deleting bug [Narcis2005 - [`cc325e0`](https://github.com/eea/volto-editing-progress/commit/cc325e06d59f455a13b44199c5edd03b2ea51ce2)]
26
+ - feat: implement visual widget solved bug in auto-populating inputs [Narcis2005 - [`ed14af8`](https://github.com/eea/volto-editing-progress/commit/ed14af83d8ed042fcc2df7e8eeb40d4758c95999)]
27
+ - feat: implement visual widget checkpoint 2 [Narcis2005 - [`3e89f57`](https://github.com/eea/volto-editing-progress/commit/3e89f57c4c10e75b252c30038a9d81bc78d9f5f4)]
28
+ - feat: implement visual widget checkpoint 1 [Narcis2005 - [`682b3c0`](https://github.com/eea/volto-editing-progress/commit/682b3c0a8ff46edf6611edb0e1547a0758eb0dcb)]
29
+
30
+ #### :house: Internal changes
31
+
32
+ - chore: husky, lint-staged use fixed versions [valentinab25 - [`683ee28`](https://github.com/eea/volto-editing-progress/commit/683ee28cef19a185ba6ab681d184cf6386513d3d)]
33
+ - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`a7d9ffe`](https://github.com/eea/volto-editing-progress/commit/a7d9ffe0e43b7e2ad6108abd46b613f6760775c0)]
34
+ - chore: change volto version in Jenkinsfile [ana-oprea - [`4f33151`](https://github.com/eea/volto-editing-progress/commit/4f3315126d0d646555eff0f4224221080fbebab9)]
35
+ - chore: i18n update [Alin Voinea - [`37aca8c`](https://github.com/eea/volto-editing-progress/commit/37aca8c427e76082a3afe596ef27220e7adfe978)]
36
+ - style: Fix eslint, prettier [Alin Voinea - [`0f9fb23`](https://github.com/eea/volto-editing-progress/commit/0f9fb232de26e5e14e1e5c023b5f23185ccc7815)]
37
+ - style: lint-staged reorder in package.json [Alin Voinea - [`fa8b355`](https://github.com/eea/volto-editing-progress/commit/fa8b355ab801d0f5ef031766e3771484251d3d42)]
38
+ - style: Fix eslint, prettier [Alin Voinea - [`438aeed`](https://github.com/eea/volto-editing-progress/commit/438aeedb3053d3f4acc40eea2c24d77246bba704)]
39
+
40
+ #### :house: Documentation changes
41
+
42
+ - docs: Update README and DEVELOP [Alin Voinea - [`5ca39d5`](https://github.com/eea/volto-editing-progress/commit/5ca39d5c8245872287916717e788d5f1fa229d27)]
43
+ - docs: Update README and DEVELOP [Alin Voinea - [`a4a82eb`](https://github.com/eea/volto-editing-progress/commit/a4a82eb797d82dee5e80faff86db6c32dbc2ef52)]
44
+
45
+ #### :hammer_and_wrench: Others
46
+
47
+ - test: change e2e test [ana-oprea - [`dfccc68`](https://github.com/eea/volto-editing-progress/commit/dfccc68e17abe6c9dd15bbc70d31ce0273df2398)]
48
+ - test: change e2e test [ana-oprea - [`00066d5`](https://github.com/eea/volto-editing-progress/commit/00066d50dc3a2e42c31f50bde3c4ebbf285bf466)]
49
+ - test: change e2e test [ana-oprea - [`2a842ec`](https://github.com/eea/volto-editing-progress/commit/2a842ecadaa9d1b9d8bdbb3e9f11ff0d40187a6d)]
50
+ - test: change e2e test [ana-oprea - [`6d3fe3d`](https://github.com/eea/volto-editing-progress/commit/6d3fe3d3618b4863958144370642f9330e681da6)]
51
+ - test: increase cypress timeout [ana-oprea - [`6cee41d`](https://github.com/eea/volto-editing-progress/commit/6cee41d76648101ac7701f647911c3a717f42275)]
52
+ - test: Update failing snapshots [Alin Voinea - [`c1b022f`](https://github.com/eea/volto-editing-progress/commit/c1b022f39c9ff8ee1f6a9732eb2ba7f58b7e8492)]
53
+ - test: remade interface in accordion style and accommodated tests [Chirilov Narcis - [`2cc87f5`](https://github.com/eea/volto-editing-progress/commit/2cc87f5456cf9610be6c883877b4ec87e5613ede)]
54
+ - test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`59236c9`](https://github.com/eea/volto-editing-progress/commit/59236c9381b5d1f2059086d1f61823a1ec2309b0)]
55
+ - new feature [Narcis2005 - [`d981603`](https://github.com/eea/volto-editing-progress/commit/d981603df4204eab8a650df92521201a299ea75e)]
56
+ - more refactoring [Narcis2005 - [`28cfc60`](https://github.com/eea/volto-editing-progress/commit/28cfc6021b4ee328cecbef285b9ed2296891c7e9)]
57
+ - refactoring [Narcis2005 - [`8dc569c`](https://github.com/eea/volto-editing-progress/commit/8dc569cf2b21a7528a77ee55881b56c11a4ad3c6)]
7
58
  ### [0.2.3](https://github.com/eea/volto-editing-progress/compare/0.2.2...0.2.3) - 30 August 2023
8
59
 
9
60
  #### :house: Documentation changes
@@ -14,7 +65,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
14
65
  #### :hammer_and_wrench: Others
15
66
 
16
67
  - test: Fix package.json scripts to use makefile [Alin Voinea - [`0bd609b`](https://github.com/eea/volto-editing-progress/commit/0bd609b8007a86bd5908a2742048eb7a1580eb5e)]
17
- - test: Fix eslint and yarn i18n [Alin Voinea - [`ae98cf5`](https://github.com/eea/volto-editing-progress/commit/ae98cf564f2f509a22872b4c715c34d1d10e7e2c)]
18
68
  - i18n: Add en [Alin Voinea - [`401d698`](https://github.com/eea/volto-editing-progress/commit/401d69829f547362209afbecacb3842788e123f7)]
19
69
  - test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`5bef992`](https://github.com/eea/volto-editing-progress/commit/5bef9923d23f7131f49ec393ce1581dfb3a24d2a)]
20
70
  ### [0.2.2](https://github.com/eea/volto-editing-progress/compare/0.2.1...0.2.2) - 24 July 2023
@@ -39,7 +89,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
39
89
 
40
90
  #### :house: Internal changes
41
91
 
42
- - chore: [JENKINS] Remove alpha testing version [valentinab25 - [`e1331b0`](https://github.com/eea/volto-editing-progress/commit/e1331b0128e01b2dce90ca2ba74a168d23063896)]
43
92
 
44
93
  #### :hammer_and_wrench: Others
45
94
 
@@ -54,7 +103,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
54
103
  #### :hammer_and_wrench: Others
55
104
 
56
105
  - Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`ecaea55`](https://github.com/eea/volto-editing-progress/commit/ecaea55e1987fdcf4228075fa05414f71922ba0c)]
57
- - Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`3d7f5f4`](https://github.com/eea/volto-editing-progress/commit/3d7f5f42e4c2046a5cf25ffcfb6a7d846063eedf)]
58
106
  ### [0.1.5](https://github.com/eea/volto-editing-progress/compare/0.1.4...0.1.5) - 24 June 2021
59
107
 
60
108
  #### :hammer_and_wrench: Others
package/DEVELOP.md CHANGED
@@ -16,12 +16,14 @@
16
16
 
17
17
  1. Go to http://localhost:3000
18
18
 
19
- 1. Happy hacking!
19
+ 1. Initialize git hooks
20
20
 
21
21
  ```Bash
22
- cd src/addons/volto-editing-progress/
22
+ yarn prepare
23
23
  ```
24
24
 
25
+ 1. Happy hacking!
26
+
25
27
  ### Or add @eeacms/volto-editing-progress to your Volto project
26
28
 
27
29
  Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
@@ -48,18 +50,15 @@ Before starting make sure your development environment is properly set. See [Vol
48
50
 
49
51
  1. Install
50
52
 
51
- yarn develop
53
+ make develop
52
54
  yarn
53
55
 
54
56
  1. Start backend
55
57
 
56
- docker pull plone
57
- docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
58
+ docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend
58
59
 
59
60
  ...wait for backend to setup and start - `Ready to handle requests`:
60
61
 
61
- docker logs -f plone
62
-
63
62
  ...you can also check http://localhost:8080/Plone
64
63
 
65
64
  1. Start frontend
package/README.md CHANGED
@@ -26,26 +26,12 @@ Document Editing progress bar in Volto
26
26
 
27
27
  ### Try volto-editing-progress with Docker
28
28
 
29
- 1. Get the latest Docker images
29
+ git clone https://github.com/eea/volto-editing-progress.git
30
+ cd volto-editing-progress
31
+ make
32
+ make start
30
33
 
31
- ```
32
- docker pull plone
33
- docker pull plone/volto
34
- ```
35
-
36
- 1. Start Plone backend
37
-
38
- ```
39
- docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
40
- ```
41
-
42
- 1. Start Volto frontend
43
-
44
- ```
45
- docker run -it --rm -p 3000:3000 --link plone -e ADDONS="@eeacms/volto-editing-progress" plone/volto
46
- ```
47
-
48
- 1. Go to http://localhost:3000
34
+ Go to http://localhost:3000
49
35
 
50
36
  ### Add volto-editing-progress to your Volto project
51
37
 
@@ -57,25 +43,25 @@ Document Editing progress bar in Volto
57
43
 
58
44
  1. Start Volto frontend
59
45
 
60
- - If you already have a volto project, just update `package.json`:
46
+ * If you already have a volto project, just update `package.json`:
61
47
 
62
- ```JSON
63
- "addons": [
64
- "@eeacms/volto-editing-progress"
65
- ],
48
+ ```JSON
49
+ "addons": [
50
+ "@eeacms/volto-editing-progress"
51
+ ],
66
52
 
67
- "dependencies": {
68
- "@eeacms/volto-editing-progress": "^1.0.0"
69
- }
70
- ```
53
+ "dependencies": {
54
+ "@eeacms/volto-editing-progress": "*"
55
+ }
56
+ ```
71
57
 
72
- - If not, create one:
58
+ * If not, create one:
73
59
 
74
- ```
75
- npm install -g yo @plone/generator-volto
76
- yo @plone/volto my-volto-project --addon @eeacms/volto-editing-progress
77
- cd my-volto-project
78
- ```
60
+ ```
61
+ npm install -g yo @plone/generator-volto
62
+ yo @plone/volto my-volto-project --canary --addon @eeacms/volto-editing-progress
63
+ cd my-volto-project
64
+ ```
79
65
 
80
66
  1. Install new add-ons and restart Volto:
81
67
 
@@ -90,77 +76,7 @@ Document Editing progress bar in Volto
90
76
 
91
77
  ## Release
92
78
 
93
- ### Automatic release using Jenkins
94
-
95
- - The automatic release is started by creating a [Pull Request](../../compare/master...develop) from `develop` to `master`. The pull request status checks correlated to the branch and PR Jenkins jobs need to be processed successfully. 1 review from a github user with rights is mandatory.
96
- - It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
97
- - The automatic release is done by [Jenkins](https://ci.eionet.europa.eu). The status of the release job can be seen both in the Readme.md badges and the green check/red cross/yellow circle near the last commit information. If you click on the icon, you will have the list of checks that were run. The `continuous-integration/jenkins/branch` link goes to the Jenkins job execution webpage.
98
- - Automated release scripts are located in the `eeacms/gitflow` docker image, specifically [js-release.sh](https://github.com/eea/eea.docker.gitflow/blob/master/src/js-release.sh) script. It uses the `release-it` tool.
99
- - As long as a PR request is open from develop to master, the PR Jenkins job will automatically re-create the CHANGELOG.md and package.json files to be production-ready.
100
- - The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
101
- - You can manually change the version in `package.json`. The new version must not be already present in the tags/releases of the repository, otherwise it will be automatically increased by the script. Any changes to the version will trigger a `CHANGELOG.md` re-generation.
102
- - Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
103
-
104
- ### Manual release from the develop branch ( beta release )
105
-
106
- #### Installation and configuration of release-it
107
-
108
- You need to first install the [release-it](https://github.com/release-it/release-it) client.
109
-
110
- ```
111
- npm install -g release-it
112
- ```
113
-
114
- Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
115
-
116
- Release-it is a tool that automates 4 important steps in the release process:
117
-
118
- 1. Version increase in `package.json` ( increased from the current version in `package.json`)
119
- 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
120
- 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
121
- 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
122
-
123
- To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
124
-
125
- ```
126
- export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
127
- ```
128
-
129
- To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
130
-
131
- ```
132
- echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
133
- ```
134
-
135
- #### Using release-it tool
136
-
137
- There are 3 yarn scripts that can be run to do the release
138
-
139
- ##### yarn release-beta
140
-
141
- Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
142
-
143
- ```
144
- ? Select increment (next version):
145
- ❯ prepatch (0.1.1-beta.0)
146
- preminor (0.2.0-beta.0)
147
- premajor (1.0.0-beta.0)
148
- Other, please specify...
149
- ```
150
-
151
- ##### yarn release-major-beta
152
-
153
- Same as `yarn release-beta`, but with premajor version pre-selected.
154
-
155
- ##### yarn release
156
-
157
- Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
158
-
159
- #### Important notes
160
-
161
- > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
162
-
163
- > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
79
+ See [RELEASE.md](https://github.com/eea/volto-editing-progress/blob/master/RELEASE.md).
164
80
 
165
81
  ## How to contribute
166
82
 
package/RELEASE.md ADDED
@@ -0,0 +1,74 @@
1
+ ## Release
2
+
3
+ ### Automatic release using Jenkins
4
+
5
+ * The automatic release is started by creating a [Pull Request](../../compare/master...develop) from `develop` to `master`. The pull request status checks correlated to the branch and PR Jenkins jobs need to be processed successfully. 1 review from a github user with rights is mandatory.
6
+ * It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
7
+ * The automatic release is done by [Jenkins](https://ci.eionet.europa.eu). The status of the release job can be seen both in the Readme.md badges and the green check/red cross/yellow circle near the last commit information. If you click on the icon, you will have the list of checks that were run. The `continuous-integration/jenkins/branch` link goes to the Jenkins job execution webpage.
8
+ * Automated release scripts are located in the `eeacms/gitflow` docker image, specifically [js-release.sh](https://github.com/eea/eea.docker.gitflow/blob/master/src/js-release.sh) script. It uses the `release-it` tool.
9
+ * As long as a PR request is open from develop to master, the PR Jenkins job will automatically re-create the CHANGELOG.md and package.json files to be production-ready.
10
+ * The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
11
+ * You can manually change the version in `package.json`. The new version must not be already present in the tags/releases of the repository, otherwise it will be automatically increased by the script. Any changes to the version will trigger a `CHANGELOG.md` re-generation.
12
+ * Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
13
+
14
+ ### Manual release from the develop branch ( beta release )
15
+
16
+ #### Installation and configuration of release-it
17
+
18
+ You need to first install the [release-it](https://github.com/release-it/release-it) client.
19
+
20
+ ```
21
+ npm install -g release-it
22
+ ```
23
+
24
+ Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
25
+
26
+ Release-it is a tool that automates 4 important steps in the release process:
27
+
28
+ 1. Version increase in `package.json` ( increased from the current version in `package.json`)
29
+ 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
30
+ 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
31
+ 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
32
+
33
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
34
+
35
+ ```
36
+ export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
37
+ ```
38
+
39
+ To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
40
+
41
+ ```
42
+ echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
43
+ ```
44
+
45
+ #### Using release-it tool
46
+
47
+ There are 3 yarn scripts that can be run to do the release
48
+
49
+ ##### yarn release-beta
50
+
51
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
52
+
53
+ ```
54
+ ? Select increment (next version):
55
+ ❯ prepatch (0.1.1-beta.0)
56
+ preminor (0.2.0-beta.0)
57
+ premajor (1.0.0-beta.0)
58
+ Other, please specify...
59
+ ```
60
+
61
+ ##### yarn release-major-beta
62
+
63
+ Same as `yarn release-beta`, but with premajor version pre-selected.
64
+
65
+ ##### yarn release
66
+
67
+ Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
68
+
69
+ #### Important notes
70
+
71
+ > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
72
+
73
+ > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
74
+
package/cypress.config.js CHANGED
@@ -5,9 +5,9 @@ module.exports = defineConfig({
5
5
  defaultCommandTimeout: 8888,
6
6
  chromeWebSecurity: false,
7
7
  reporter: 'junit',
8
- video: true,
8
+ video: false,
9
9
  retries: {
10
- runMode: 8,
10
+ runMode: 2,
11
11
  openMode: 0,
12
12
  },
13
13
  reporterOptions: {
@@ -11,6 +11,16 @@ msgstr ""
11
11
  "Content-Transfer-Encoding: \n"
12
12
  "Plural-Forms: \n"
13
13
 
14
+ #: VisualJSONWidget
15
+ # defaultMessage: Edit JSON
16
+ msgid "Edit JSON"
17
+ msgstr ""
18
+
19
+ #: schema
20
+ # defaultMessage: JSON code
21
+ msgid "JSON code"
22
+ msgstr ""
23
+
14
24
  #: TextareaJSONWidget
15
25
  # defaultMessage: Please enter valid JSON!
16
26
  msgid "Please enter valid JSON!"
@@ -11,6 +11,16 @@ msgstr ""
11
11
  "Content-Transfer-Encoding: \n"
12
12
  "Plural-Forms: \n"
13
13
 
14
+ #: VisualJSONWidget
15
+ # defaultMessage: Edit JSON
16
+ msgid "Edit JSON"
17
+ msgstr ""
18
+
19
+ #: schema
20
+ # defaultMessage: JSON code
21
+ msgid "JSON code"
22
+ msgstr ""
23
+
14
24
  #: TextareaJSONWidget
15
25
  # defaultMessage: Please enter valid JSON!
16
26
  msgid "Please enter valid JSON!"
@@ -11,6 +11,16 @@ msgstr ""
11
11
  "Content-Transfer-Encoding: \n"
12
12
  "Plural-Forms: \n"
13
13
 
14
+ #: VisualJSONWidget
15
+ # defaultMessage: Edit JSON
16
+ msgid "Edit JSON"
17
+ msgstr ""
18
+
19
+ #: schema
20
+ # defaultMessage: JSON code
21
+ msgid "JSON code"
22
+ msgstr ""
23
+
14
24
  #: TextareaJSONWidget
15
25
  # defaultMessage: Please enter valid JSON!
16
26
  msgid "Please enter valid JSON!"
@@ -11,6 +11,16 @@ msgstr ""
11
11
  "Content-Transfer-Encoding: \n"
12
12
  "Plural-Forms: \n"
13
13
 
14
+ #: VisualJSONWidget
15
+ # defaultMessage: Edit JSON
16
+ msgid "Edit JSON"
17
+ msgstr ""
18
+
19
+ #: schema
20
+ # defaultMessage: JSON code
21
+ msgid "JSON code"
22
+ msgstr ""
23
+
14
24
  #: TextareaJSONWidget
15
25
  # defaultMessage: Please enter valid JSON!
16
26
  msgid "Please enter valid JSON!"
package/locales/volto.pot CHANGED
@@ -1,7 +1,7 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Plone\n"
4
- "POT-Creation-Date: 2023-08-29T17:51:21.719Z\n"
4
+ "POT-Creation-Date: 2023-09-14T13:45:52.728Z\n"
5
5
  "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
6
6
  "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
7
7
  "MIME-Version: 1.0\n"
@@ -13,6 +13,16 @@ msgstr ""
13
13
  "Preferred-Encodings: utf-8\n"
14
14
  "Domain: volto\n"
15
15
 
16
+ #: VisualJSONWidget
17
+ # defaultMessage: Edit JSON
18
+ msgid "Edit JSON"
19
+ msgstr ""
20
+
21
+ #: schema
22
+ # defaultMessage: JSON code
23
+ msgid "JSON code"
24
+ msgstr ""
25
+
16
26
  #: TextareaJSONWidget
17
27
  # defaultMessage: Please enter valid JSON!
18
28
  msgid "Please enter valid JSON!"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-editing-progress",
3
- "version": "0.2.3",
3
+ "version": "0.4.0",
4
4
  "description": "@eeacms/volto-editing-progress: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -25,8 +25,31 @@
25
25
  "devDependencies": {
26
26
  "@cypress/code-coverage": "^3.9.5",
27
27
  "babel-plugin-transform-class-properties": "^6.24.1",
28
+ "husky": "^8.0.3",
29
+ "lint-staged": "^14.0.1",
28
30
  "md5": "^2.3.0"
29
31
  },
32
+ "lint-staged": {
33
+ "src/**/*.{js,jsx,ts,tsx,json}": [
34
+ "make lint-fix",
35
+ "make prettier-fix"
36
+ ],
37
+ "src/**/*.{jsx}": [
38
+ "make i18n"
39
+ ],
40
+ "theme/**/*.{css,less}": [
41
+ "make stylelint-fix"
42
+ ],
43
+ "src/**/*.{css,less}": [
44
+ "make stylelint-fix"
45
+ ],
46
+ "theme/**/*.overrides": [
47
+ "make stylelint-fix"
48
+ ],
49
+ "src/**/*.overrides": [
50
+ "make stylelint-fix"
51
+ ]
52
+ },
30
53
  "scripts": {
31
54
  "release": "release-it",
32
55
  "release-major-beta": "release-it major --preRelease=beta",
@@ -44,6 +67,7 @@
44
67
  "lint:fix": "make lint-fix",
45
68
  "i18n": "make i18n",
46
69
  "cypress:run": "make cypress-run",
47
- "cypress:open": "make cypress-open"
70
+ "cypress:open": "make cypress-open",
71
+ "prepare": "husky install"
48
72
  }
49
73
  }
@@ -58,7 +58,6 @@ const EditingProgress = (props) => {
58
58
  dispatch(getEditingProgress(basePathname));
59
59
  }
60
60
  }, [dispatch, isAuth, basePathname, fetchCondition, contentContainsPathname]);
61
-
62
61
  return isAuth &&
63
62
  contentContainsPathname &&
64
63
  editingProgressSteps &&
@@ -87,7 +86,7 @@ const EditingProgress = (props) => {
87
86
  className={'sidenav-ol sidenav-ol--ep is-hidden'}
88
87
  ref={sideMenuRef}
89
88
  >
90
- {remaining_steps.map((step, index) => {
89
+ {remaining_steps.map((step) => {
91
90
  return (
92
91
  <li className={'ep-sidenav-li'} key={step['link_label']}>
93
92
  <a
@@ -27,7 +27,9 @@ function isValidJson(json) {
27
27
  }
28
28
 
29
29
  const TextAreaJSONWidget = (props) => {
30
- const { id, value = '', onChange, placeholder, isDisabled, intl } = props;
30
+ const { id, onChange, placeholder, isDisabled, intl } = props;
31
+ const value =
32
+ typeof props.value === 'string' ? JSON.parse(props.value) : props.value;
31
33
  const [invalidJSONError, setInvalidJSONError] = useState([]);
32
34
  const [prevValue, setPrevValue] = useState(value);
33
35
 
@@ -76,17 +78,19 @@ const TextAreaJSONWidget = (props) => {
76
78
  * @static
77
79
  */
78
80
  TextAreaJSONWidget.propTypes = {
79
- id: PropTypes.string.isRequired,
80
- title: PropTypes.string.isRequired,
81
- description: PropTypes.string,
82
- required: PropTypes.bool,
83
- error: PropTypes.arrayOf(PropTypes.string),
84
- value: PropTypes.object,
85
- onChange: PropTypes.func,
86
- onEdit: PropTypes.func,
87
- onDelete: PropTypes.func,
88
- wrapped: PropTypes.bool,
89
- placeholder: PropTypes.string,
81
+ widgetProps: PropTypes.shape({
82
+ id: PropTypes.string.isRequired,
83
+ title: PropTypes.string.isRequired,
84
+ description: PropTypes.string,
85
+ required: PropTypes.bool,
86
+ error: PropTypes.arrayOf(PropTypes.string),
87
+ value: PropTypes.object,
88
+ onChange: PropTypes.func,
89
+ onEdit: PropTypes.func,
90
+ onDelete: PropTypes.func,
91
+ wrapped: PropTypes.bool,
92
+ placeholder: PropTypes.string,
93
+ }),
90
94
  };
91
95
 
92
96
  /**
@@ -95,13 +99,15 @@ TextAreaJSONWidget.propTypes = {
95
99
  * @static
96
100
  */
97
101
  TextAreaJSONWidget.defaultProps = {
98
- description: null,
99
- required: false,
100
- error: [],
101
- value: null,
102
- onChange: null,
103
- onEdit: null,
104
- onDelete: null,
102
+ widgetProps: {
103
+ description: null,
104
+ required: false,
105
+ error: [],
106
+ value: null,
107
+ onChange: null,
108
+ onEdit: null,
109
+ onDelete: null,
110
+ },
105
111
  };
106
112
 
107
113
  export default injectIntl(TextAreaJSONWidget);