Skip to content
Commits on Source (8)
......@@ -39,7 +39,7 @@ stages:
- !reference [.rules-map, on-dev]
- !reference [.rules-map, not-on-semantic-release-commit]
- !reference [.rules-map, on-branch]
image: hub.eole.education/proxyhub/geoffreybooth/meteor-base:2.7.3
image: hub.eole.education/proxyhub/geoffreybooth/meteor-base:2.8.1
before_script:
- cd app
cache:
......@@ -115,19 +115,18 @@ build-docker:
- !reference [.rules-map, not-on-semantic-release-commit]
- !reference [.rules-map, on-branch]
###############################################################################
# `release` stage: `new release`, testing prerelease`, `merge-to-dev`, `tag *`
###############################################################################
# Create the release versions on `$STABLE_BRANCH`
new release: {extends: '.semantic-release:stable'}
new release: { extends: '.semantic-release:stable' }
# Create the prereleases versions on `$TESTING_BRANCH`
# update `.releaserc.js` variable `betaBranch`
testing prerelease: {extends: '.semantic-release:testing'}
testing prerelease: { extends: '.semantic-release:testing' }
# Avoid regression and update `version` of app/package*.json in `$DEV_BRANCH`
merge-to-dev: {extends: '.git:merge-to', variables: {GIT_MERGE_TARGET: $DEV_BRANCH}}
merge-to-dev: { extends: '.git:merge-to', variables: { GIT_MERGE_TARGET: $DEV_BRANCH } }
## tag contribution branches with a more stable name than `git-${CI_COMMIT_SHORT_SHA}`
tag contrib branch:
......
# The tag here should match the Meteor version of your app, per .meteor/release
FROM hub.eole.education/proxyhub/geoffreybooth/meteor-base:2.7.3
FROM hub.eole.education/proxyhub/geoffreybooth/meteor-base:2.8.1
# Copy app package.json and package-lock.json into container
COPY ./app/package*.json $APP_SOURCE_FOLDER/
......@@ -13,7 +13,7 @@ RUN bash $SCRIPTS_FOLDER/build-meteor-bundle.sh
# Rather than Node 8 latest (Alpine), you can also use the specific version of Node expected by your Meteor release, per https://docs.meteor.com/changelog.html
FROM hub.eole.education/proxyhub/library/node:14.19.3-alpine
FROM hub.eole.education/proxyhub/library/node:14.21.1-alpine
ENV APP_BUNDLE_FOLDER /opt/bundle
ENV SCRIPTS_FOLDER /docker
......@@ -36,7 +36,7 @@ RUN bash $SCRIPTS_FOLDER/build-meteor-npm-dependencies.sh --build-from-source
# Start another Docker stage, so that the final image doesn’t contain the layer with the build dependencies
# See previous FROM line; this must match
FROM hub.eole.education/proxyhub/library/node:14.19.3-alpine
FROM hub.eole.education/proxyhub/library/node:14.21.1-alpine
ENV APP_BUNDLE_FOLDER /opt/bundle
ENV SCRIPTS_FOLDER /docker
......
......@@ -6,16 +6,16 @@
meteor-base@1.5.1 # Packages every Meteor app needs to have
mobile-experience@1.1.0 # Packages for a great mobile UX
mongo@1.15.0 # The database Meteor supports right now
reactive-var@1.0.11 # Reactive variable for tracker
mongo@1.16.1 # The database Meteor supports right now
reactive-var@1.0.12 # Reactive variable for tracker
standard-minifier-css@1.8.1 # CSS minifier run for production mode
standard-minifier-js@2.8.0 # JS minifier run for production mode
standard-minifier-css@1.8.2 # CSS minifier run for production mode
standard-minifier-js@2.8.1 # JS minifier run for production mode
es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers
ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code
ecmascript@0.16.3 # Enable ECMAScript2015+ syntax in app code
typescript@4.5.4 # Enable TypeScript syntax in .ts and .tsx modules
shell-server@0.5.0 # Server-side component of the `meteor shell` command
hot-module-replacement@0.5.1 # Update client in development without reloading the page
hot-module-replacement@0.5.2 # Update client in development without reloading the page
static-html@1.3.2 # Define static page content in .html files
react-meteor-data # React higher-order component for reactively tracking Meteor data
......@@ -32,11 +32,11 @@ meteortesting:mocha
hwillson:stub-collections
johanbrook:publication-collector
dburles:factory
random@1.2.0
service-configuration@1.3.0
random@1.2.1
service-configuration@1.3.1
matb33:collection-hooks
email@2.2.1
check@1.3.1
email@2.2.2
check@1.3.2
eoleteam:accounts-keycloak
mexar:mdt
accounts-base@2.2.3
accounts-base@2.2.5
accounts-oauth@1.4.1
accounts-password@2.3.1
aldeed:collection2@3.5.0
aldeed:schema-index@3.0.0
allow-deny@1.1.1
autoupdate@1.8.0
babel-compiler@7.9.0
babel-compiler@7.9.2
babel-runtime@1.5.1
base64@1.0.12
binary-heap@1.0.11
......@@ -14,29 +14,29 @@ boilerplate-generator@1.7.1
caching-compiler@1.2.2
caching-html-compiler@1.2.1
callback-hook@1.4.0
check@1.3.1
check@1.3.2
dburles:collection-helpers@1.1.0
dburles:factory@1.1.0
ddp@1.4.0
ddp-client@2.5.0
ddp@1.4.1
ddp-client@2.6.1
ddp-common@1.4.0
ddp-rate-limiter@1.1.0
ddp-server@2.5.0
diff-sequence@1.1.1
ddp-rate-limiter@1.1.1
ddp-server@2.6.0
diff-sequence@1.1.2
dynamic-import@0.7.2
ecmascript@0.16.2
ecmascript@0.16.3
ecmascript-runtime@0.8.0
ecmascript-runtime-client@0.12.1
ecmascript-runtime-server@0.11.0
ejson@1.1.2
email@2.2.1
ejson@1.1.3
email@2.2.2
eoleteam:accounts-keycloak@2.1.0
eoleteam:keycloak-oauth@2.2.0
es5-shim@4.8.0
fetch@0.1.1
geojson-utils@1.0.10
fetch@0.1.2
geojson-utils@1.0.11
hot-code-push@1.0.4
hot-module-replacement@0.5.1
hot-module-replacement@0.5.2
html-tools@1.1.3
htmljs@1.1.1
http@2.0.0
......@@ -47,55 +47,55 @@ johanbrook:publication-collector@1.1.0
launch-screen@1.3.0
localstorage@1.2.0
logging@1.3.1
matb33:collection-hooks@1.1.2
matb33:collection-hooks@1.1.4
mdg:validated-method@1.2.0
meteor@1.10.0
meteor@1.10.2
meteor-base@1.5.1
meteortesting:browser-tests@1.3.5
meteortesting:mocha@2.0.3
meteortesting:mocha-core@8.1.2
mexar:mdt@0.2.2
minifier-css@1.6.0
minifier-js@2.7.4
minimongo@1.8.0
minifier-css@1.6.1
minifier-js@2.7.5
minimongo@1.9.0
mobile-experience@1.1.0
mobile-status-bar@1.1.0
modern-browsers@0.1.8
modules@0.18.0
modules-runtime@0.13.0
modules-runtime-hot@0.14.0
mongo@1.15.0
modern-browsers@0.1.9
modules@0.19.0
modules-runtime@0.13.1
modules-runtime-hot@0.14.1
mongo@1.16.1
mongo-decimal@0.1.3
mongo-dev-server@1.1.0
mongo-id@1.0.8
npm-mongo@4.3.1
npm-mongo@4.11.0
oauth@2.1.2
oauth2@1.3.1
ordered-dict@1.1.0
promise@0.12.0
promise@0.12.1
raix:eventemitter@1.0.0
random@1.2.0
random@1.2.1
rate-limit@1.0.9
react-fast-refresh@0.2.3
react-meteor-data@2.5.1
reactive-var@1.0.11
react-meteor-data@2.4.0
reactive-var@1.0.12
reload@1.3.1
retry@1.1.0
routepolicy@1.1.1
service-configuration@1.3.0
service-configuration@1.3.1
sha@1.0.9
shell-server@0.5.0
socket-stream-client@0.5.0
spacebars-compiler@1.3.1
standard-minifier-css@1.8.1
standard-minifier-js@2.8.0
standard-minifier-css@1.8.2
standard-minifier-js@2.8.1
static-html@1.3.2
templating-tools@1.2.2
tmeasday:check-npm-versions@1.0.2
tracker@1.2.0
tracker@1.2.1
typescript@4.5.4
underscore@1.0.10
underscore@1.0.11
universe:i18n@1.32.6
url@1.3.2
webapp@1.13.1
webapp-hashing@1.1.0
webapp@1.13.2
webapp-hashing@1.1.1
......@@ -21,7 +21,9 @@
"validateButton": "Validate",
"closeButton": "Cancel",
"eventCreated": "Event created with success",
"startDateMustBeAfterToday": "Start date must be after today"
"needTitle": "A title is required",
"startMustBeAfterNow": "The event has already started",
"endMustBeAfterBegin": "The end of the event must be after the beginning"
},
"ReadEvent": {
"title": "Event",
......
......@@ -21,7 +21,9 @@
"validateButton": "Valider",
"closeButton": "Annuler",
"eventCreated": "Évenement créé avec succès",
"startDateMustBeAfterToday": "La date doit être après aujourd'hui"
"needTitle": "Un titre est requis",
"startMustBeAfterNow": "Le début de l'événement est déjà passé",
"endMustBeAfterBegin": "La fin de l'événement doit être après le début"
},
"ReadEvent": {
"title": "Évenement",
......
import React from 'react';
import React, { useState } from 'react';
import i18n from 'meteor/universe:i18n';
import PropTypes from 'prop-types';
......@@ -42,6 +42,8 @@ const InformationsForm = ({ stateHook: [state, setState], errors }) => {
// }
// };
const [title, setTitle] = useState('');
return (
<form noValidate>
<Grid container spacing={2}>
......@@ -54,8 +56,11 @@ const InformationsForm = ({ stateHook: [state, setState], errors }) => {
variant="outlined"
label={i18n.__('pages.FormEvent.eventTitle')}
className={classes.field}
value={state.title}
onChange={(e) => setState({ title: e.target.value })}
value={title}
error={!!errors.title}
helperText={errors.title}
onChange={(e) => setTitle(e.target.value)}
onBlur={() => setState({ title })}
/>
</Grid>
<Grid item md={6} xs={12}>
......
......@@ -23,36 +23,25 @@ export const initialState = {
};
export const useErrors = (state) => {
const { startDate, endDate, startTime, endTime, startRecur, endRecur } = state;
const { title, startDate, endDate, startTime, endTime } = state;
const [errors, setErrors] = useObjectState({});
useEffect(() => {
if (moment(startDate).isAfter(endDate)) {
setErrors({ endDate: i18n.__('pages.FormEvent.endDateMustBeAfterStartDate') });
} else if (moment(startDate).isBefore(moment().subtract(1, 'days'))) {
setErrors({ endDate: i18n.__('pages.AddEvent.startDateMustBeAfterToday') });
} else {
setErrors({ endDate: null });
}
}, [endDate, startDate]);
useEffect(() => {
if (moment(`${startDate} ${startTime}`).isAfter(`${endDate} ${endTime}`)) {
setErrors({ endTime: i18n.__('pages.FormEvent.endTimeMustBeAfterStartTime') });
} else if (moment(`${startDate} ${startTime}`).isBefore(moment().subtract(1, 'days'))) {
setErrors({ endDate: i18n.__('pages.AddEvent.startDateMustBeAfterToday') });
} else {
setErrors({ endTime: null });
setErrors({ title: null, endTime: null, startTime: null, endDate: null, startDate: null });
if (!title) setErrors({ title: i18n.__('pages.AddEvent.needTitle') });
if (moment(`${startDate} ${startTime}`).isSameOrAfter(`${endDate} ${endTime}`)) {
setErrors({
endDate: i18n.__('pages.AddEvent.endMustBeAfterBegin'),
endTime: i18n.__('pages.AddEvent.endMustBeAfterBegin'),
});
}
}, [endTime, startTime, endDate, startDate]);
useEffect(() => {
if (endRecur && moment(`${startRecur}`).isAfter(`${endRecur}`)) {
setErrors({ endTime: i18n.__('pages.FormEvent.endTimeMustBeAfterStartTime') });
} else {
setErrors({ endTime: null });
if (moment(`${startDate} ${startTime}`).isBefore()) {
setErrors({
startDate: i18n.__('pages.AddEvent.startMustBeAfterNow'),
startTime: i18n.__('pages.AddEvent.startMustBeAfterNow'),
});
}
}, [startRecur, endRecur]);
}, [title, endTime, startTime, endDate, startDate]);
return errors;
};
......
......@@ -30,6 +30,8 @@ const AddEvent = ({ history }) => {
moment.suppressDeprecationWarnings = true;
console.log('errors', errors);
useEffect(() => {
if (
Object.values(errors).reduce((a, c) => (c !== null ? 1 : a), 0) === 0 &&
......
{
"name": "agenda3",
"version": "3.7.0",
"version": "3.8.0-testing.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -3242,9 +3242,9 @@
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -3278,14 +3278,14 @@
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="
},
"moment": {
"version": "2.29.3",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz",
"integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw=="
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
},
"moment-timezone": {
"version": "0.5.33",
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz",
"integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==",
"version": "0.5.38",
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.38.tgz",
"integrity": "sha512-nMIrzGah4+oYZPflDvLZUgoVUO4fvAqHstvG3xAUnMolWncuAiLDWNnJZj6EwJGMGfb1ZcuTFE6GI3hNOVWI/Q==",
"requires": {
"moment": ">= 2.9.0"
}
......
{
"name": "agenda3",
"version": "3.7.0",
"version": "3.8.0-testing.1",
"license": "EUPL-1.2",
"description": "Online diary",
"author": "EOLE/PCLL <team@eole.education> - DINUM",
......@@ -35,7 +35,7 @@
"ical-generator": "^2.2.0",
"material-icons": "^1.11.1",
"meteor-node-stubs": "^1.2.1",
"moment": "^2.29.3",
"moment": "^2.29.4",
"node-ical": "^0.13.0",
"prop-types": "^15.8.1",
"react": "^16.13.1",
......