Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
Merge pull request #157 from eea/develop
Browse files Browse the repository at this point in the history
Release 4.0.0
  • Loading branch information
avoinea committed Sep 24, 2021
2 parents 70f4ad6 + cc67339 commit 851b771
Show file tree
Hide file tree
Showing 29 changed files with 446 additions and 328 deletions.
File renamed without changes.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,24 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [4.0.0](https://github.com/eea/volto-slate/compare/4.0.0-alpha.0...4.0.0)

- Namespace the plugins, otherwise there's problems with richtext fields [`#156`](https://github.com/eea/volto-slate/pull/156)
- Fix tableButton profile to enable/disable only table button [`20887a7`](https://github.com/eea/volto-slate/commit/20887a707e793e97054863ea1429c1ca7f862e14)

#### [4.0.0-alpha.0](https://github.com/eea/volto-slate/compare/3.1.1...4.0.0-alpha.0)

> 21 September 2021
- Include asDefaultRichText within asDefault profile. Re-enable cypress [`af2ee82`](https://github.com/eea/volto-slate/commit/af2ee82a95f234c5a82c731ad5d4b9ffc047a028)
- Release 4.0.0 - Upgrade steps [`1980cad`](https://github.com/eea/volto-slate/commit/1980cad492fb466faecc29ca8823e7a60ed65693)
- Namespace the plugins, otherwise there's problems with richtext fields [`e7d4b3b`](https://github.com/eea/volto-slate/commit/e7d4b3bc8fd58fbb389e17a28558629f06bfed1d)

#### [3.1.1](https://github.com/eea/volto-slate/compare/3.1.0...3.1.1)

> 20 September 2021
- Release [`#154`](https://github.com/eea/volto-slate/pull/154)
- EN/DE translations [`#155`](https://github.com/eea/volto-slate/pull/155)
- Fix table interaction [`#153`](https://github.com/eea/volto-slate/pull/153)
- Update tests snapshots [`4fed203`](https://github.com/eea/volto-slate/commit/4fed2037a74bc10d2d962b2b8821811eb72801e1)
Expand Down
154 changes: 77 additions & 77 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,83 +76,83 @@ pipeline {
}
}

// stage('Integration tests') {
// // Exclude Pull-Requests. Already running on branch
// when {
// allOf {
// environment name: 'CHANGE_ID', value: ''
// }
// }
// steps {
// parallel(

// "Cypress": {
// node(label: 'docker') {
// script {
// try {
// sh '''docker pull plone; docker run -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e ADDONS="$PLONE_ADDONS" -e VERSIONS="$PLONE_VERSIONS" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
// sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" plone/volto-addon-ci cypress'''
// } finally {
// try {
// sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
// sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
// coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
// if ( coverage == 0 ) {
// publishHTML (target : [allowMissing: false,
// alwaysLinkToLastBuild: true,
// keepAll: true,
// reportDir: 'cypress-coverage/coverage/lcov-report',
// reportFiles: 'index.html',
// reportName: 'CypressCoverage',
// reportTitles: 'Integration Tests Code Coverage'])
// }
// archiveArtifacts artifacts: 'cypress-reports/videos/*.mp4', fingerprint: true
// stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
// }
// finally {
// catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
// junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
// }
// sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
// sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
// sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true

// }
// }
// }
// }
// }

// )
// }
// }

// stage('Report to SonarQube') {
// // Exclude Pull-Requests
// when {
// allOf {
// environment name: 'CHANGE_ID', value: ''
// }
// }
// steps {
// node(label: 'swarm') {
// script{
// checkout scm
// unstash "xunit-reports"
// unstash "cypress-coverage"
// def scannerHome = tool 'SonarQubeScanner';
// def nodeJS = tool 'NodeJS11';
// withSonarQubeEnv('Sonarqube') {
// sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
// sh "export PATH=$PATH:${scannerHome}/bin:${nodeJS}/bin; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
// sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
// }
// }
// }
// }
// }
stage('Integration tests') {
// Exclude Pull-Requests. Already running on branch
when {
allOf {
environment name: 'CHANGE_ID', value: ''
}
}
steps {
parallel(

"Cypress": {
node(label: 'docker') {
script {
try {
sh '''docker pull plone; docker run -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e ADDONS="$PLONE_ADDONS" -e VERSIONS="$PLONE_VERSIONS" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" plone/volto-addon-ci cypress'''
} finally {
try {
sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
if ( coverage == 0 ) {
publishHTML (target : [allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'cypress-coverage/coverage/lcov-report',
reportFiles: 'index.html',
reportName: 'CypressCoverage',
reportTitles: 'Integration Tests Code Coverage'])
}
archiveArtifacts artifacts: 'cypress-reports/videos/*.mp4', fingerprint: true
stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
}
finally {
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
}
sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true

}
}
}
}
}

)
}
}

stage('Report to SonarQube') {
// Exclude Pull-Requests
when {
allOf {
environment name: 'CHANGE_ID', value: ''
}
}
steps {
node(label: 'swarm') {
script{
checkout scm
unstash "xunit-reports"
unstash "cypress-coverage"
def scannerHome = tool 'SonarQubeScanner';
def nodeJS = tool 'NodeJS11';
withSonarQubeEnv('Sonarqube') {
sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
sh "export PATH=$PATH:${scannerHome}/bin:${nodeJS}/bin; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
}
}
}
}
}

stage('Pull Request') {
when {
Expand Down
40 changes: 24 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,6 @@ issues, the API starts to stabilize and we've already started several addons
based on it: https://github.com/eea/volto-slate-metadata-mentions/ and
https://github.com/eea/volto-slate-zotero

## Upgrades

### Upgrade to 3.x.x

* Removed all deprecated, already in Volto Core, `futurevolto` components:
* `SidebarPopup`
* `ObjectWidget`
* `ObjectBrowserWidget`
* `helpers/Blocks`
* Table `inline button` and `copy&paste` support is not installed by default anymore.
You'll need to explicitly import the `tableButton` profile like:
* `volto:asDefault,tableButton`
* `volto-slate:minimalDefault,simpleLink,tableButton`

## Why

Some of the main reasons that drove us to create volto-slate instead of
Expand All @@ -56,13 +42,35 @@ enhancing Volto's draftjs implementation:
final rendered output is very clean. Note: The Slate editor value is a JSON
object, similar to the Draftjs based implementation.

## Upgrades

### Upgrade to 4.x.x

* Namespace the plugins [#156](https://github.com/eea/volto-slate/pull/156):
* Make sure you upgrade your slate plugins to use the new slate namespaced plugin ids.
See for example `volto-slate-footnote` [#23](https://github.com/eea/volto-slate-footnote/pull/23/commits/efdc07041097a6edf608b377141fba15fbee65cf)
* `asDefault` profile makes the volto-slate as the default Editor for `blocks` and `richtext`.
* If you're not ready for this, yet, switch to `volto-slate:asDefaultBlock`

### Upgrade to 3.x.x

* Removed all deprecated, already in Volto Core, `futurevolto` components:
* `SidebarPopup`
* `ObjectWidget`
* `ObjectBrowserWidget`
* `helpers/Blocks`
* Table `inline button` and `copy&paste` support is not installed by default anymore.
You'll need to explicitly import the `tableButton` profile like:
* `volto:asDefault,tableButton`
* `volto-slate:minimalDefault,simpleLink,tableButton`

## Available profiles.

volto-slate provides several optional configuration:

- `asDefault` - makes the volto-slate as the default Editor for `blocks` (and `richtext` widgets - not yet)
- `asDefault` - makes the volto-slate as the default Editor for `blocks` and `richtext`
- `asDefaultBlock` - makes volto-slate the default Editor for `blocks`
- `asDefaultRichText` - makes volto-slate the default Editor for `richtext` widget (experimental)
- `asDefaultRichText` - makes volto-slate the default Editor for `richtext` widget
- `minimalDefault`, same as the above, but uses a set of toolbar buttons similar to Volto
- `simpleLink` reuses Volto's link plugin and makes for a better replacement of Volto's rich text editor.
- `tableButton` adds table button to Slate toolbar in order to easily insert Table block after.
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/05-block-slate-format-basics.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('Block Tests: Basic text format', () => {
cy.toolbarSave();

// then the page view should contain our changes
cy.get('[id="page-document"] s').contains('Colorless');
cy.get('[id="page-document"] del').contains('Colorless');
});

it('Title', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('Metadata Slate JSON Tests: Basic text format', () => {
cy.toolbarSave();

// then the page view should contain our changes
cy.get('[id="page-document"] s').contains('Colorless');
cy.get('[id="page-document"] del').contains('Colorless');
});

it('Title', function () {
Expand Down
Loading

0 comments on commit 851b771

Please sign in to comment.