bf988bc6d Eliminar 43 vulnerabilidades npm: react-scripts→Vite, ESLint 9, limpieza de dependencias, correcciones de errores
f867698d3 wip: elevar versiones de paquetes
3685edd6c elevar a react 18 wip
36bfe1dbe Nueva versión de React, eslint revisado por Fin.
c23bfbdf5 es-lint: revisión con Fin requerida.
bf988bc6d
Eliminar 43 vulnerabilidades npm: react-scripts→Vite, ESLint 9, limpieza de dependencias, correcciones de erroresbf988bc6d14252863c2a7a54c409c947fb9feb7b
diff --git a/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx b/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
index 327602d77..20cd9405d 100644
--- a/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
+++ b/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
@@ -4,7 +4,7 @@ import 'moment/min/locales';
import PropTypes from 'prop-types';
import React from 'react';
import { DayPicker } from 'react-day-picker';
-import { connect } from 'react-redux';
+import { useSelector } from 'react-redux';
import { Col, Row } from '../..';
import { getTranslation } from '../../../../utilities/layout';
import style from './CalendarInput.module.scss';
@@ -12,21 +12,21 @@ import TimeRange from './TimeRange';
function DateTimeRange(
{
- firstDayOfWeek = 1,
from,
hideTimeInput = false,
id,
- locale = 'en',
onChange,
selectors,
setFrom,
setTo,
- timeNotation = 'H24',
- translations = {},
to,
+ translations = {},
...props
},
) {
+ const firstDayOfWeek = useSelector((state) => state.authentication.user.firstDayOfWeekNo) || 1;
+ const locale = useSelector((state) => state.authentication.user.locale) || 'en';
+ const timeNotation = useSelector((state) => state.authentication.user.timeNotation) || 'H24';
const [quickSelector, setQuickSelector] = React.useState(undefined);
const handleQuickSelectorClick = (interval) => () => {
@@ -259,21 +259,12 @@ DateTimeRange.propTypes = {
onChange: PropTypes.func.isRequired,
id: PropTypes.string.isRequired,
hideTimeInput: PropTypes.bool,
- firstDayOfWeek: PropTypes.number,
from: PropTypes.instanceOf(Date),
- locale: PropTypes.string,
setFrom: PropTypes.func,
setTo: PropTypes.func,
selectors: PropTypes.arrayOf(PropTypes.string),
- timeNotation: PropTypes.string,
translations: PropTypes.shape({}),
to: PropTypes.instanceOf(Date),
};
-
-const mapStateToProps = ({ authentication }) => ({
- firstDayOfWeek: authentication.user.firstDayOfWeekNo,
- locale: authentication.user.locale,
- timeNotation: authentication.user.timeNotation,
-}); f867698d3
wip: elevar versiones de paquetesf867698d30e539955cc1dd9aacc4986234ff36f2
diff --git a/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx b/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
index e8e5a78a5..327602d77 100644
--- a/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
+++ b/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
@@ -3,8 +3,7 @@ import moment from 'moment';
import 'moment/min/locales';
import PropTypes from 'prop-types';
import React from 'react';
-import DayPicker from 'react-day-picker';
-import MomentLocaleUtils from 'react-day-picker/moment';
+import { DayPicker } from 'react-day-picker';
import { connect } from 'react-redux';
import { Col, Row } from '../..';
import { getTranslation } from '../../../../utilities/layout';
@@ -235,7 +234,6 @@ function DateTimeRange(
className="range"
firstDayOfWeek={firstDayOfWeek}
locale={locale}
- localeUtils={MomentLocaleUtils}
modifiers={{
start: from,
end: to, 3685edd6c
elevar a react 18 wip3685edd6c9f0dfd4582dbeb01c05491c254ccb84
diff --git a/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx b/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
index 6a51c5c04..e8e5a78a5 100644
--- a/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
+++ b/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
@@ -13,16 +13,17 @@ import TimeRange from './TimeRange';
function DateTimeRange(
{
- firstDayOfWeek,
+ firstDayOfWeek = 1,
from,
- hideTimeInput,
+ hideTimeInput = false,
id,
- locale,
+ locale = 'en',
onChange,
selectors,
setFrom,
setTo,
- translations,
+ timeNotation = 'H24',
+ translations = {},
to,
...props
},
@@ -248,6 +249,7 @@ function DateTimeRange(
from,
to,
}]}
+ timeNotation={timeNotation}
{...props}
/>
</Col>
@@ -270,19 +272,6 @@ DateTimeRange.propTypes = {
to: PropTypes.instanceOf(Date),
};
-DateTimeRange.defaultProps = {
- hideTimeInput: false,
- firstDayOfWeek: 1,
- from: undefined,
- locale: 'en',
- setFrom: undefined,
- setTo: undefined,
- selectors: undefined,
- timeNotation: 'H24',
- translations: {},
- to: undefined,
-};
-
const mapStateToProps = ({ authentication }) => ({
firstDayOfWeek: authentication.user.firstDayOfWeekNo,
locale: authentication.user.locale, 36bfe1dbe
Nueva versión de React, eslint revisado por Fin.36bfe1dbe1091ce01c65ef320ec3610e7d3f3900
diff --git a/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx b/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
index f596c0acc..6a51c5c04 100644
--- a/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
+++ b/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
@@ -248,7 +248,6 @@ function DateTimeRange(
from,
to,
}]}
- // eslint-disable-next-line react/jsx-props-no-spreading
{...props}
/>
</Col> c23bfbdf5
es-lint: revisión con Fin requerida.c23bfbdf5b54c9e3c7c3b2537375d9fb255a2730
diff --git a/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx b/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
index ecf67f410..f596c0acc 100644
--- a/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
+++ b/projectforge-webapp/src/components/design/input/calendar/DateTimeRange.jsx
@@ -29,7 +29,7 @@ function DateTimeRange(
) {
const [quickSelector, setQuickSelector] = React.useState(undefined);
- const handleQuickSelectorClick = interval => () => {
+ const handleQuickSelectorClick = (interval) => () => {
setQuickSelector(interval);
const newFrom = new Date();
@@ -195,7 +195,7 @@ function DateTimeRange(
{selectors && selectors.includes('UNTIL_NOW') && (
<Col sm={3}>
<ul className={style.quickSelectors}>
- {quickSelectors.map(selector => (
+ {quickSelectors.map((selector) => (
<li
className={classNames(
style.quickSelector,
@@ -248,6 +248,7 @@ function DateTimeRange(
from,
to,
}]}
+ // eslint-disable-next-line react/jsx-props-no-spreading
{...props}
/>
</Col>