Skip to content

Commit

Permalink
Merge pull request #25 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Oct 12, 2023
2 parents e82a0f5 + 7dc0a7d commit e3192eb
Show file tree
Hide file tree
Showing 11 changed files with 414 additions and 38 deletions.
23 changes: 10 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ 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).

### [0.4.6](https://github.com/eea/volto-nextcloud-video-block/compare/0.4.5...0.4.6) - 12 October 2023

#### :house: Internal changes

- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`47453a0`](https://github.com/eea/volto-nextcloud-video-block/commit/47453a016eac882b84e4807ce16ca7048b2d4d19)]

#### :hammer_and_wrench: Others

- test: add e2e tests - refs #254313 [ana-oprea - [`813163a`](https://github.com/eea/volto-nextcloud-video-block/commit/813163a7d5b1f4fb865cc3364c9ffb4ab7236ca1)]
- test: add cypress test for nextcloud video block and fix error in DX Layout [Crețu Mihaela - [`15dccaf`](https://github.com/eea/volto-nextcloud-video-block/commit/15dccafce3c4ebefff2d75d592ad30b2c14c5f90)]
### [0.4.5](https://github.com/eea/volto-nextcloud-video-block/compare/0.4.4...0.4.5) - 29 September 2023

#### :house: Internal changes
Expand All @@ -16,12 +26,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`b3fe0a2`](https://github.com/eea/volto-nextcloud-video-block/commit/b3fe0a2cf89d9fd8e2f65c1b4206a1f9a5b8bb74)]
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`f768b7c`](https://github.com/eea/volto-nextcloud-video-block/commit/f768b7ccda394e8f260c95f3f1a71819ea4bba88)]
- test: Fix eslint and yarn i18n [Alin Voinea - [`7412fe7`](https://github.com/eea/volto-nextcloud-video-block/commit/7412fe7de8a8697f2bfd9dd1b0bf7ef8c949c88b)]
- i18n: Add en [Alin Voinea - [`9d01288`](https://github.com/eea/volto-nextcloud-video-block/commit/9d0128842887d397d8115fa075d27d8e66b4cbf5)]
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`2962d47`](https://github.com/eea/volto-nextcloud-video-block/commit/2962d476c1e82f59dd2698161ea953305a750538)]
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`31a4525`](https://github.com/eea/volto-nextcloud-video-block/commit/31a4525b41d98112ef036034f35990d58c86d367)]
### [0.4.4](https://github.com/eea/volto-nextcloud-video-block/compare/0.4.3...0.4.4) - 4 August 2023

#### :house: Documentation changes
Expand All @@ -38,7 +45,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`bb12e9d`](https://github.com/eea/volto-nextcloud-video-block/commit/bb12e9d24878cd347e35590a609ed7fc4140d195)]
- test: Fix issues identified by Sonarqube - refs #254220 [dana-cfc4 - [`c959a61`](https://github.com/eea/volto-nextcloud-video-block/commit/c959a61fe15781ee0a500c688ade813495107039)]
### [0.4.1](https://github.com/eea/volto-nextcloud-video-block/compare/0.4.0...0.4.1) - 16 June 2023

Expand Down Expand Up @@ -73,24 +79,15 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- test: Fix test config, coverage Refs #253277 [valentinab25 - [`983cc70`](https://github.com/eea/volto-nextcloud-video-block/commit/983cc701d747b05300c838f69c79242fda3349af)]
- clean up [Miu Razvan - [`5f7892a`](https://github.com/eea/volto-nextcloud-video-block/commit/5f7892aef352facb7f3552c6bf9f5219b1426c8f)]
- refactor code [tedw87 - [`372d579`](https://github.com/eea/volto-nextcloud-video-block/commit/372d57993276386befa998a237cef5910d30a32f)]
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`03dd210`](https://github.com/eea/volto-nextcloud-video-block/commit/03dd210b6e7f2d997bd8f80e76294797953f71e5)]
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`1c80e48`](https://github.com/eea/volto-nextcloud-video-block/commit/1c80e48e0605cc33ce3c4f047031bb59777c3522)]
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`9b396fb`](https://github.com/eea/volto-nextcloud-video-block/commit/9b396fbd8a57052a0406c442c0a460c940bae40d)]
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`c857e0a`](https://github.com/eea/volto-nextcloud-video-block/commit/c857e0a19ddd101ed1953582591b7cd53b269111)]
### [0.3.1](https://github.com/eea/volto-nextcloud-video-block/compare/0.3.0...0.3.1) - 29 March 2023

#### :hammer_and_wrench: Others

- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`651eb88`](https://github.com/eea/volto-nextcloud-video-block/commit/651eb88fb27cf0e51c0b75aa5ab082b3fbda0f90)]
### [0.3.0](https://github.com/eea/volto-nextcloud-video-block/compare/0.2.0...0.3.0) - 15 March 2023

#### :hammer_and_wrench: Others

- Release 0.3.0 [Alin Voinea - [`6dfd307`](https://github.com/eea/volto-nextcloud-video-block/commit/6dfd307b49edcc6ac9aa32fe8d89527c75a0e31c)]
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`240b696`](https://github.com/eea/volto-nextcloud-video-block/commit/240b696ce279dcfd68b44cb6918776b3fa97147a)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`0f94a58`](https://github.com/eea/volto-nextcloud-video-block/commit/0f94a58ea918675b2a775eebd8a4fa1b4fcdbb62)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`a720438`](https://github.com/eea/volto-nextcloud-video-block/commit/a7204382b8a891d172a3086142319af3771acd49)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`002119c`](https://github.com/eea/volto-nextcloud-video-block/commit/002119cf10ce0a56cec89187659a976571a5936e)]
### [0.2.0](https://github.com/eea/volto-nextcloud-video-block/compare/0.1.0...0.2.0) - 1 March 2023

#### :rocket: New Features
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pipeline {
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,demo-www.eea.europa.eu,www.eea.europa.eu-en,climate-advisory-board.europa.eu,clmsdemo.devel6cph.eea.europa.eu,climate-adapt.eea.europa.eu,biodiversity.europa.eu,water.europa.eu-marine,industry.eea.europa.eu,climate-energy.eea.europa.eu,water.europa.eu-freshwater,forest.eea.europa.eu"
DEPENDENCIES = ""
VOLTO = ""
VOLTO = "16"
}

stages {
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ stylelint: ## Stylelint

.PHONY: stylelint-overrides
stylelint-overrides:
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'
$(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'

.PHONY: stylelint-fix
stylelint-fix: ## Fix stylelint
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix
$(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix

.PHONY: prettier
prettier: ## Prettier
Expand Down
28 changes: 14 additions & 14 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,55 +20,55 @@ You need to first install the [release-it](https://github.com/release-it/release
```
npm install -g release-it
```

Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.

Release-it is a tool that automates 4 important steps in the release process:

1. Version increase in `package.json` ( increased from the current version in `package.json`)
2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
3. GitHub release on the commit with the changelog and package.json modification on the develop branch
4. NPM release ( by default it's disabled, but can be enabled in the configuration file )

To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)

```
export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
```

To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :

```
echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
```

#### Using release-it tool

There are 3 yarn scripts that can be run to do the release

##### yarn release-beta

Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).

```
? Select increment (next version):
❯ prepatch (0.1.1-beta.0)
preminor (0.2.0-beta.0)
premajor (1.0.0-beta.0)
Other, please specify...
? Select increment (next version):
❯ prepatch (0.1.1-beta.0)
preminor (0.2.0-beta.0)
premajor (1.0.0-beta.0)
Other, please specify...
```

##### yarn release-major-beta

Same as `yarn release-beta`, but with premajor version pre-selected.

##### yarn release

Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.

#### Important notes

> 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.
> 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.
> 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).
13 changes: 8 additions & 5 deletions cypress/e2e/01-nextcloud-block-basics.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ describe('Blocks Tests', () => {

// Check if error message is not displayed
cy.get('.ui.error.message').should('not.exist');

// Add youtube video link and check if it is valid
cy.get('.block.video .toolbar-inner .ui.input').type(
'https://www.youtube.com/',
'https://www.youtube.com/{esc}',
);

// Add youtube video link and check if it is valid
cy.get('.block.video .toolbar-inner .ui.input')
.click()
.type('https://www.youtube.com/');
cy.get('.block.video .toolbar-inner .ui.buttons .ui.basic.primary').click();
cy.get('.ui.error.message').should('exist');

Expand All @@ -39,10 +42,10 @@ describe('Blocks Tests', () => {

// Add cmshare video link and check if it is valid
cy.get('.block.video .toolbar-inner .ui.input').type(
'https://cmshare.eea.europa.eu/',
'https://cmshare.eea.europa.eu/{enter}',
);
cy.get('.block.video .toolbar-inner .ui.buttons .ui.basic.primary').click();
cy.get('.ui.error.message').should('not.exist');
cy.get('#blockform-fieldset-default #field-title').type('test cmshare');

// Wait for cmshare request
cy.wait('@cmshare');
Expand Down
76 changes: 76 additions & 0 deletions cypress/e2e/02-dexterity-controlpanel-layout.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { slateLayoutBeforeEach, slateLayoutAfterEach } from '../support/e2e';

describe('ControlPanel: Dexterity Content-Types Layout', () => {
beforeEach(slateLayoutBeforeEach);
afterEach(slateLayoutAfterEach);

it('Edit Blocks Layout for Book', () => {
cy.visit('/controlpanel/dexterity-types');
cy.waitForResourceToLoad('@navigation');
cy.waitForResourceToLoad('@breadcrumbs');
cy.waitForResourceToLoad('@actions');
cy.waitForResourceToLoad('@types');

cy.get('a[href="/controlpanel/dexterity-types/book"]').should(
'have.text',
'book',
);

cy.visit('/controlpanel/dexterity-types/book/layout');
cy.get('#page-controlpanel-layout').contains(
'Can not edit Layout for book',
);
cy.get('#page-controlpanel-layout button').click();

// Wait a bit for draftjs to load, without this the title block
// custom placeholder is missing and cypress gives a timeout error
cy.wait(1000);
cy.get('input[id="field-placeholder"]').type('Book title');
cy.get('label[for="field-required"]').click();
cy.get('label[for="field-fixed"]').click();

cy.getSlate().click();

cy.get('.ui.basic.icon.button.block-add-button:visible').click();
cy.get('.blocks-chooser .title').contains('Media').click();
cy.get('.content.active.media .button.nextCloudVideo')
.contains('Video (NextCloud)')
.click({ force: true });

cy.get('#toolbar-save').click();

cy.visit('/cypress');
cy.waitForResourceToLoad('@navigation');
cy.waitForResourceToLoad('@breadcrumbs');
cy.waitForResourceToLoad('@actions');
cy.waitForResourceToLoad('@types');

// Intercept cmshare request
cy.intercept('GET', 'https://cmshare.eea.europa.eu//download').as(
'cmshare',
);

cy.get('button[class="add"]').click();
cy.get('#toolbar-add-book').click();
cy.get('.block.title').contains('Book title');

// Change book title
cy.clearSlateTitle();
cy.getSlateTitle().type('My First Book');
cy.get('.documentFirstHeading').contains('My First Book');

// Add video
cy.get('.block.video .toolbar-inner .ui.input').type(
'https://cmshare.eea.europa.eu/',
);
cy.get('.block.video .toolbar-inner .ui.buttons .ui.basic.primary').click();
cy.get('.ui.error.message').should('not.exist');

// Wait for cmshare request
cy.wait('@cmshare');

cy.get('#toolbar-save').click();
cy.get('.documentFirstHeading').contains('My First Book');
cy.get('.block.video').should('exist');
});
});
16 changes: 16 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ export const slateJsonAfterEach = (contentType = 'slate') => {
slateAfterEach();
};

export const slateLayoutBeforeEach = (contentType = 'book') => {
cy.autologin();
cy.addContentType(contentType);
cy.createContent({
contentType: 'Document',
contentId: 'cypress',
contentTitle: 'Cypress',
});
};

export const slateLayoutAfterEach = (contentType = 'book') => {
cy.autologin();
cy.removeContentType(contentType);
cy.removeContent('cypress');
};

export const getSelectedSlateEditor = () => {
return cy.get('.slate-editor.selected [contenteditable=true]').click();
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-nextcloud-video-block",
"version": "0.4.5",
"version": "0.4.6",
"description": "@eeacms/volto-nextcloud-video-block: Volto add-on to embed Videos from NextCloud",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
Loading

0 comments on commit e3192eb

Please sign in to comment.