diff --git a/.circleci/config.yml b/.circleci/config.yml index b84cf178..9f917c56 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,17 +1,42 @@ +aliases: + - &docker_auth + auth: + username: ${DOCKER_USER} + password: ${DOCKER_PASS} + + - &default-context + context: + - shared-creds + defaults: &defaults docker: - - image: opuscapita/minsk-core-ci:grails-2.4.4-jdk-8u192-nodejs-8.17.0-maven-3.3.9 + - image: opuscapita/minsk-core-ci:4 + <<: *docker_auth working_directory: ~/build version: 2.1 + +orbs: + jira: circleci/jira@2.0 + jobs: + init: + docker: + - image: opuscapita/minsk-core-machineuser-env:2 + <<: *docker_auth + steps: + - run: generate_bash_env_exports.sh GH_MAIL GH_NAME CIRCLE_CI_TOKEN > ~/generated_bash_env + - persist_to_workspace: + root: ~/ + paths: + - generated_bash_env + update-gh-pages: <<: *defaults steps: - - run: - name: Environment inject - command: /bin/env_inject.sh - + - attach_workspace: + at: /workspace + - run: cat /workspace/generated_bash_env >> $BASH_ENV - checkout - restore_cache: keys: @@ -19,6 +44,8 @@ jobs: - react-showroom-{{ .Branch }} - react-showroom + - run: if [ -f /.dockerenv ]; then configure-maven.sh && configure-grails.sh && configure-npm.sh; fi + - run: name: "Installing dependencies." command: npm install @@ -38,15 +65,16 @@ jobs: build: <<: *defaults steps: - - run: - name: Environment inject - command: /bin/env_inject.sh + - attach_workspace: + at: /workspace + - run: cat /workspace/generated_bash_env >> $BASH_ENV - checkout - restore_cache: keys: - react-showroom-{{ .Branch }}-{{ checksum "package.json" }} - react-showroom-{{ .Branch }} - react-showroom + - run: if [ -f /.dockerenv ]; then configure-maven.sh && configure-grails.sh && configure-npm.sh; fi - run: npm install - save_cache: key: react-showroom-{{ .Branch }}-{{ checksum "package.json" }} @@ -65,12 +93,26 @@ workflows: version: 2.1 release-and-build: jobs: + - init: + <<: *default-context + filters: + tags: + only: /.*/ - build: + <<: *default-context filters: tags: only: /.*/ branches: only: /.*/ + requires: + - init + post-steps: + - jira/notify: + pipeline_id: << pipeline.id >> + pipeline_number: << pipeline.number >> + - update-gh-pages: + <<: *default-context requires: - build diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ef317db..9a4e1091 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,23 @@ +[Release 0.5.16](https://github.com/OpusCapita/react-dates/releases/tag/v0.5.16) Thu Jun 24 2021 15:03:39 GMT+0300 (MSK) +======================================================= + +- (EPROC-20549) Make translation keys unique ([#77](https://github.com/OpusCapita/react-dates/issues/77)) (GitHub dsanko-sc@users.noreply.github.com, 2021-06-24 12:52:56 +0300) + +[Release 0.5.16-EPROC-20549-SNAPSHOT](https://github.com/OpusCapita/react-dates/releases/tag/v0.5.16-EPROC-20549-SNAPSHOT) Thu Jun 10 2021 10:30:28 GMT+0300 (MSK) +======================================================= + +- Make translation keys unique (Dmitriy Sanko dmitriy.sanko@opuscapita.com, 2021-06-10 10:19:00 +0300) + +[Release 0.5.15](https://github.com/OpusCapita/react-dates/releases/tag/v0.5.15) Fri Apr 30 2021 08:58:08 GMT+0300 (MSK) +======================================================= + +- Added Spanish to available languages ([#75](https://github.com/OpusCapita/react-dates/issues/75)) (GitHub santiago_vital@outlook.com, 2021-04-30 00:56:43 -0500) +- (EPROC-20383) Used jdk zulu (GitHub ashestak-sc@users.noreply.github.com, 2021-04-06 16:28:54 +0300) +- (EPROC-20383) Used jdk zulu (GitHub ashestak-sc@users.noreply.github.com, 2021-04-06 13:09:04 +0300) +- (EPROC-20252) Added circleci builds jira integration (GitHub ashestak-sc@users.noreply.github.com, 2021-03-10 16:02:04 +0300) +- Update CI image to opuscapita/minsk-core-ci:grails-2.4.4-jdk-8u192-nodejs-8.17.0-maven-3.3.9 [ci skip] (Egor Stambakio egor.stambakio@opuscapita.com, 2020-05-07 16:14:10 +0300) + [Release 0.5.14](https://github.com/OpusCapita/react-dates/releases/tag/v0.5.14) Mon Apr 20 2020 09:34:48 GMT+0300 (MSK) ======================================================= diff --git a/external_modules/jcatalog-bootstrap/package.json b/external_modules/jcatalog-bootstrap/package.json index 025f2c29..2b19e652 100644 --- a/external_modules/jcatalog-bootstrap/package.json +++ b/external_modules/jcatalog-bootstrap/package.json @@ -1,6 +1,6 @@ { "name": "jcatalog-bootstrap", - "version": "0.5.15-SNAPSHOT", + "version": "0.5.17", "description": "Bootstrap npm module customized for jCatalog.", "main": "dist/js/bootstrap.min.js", "files": [ diff --git a/package.json b/package.json index 8e9d171e..1813d723 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@opuscapita/react-dates", - "version": "0.5.15-SNAPSHOT", + "version": "0.5.17", "description": "Start write new project with no effort.", "keywords": [ "react", diff --git a/src/client/components/DateInput/DateInput.react.js b/src/client/components/DateInput/DateInput.react.js index cfb79a37..9fdf89ea 100644 --- a/src/client/components/DateInput/DateInput.react.js +++ b/src/client/components/DateInput/DateInput.react.js @@ -51,15 +51,15 @@ let defaultProps = { value: null, variants: [ { - getLabel: (locale) => getMessage(locale, 'yesterday'), + getLabel: (locale) => getMessage(locale, 'common.DateInput.yesterday'), getValue: (locale) => dayjs().locale(locale).subtract(1, 'days').toDate() }, { - getLabel: (locale) => getMessage(locale, 'today'), + getLabel: (locale) => getMessage(locale, 'common.DateInput.today'), getValue: (locale) => dayjs().locale(locale).toDate() }, { - getLabel: (locale) => getMessage(locale, 'tomorrow'), + getLabel: (locale) => getMessage(locale, 'common.DateInput.tomorrow'), getValue: (locale) => dayjs().locale(locale).add(1, 'days').toDate() } ] @@ -290,7 +290,7 @@ ${showToTopClassName} ${showToLeftClassName} tabIndex="-1" onClick={this.handleReset} disabled={disabled} - title={getMessage(locale, 'clearValue')} + title={getMessage(locale, 'common.DateInput.clearValue')} > ✕ diff --git a/src/client/components/DateRangeInput/DateRangeInput.react.js b/src/client/components/DateRangeInput/DateRangeInput.react.js index 677cf1eb..627ecc23 100644 --- a/src/client/components/DateRangeInput/DateRangeInput.react.js +++ b/src/client/components/DateRangeInput/DateRangeInput.react.js @@ -65,7 +65,7 @@ let defaultProps = { value: [null, null], variants: [ { - getLabel: (locale) => getMessage(locale, 'previousWeek'), + getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.previousWeek'), // TODO remove ternary operator below. Monitor this issue: https://github.com/iamkun/dayjs/issues/215 getValue: (locale) => locale === 'en' ? [ dayjs().locale(locale).subtract(7, 'days').startOf('week').toDate(), @@ -76,7 +76,7 @@ let defaultProps = { ] }, { - getLabel: (locale) => getMessage(locale, 'thisWeek'), + getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.thisWeek'), // TODO remove ternary operator below. Monitor this issue: https://github.com/iamkun/dayjs/issues/215 getValue: (locale) => locale === 'en' ? [ dayjs().locale(locale).startOf('week').toDate(), @@ -87,7 +87,7 @@ let defaultProps = { ] }, { - getLabel: (locale) => getMessage(locale, 'nextWeek'), + getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.nextWeek'), // TODO remove ternary operator below. Monitor this issue: https://github.com/iamkun/dayjs/issues/215 getValue: (locale) => locale === 'en' ? [ dayjs().locale(locale).add(7, 'days').startOf('week').toDate(), @@ -98,28 +98,28 @@ let defaultProps = { ] }, { - getLabel: (locale) => getMessage(locale, 'previousMonth'), + getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.previousMonth'), getValue: (locale) => [ dayjs().locale(locale).subtract(1, 'month').startOf('month').toDate(), dayjs().locale(locale).subtract(1, 'month').endOf('month').toDate() ] }, { - getLabel: (locale) => getMessage(locale, 'last30Days'), + getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.last30Days'), getValue: (locale) => [ dayjs().locale(locale).subtract(30, 'days').toDate(), dayjs().locale(locale).toDate() ] }, { - getLabel: (locale) => getMessage(locale, 'thisMonth'), + getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.thisMonth'), getValue: (locale) => [ dayjs().locale(locale).startOf('month').toDate(), dayjs().locale(locale).endOf('month').toDate() ] }, { - getLabel: (locale) => getMessage(locale, 'nextMonth'), + getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.nextMonth'), getValue: (locale) => [ dayjs().locale(locale).add(1, 'month').startOf('month').toDate(), dayjs().locale(locale).add(1, 'month').endOf('month').toDate() @@ -443,7 +443,7 @@ class DateRangeInput extends Component { tabIndex="-1" onClick={this.handleReset} disabled={disabled} - title={getMessage(locale, 'clearValue')} + title={getMessage(locale, 'common.DateInput.clearValue')} > ✕ diff --git a/src/client/components/DayPicker/DayPicker.react.js b/src/client/components/DayPicker/DayPicker.react.js index fdf1e87f..306f5cba 100644 --- a/src/client/components/DayPicker/DayPicker.react.js +++ b/src/client/components/DayPicker/DayPicker.react.js @@ -23,7 +23,7 @@ let propTypes = { let defaultProps = { className: '', dayPickerRef: () => {}, - getTodayButtonLabel: (locale) => getMessage(locale, 'today'), + getTodayButtonLabel: (locale) => getMessage(locale, 'common.DateInput.today'), hideTodayButton: false, isRange: false, labels: ReactDayPicker.defaultProps.labels, diff --git a/src/client/components/translations.js b/src/client/components/translations.js index ee238e1e..d7a98143 100644 --- a/src/client/components/translations.js +++ b/src/client/components/translations.js @@ -1,87 +1,81 @@ const translations = { en: { - selectDateRange: 'Select date range', - today: 'Today', - yesterday: 'Yesterday', - tomorrow: 'Tomorrow', - previousWeek: 'Previous week', - nextWeek: 'Next week', - thisWeek: 'This week', - previousMonth: 'Previous month', - last30Days: 'Last 30 days', - thisMonth: 'This month', - nextMonth: 'Next month', - clearValue: 'Clear value' + 'common.DateInput.today': 'Today', + 'common.DateInput.yesterday': 'Yesterday', + 'common.DateInput.tomorrow': 'Tomorrow', + 'common.DateRangeInput.previousWeek': 'Previous week', + 'common.DateRangeInput.nextWeek': 'Next week', + 'common.DateRangeInput.thisWeek': 'This week', + 'common.DateRangeInput.previousMonth': 'Previous month', + 'common.DateRangeInput.last30Days': 'Last 30 days', + 'common.DateRangeInput.thisMonth': 'This month', + 'common.DateRangeInput.nextMonth': 'Next month', + 'common.DateInput.clearValue': 'Clear value' }, de: { - selectDateRange: 'Datumsbereich auswählen', - today: 'Heute', - yesterday: 'Gestern', - tomorrow: 'Morgen', - previousWeek: 'Vorherige Woche', - nextWeek: 'Nächste Woche', - thisWeek: 'Diese Woche', - previousMonth: 'Vorheriger Monat', - last30Days: 'Letzte 30 Tagen', - thisMonth: 'Dieser Monat', - nextMonth: 'Nächster Monat', - clearValue: 'Inhalt löschen' + 'common.DateInput.today': 'Heute', + 'common.DateInput.yesterday': 'Gestern', + 'common.DateInput.tomorrow': 'Morgen', + 'common.DateRangeInput.previousWeek': 'Vorherige Woche', + 'common.DateRangeInput.nextWeek': 'Nächste Woche', + 'common.DateRangeInput.thisWeek': 'Diese Woche', + 'common.DateRangeInput.previousMonth': 'Vorheriger Monat', + 'common.DateRangeInput.last30Days': 'Letzte 30 Tagen', + 'common.DateRangeInput.thisMonth': 'Dieser Monat', + 'common.DateRangeInput.nextMonth': 'Nächster Monat', + 'common.DateInput.clearValue': 'Inhalt löschen' }, ru: { - selectDateRange: 'Выберите диапазон дат', - today: 'Сегодня', - yesterday: 'Вчера', - tomorrow: 'Завтра', - previousWeek: 'Предыдущая неделя', - nextWeek: 'Следующая неделя', - thisWeek: 'Эта неделя', - previousMonth: 'Предыдущий месяц', - last30Days: 'Последние 30 дней', - thisMonth: 'Этот месяц', - nextMonth: 'Следующий месяц', - clearValue: '' + 'common.DateInput.today': 'Сегодня', + 'common.DateInput.yesterday': 'Вчера', + 'common.DateInput.tomorrow': 'Завтра', + 'common.DateRangeInput.previousWeek': 'Предыдущая неделя', + 'common.DateRangeInput.nextWeek': 'Следующая неделя', + 'common.DateRangeInput.thisWeek': 'Эта неделя', + 'common.DateRangeInput.previousMonth': 'Предыдущий месяц', + 'common.DateRangeInput.last30Days': 'Последние 30 дней', + 'common.DateRangeInput.thisMonth': 'Этот месяц', + 'common.DateRangeInput.nextMonth': 'Следующий месяц', + 'common.DateInput.clearValue': '' }, fi: { - selectDateRange: 'Valitse päivämääräväli', - today: 'Tänään', - yesterday: 'Eilen', - tomorrow: 'Huomenna', - previousWeek: 'Edellinen viikko', - nextWeek: 'Seuraava viikko', - thisWeek: 'Tämä viikko', - previousMonth: 'Edellinen kuukausi', - last30Days: 'Edelliset 30 päivää', - thisMonth: 'Tämä kuukausi', - nextMonth: 'Seuraava kuukausi', - clearValue: '' + 'common.DateInput.today': 'Tänään', + 'common.DateInput.yesterday': 'Eilen', + 'common.DateInput.tomorrow': 'Huomenna', + 'common.DateRangeInput.previousWeek': 'Edellinen viikko', + 'common.DateRangeInput.nextWeek': 'Seuraava viikko', + 'common.DateRangeInput.thisWeek': 'Tämä viikko', + 'common.DateRangeInput.previousMonth': 'Edellinen kuukausi', + 'common.DateRangeInput.last30Days': 'Edelliset 30 päivää', + 'common.DateRangeInput.thisMonth': 'Tämä kuukausi', + 'common.DateRangeInput.nextMonth': 'Seuraava kuukausi', + 'common.DateInput.clearValue': '' }, no: { - selectDateRange: 'Velg datoområde', - today: 'I dag', - yesterday: 'I går', - tomorrow: 'I morgen', - previousWeek: 'Forrige uke', - nextWeek: 'Neste uke', - thisWeek: 'Denne uken', - previousMonth: 'Foregående måned', - last30Days: 'Siste 30 dager', - thisMonth: 'Denne måneden', - nextMonth: 'Neste måned', - clearValue: '' + 'common.DateInput.today': 'I dag', + 'common.DateInput.yesterday': 'I går', + 'common.DateInput.tomorrow': 'I morgen', + 'common.DateRangeInput.previousWeek': 'Forrige uke', + 'common.DateRangeInput.nextWeek': 'Neste uke', + 'common.DateRangeInput.thisWeek': 'Denne uken', + 'common.DateRangeInput.previousMonth': 'Foregående måned', + 'common.DateRangeInput.last30Days': 'Siste 30 dager', + 'common.DateRangeInput.thisMonth': 'Denne måneden', + 'common.DateRangeInput.nextMonth': 'Neste måned', + 'common.DateInput.clearValue': '' }, sv: { - selectDateRange: 'Välj datumintervall', - today: 'Idag', - yesterday: 'Igår', - tomorrow: 'Imorgon', - previousWeek: 'Föregående vecka', - nextWeek: 'Nästa vecka', - thisWeek: 'Denna vecka', - previousMonth: 'Föregående månad', - last30Days: 'SSenaste 30 dagarna', - thisMonth: 'Denna månad', - nextMonth: 'Nästa månad', - clearValue: '' + 'common.DateInput.today': 'Idag', + 'common.DateInput.yesterday': 'Igår', + 'common.DateInput.tomorrow': 'Imorgon', + 'common.DateRangeInput.previousWeek': 'Föregående vecka', + 'common.DateRangeInput.nextWeek': 'Nästa vecka', + 'common.DateRangeInput.thisWeek': 'Denna vecka', + 'common.DateRangeInput.previousMonth': 'Föregående månad', + 'common.DateRangeInput.last30Days': 'SSenaste 30 dagarna', + 'common.DateRangeInput.thisMonth': 'Denna månad', + 'common.DateRangeInput.nextMonth': 'Nästa månad', + 'common.DateInput.clearValue': '' } }; diff --git a/src/client/dayjs/index.js b/src/client/dayjs/index.js index 739df2b5..8a86041b 100644 --- a/src/client/dayjs/index.js +++ b/src/client/dayjs/index.js @@ -1,5 +1,6 @@ import dayjs from 'dayjs'; import en from './locales/en'; +import es from './locales/es'; import de from './locales/de'; import fi from './locales/fi'; import no from './locales/no'; @@ -8,6 +9,7 @@ import sv from './locales/sv'; const locales = { en, + es, de, fi, no, diff --git a/src/client/dayjs/locales/es.js b/src/client/dayjs/locales/es.js new file mode 100644 index 00000000..041aade4 --- /dev/null +++ b/src/client/dayjs/locales/es.js @@ -0,0 +1,12 @@ +export default { + name: 'es', + weekdays: 'Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado'.split('_'), + months: 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'), + ordinal: n => `${n}°`, + // https://github.com/moment/moment/blob/develop/locale/es.js + weekdaysMin: 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'), + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + } +}