Commit 5eeda802 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '366-update-dependencies' into 'main'

Update dependencies

Closes #366

See merge request grin-global/grin-global-ui!356
parents ee297f3a 940a43a6
......@@ -14,3 +14,4 @@ workspaces/counter/assets/examples
workspaces/ui-express/docker/app
.vs/
workspaces/ui-public/dist
package-lock.json
......@@ -26,19 +26,18 @@
"workspaces/ui-express"
],
"devDependencies": {
"lerna": "^3.0.0",
"ncp": "^2.0.0"
"@types/react": "16",
"lerna": "4",
"ncp": "2"
},
"resolutions": {
"@types/react": "^16.0.0",
"react": "^16.0.0",
"typescript": "^3.0.0"
"@types/react": "16",
"react": "16",
"typescript": "3",
"lerna": "4"
},
"engines": {
"node": ">=16.0.0",
"yarn": "^1.21.1"
},
"dependencies": {
"@types/react": "^16.0.0"
}
}
......@@ -23,7 +23,7 @@
"i18next-browser-languagedetector": "^4.0.0",
"i18next-express-middleware": "^2.0.0",
"i18next-sync-fs-backend": "^1.0.0",
"i18next-xhr-backend": "^3.0.0",
"i18next-xhr-backend": "^2.0.1",
"immutability-helper": "^3.0.0",
"js-md5": "^0.7.0",
"jsonwebtoken": "^8.0.0",
......@@ -86,7 +86,6 @@
"jest": "^26.0.0",
"jsdom": "^16.0.0",
"jsdom-global": "^3.0.0",
"lerna": "^3.0.0",
"mini-css-extract-plugin": "^1.0.0",
"optimize-css-assets-webpack-plugin": "^5.0.0",
"react-hot-loader": "^4.0.0",
......
......@@ -27,4 +27,6 @@ const coreReducers = (history?) => ({
// model reducers
});
export type ICoreReducers = ReturnType<typeof coreReducers>[keyof ReturnType<typeof coreReducers>]
export default coreReducers;
import * as React from 'react';
import { useSelector } from 'react-redux'
import { IRootState } from '@gringlobal-ce/ui-express/src/reducers';
// Print a number
function Number({
value,
config = {},
}: { value: number, config?: Intl.NumberFormatOptions }) {
const locale = useSelector((state) => state.applicationConfig.lang) || 'en';
const locale = useSelector((state: IRootState) => state.applicationConfig.lang) || 'en';
if (typeof value === 'number') {
return <span>{ value.toLocaleString(locale, { maximumFractionDigits: 2, ...config }) }</span>;
......
......@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { UserRole } from '@gringlobal-ce/client/model/gringlobal/SysUser';
interface IAuthorizeProps {
roles: UserRole[];
roles: UserRole[]
children: any;
login: any;
withTooltip?: boolean;
......
......@@ -3,7 +3,7 @@ import debounce from 'lodash/debounce';
import { WithStyles, withStyles } from '@material-ui/core/styles';
import { createStyles } from '@material-ui/core';
import { FieldInputProps, FieldMetaState } from 'react-final-form';
import { FieldInputProps, FieldMetaState, FieldRenderProps } from 'react-final-form';
import TextField from '@material-ui/core/TextField';
import MuiAutocomplete, { AutocompleteInputChangeReason } from '@material-ui/lab/Autocomplete';
......@@ -219,4 +219,4 @@ class Autocomplete extends React.Component<IAutocompleteProps & WithStyles & Wit
}
}
export default withTranslation()(withStyles(styles)(Autocomplete))
export default withTranslation()(withStyles(styles)(Autocomplete)) as React.ComponentClass<FieldRenderProps<string, any>>
......@@ -25,7 +25,7 @@ const renderMembers = (fields, itemLabel, itemEditor, addItem, removeItem, heade
{ header && <div className="mb-10"><b>{ header }</b></div> }
{ fields && fields.length > 0 && fields.map((member, index) => (
<div key={ index } className="items-editor-item">
<Grid container justify="space-between" alignItems="center">
<Grid container justifyContent="space-between" alignItems="center">
<Grid item xs={ 10 } md={ 11 }>
{ itemEditor(member, index, fields, itemLabel) }
</Grid>
......
......@@ -35,7 +35,7 @@ function ContentHeader(props: IContentHeader): JSX.Element {
const { t } = useTranslation();
return (
<Grid id="header" container spacing={ 0 } className={ `pt-10 pb-10 pl-20 pr-20 ${classes.root}` } justify="space-between" alignItems="center">
<Grid id="header" container spacing={ 0 } className={ `pt-10 pb-10 pl-20 pr-20 ${classes.root}` } justifyContent="space-between" alignItems="center">
<Grid item>
<h1 className={ `font-bold ${classes.title}` }>
{ typeof title === 'string' ? t(title) : title }
......
......@@ -2,7 +2,7 @@ import * as React from 'react';
import { Grid } from '@material-ui/core';
export const CenteredLayout = (props: React.ComponentProps<any>) => (
<Grid justify="center" alignItems="flex-start" container item xs={ 12 } { ...props }>
<Grid justifyContent="center" alignItems="flex-start" container item xs={ 12 } { ...props }>
{ props.children }
</Grid>
);
......@@ -106,7 +106,7 @@ class Snackbar extends React.Component<ISnacks, any> {
open={ this.state.open }
autoHideDuration={ 3000 }
onClose={ this.handleClose }
onExited={ this.handleExited }
TransitionProps={ { onExited: this.handleExited } }
ContentProps={ { 'aria-describedby': 'message-id' } }
message={ snackContent }
classes={ { anchorOriginBottomCenter: 'snackbar' } }
......
......@@ -1015,4 +1015,4 @@ const TableRow = withTranslation()(TableRowInternal);
export const TableNoSettings = withTranslation()(withStyles(styles)(withTheme(Table)));
export default withUserSettings(TableNoSettings);
export default withUserSettings(TableNoSettings as React.ComponentClass<any>);
......@@ -4,6 +4,7 @@ import * as React from 'react';
import Authorize from '@gringlobal-ce/client/ui/common/authorized/Authorize';
// test
import { mountWithProvider } from '@gringlobal-ce/client/test/test-util';
import { UserRole } from '@gringlobal-ce/client/model/gringlobal/SysUser';
const initState = {
login: {
......@@ -16,7 +17,7 @@ describe('Authorize', () => {
let wrapper;
beforeEach(() => {
wrapper = mountWithProvider(<Authorize roles={ [ 'ROLE_ADMINISTRATOR' ] }>some admin content</Authorize>)(initState)
wrapper = mountWithProvider(<Authorize roles={ [ UserRole.ADMINISTRATOR ] }>some admin content</Authorize>)(initState)
});
it('Authorize component should render', () => {
......
......@@ -19,7 +19,7 @@
"i18next-browser-languagedetector": "^4.0.0",
"i18next-express-middleware": "^2.0.0",
"i18next-sync-fs-backend": "^1.0.0",
"i18next-xhr-backend": "^3.0.0"
"i18next-xhr-backend": "^2.0.1"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
......@@ -47,7 +47,7 @@
"file-system": "^2.0.0",
"i18next-scanner": "^2.0.0",
"js-md5": "^0.7.0",
"lerna": "^3.0.0",
"lerna": "^4.0.0",
"readline-sync": "^1.0.0",
"rimraf": "^3.0.0",
"ts-node": "^8.0.0",
......
......@@ -50,7 +50,7 @@
"i18next-browser-languagedetector": "^4.0.0",
"i18next-express-middleware": "^2.0.0",
"i18next-sync-fs-backend": "^1.0.0",
"i18next-xhr-backend": "^3.0.0",
"i18next-xhr-backend": "^2.0.1",
"immutability-helper": "^3.0.0",
"js-md5": "^0.7.0",
"jsonwebtoken": "^8.0.0",
......@@ -133,7 +133,7 @@
"html-webpack-skip-assets-plugin": "^0.0.2",
"jest": "^26.0.0",
"jsdom": "^16.0.0",
"lerna": "^3.0.0",
"lerna": "^4.0.0",
"mini-css-extract-plugin": "^1.0.0",
"moxios": "^0.4.0",
"optimize-css-assets-webpack-plugin": "^5.0.0",
......
......@@ -76,7 +76,7 @@ class AdministrationDashboard extends React.Component<PropsFromRedux & WithTrans
<PageTitle title={ t('admin.p.status.title') }/>
<ContentHeader title="You're root, have fun!"/>
<div className="p-20">
<Grid container justify="flex-start" spacing={ 2 }>
<Grid container justifyContent="flex-start" spacing={ 2 }>
{ alertMessages &&
<Grid item xs={12}>
<h2>{alertMessages?.length > 0
......
......@@ -37,7 +37,7 @@ class WelcomePage extends React.Component<PropsFromRedux & WithTranslation & Wit
<PageTitle title={ name || t('welcome.p.title') }/>
<ContentHeader title={ name || t('welcome.p.title') }/>
<div className="p-20">
<Grid container justify="flex-start" spacing={ 2 }>
<Grid container justifyContent="flex-start" spacing={ 2 }>
{ (!login || !login.user_name) &&
<Grid item xs={ 12 } sm={ 6 } md={ 4 } lg={ 3 }>
......
......@@ -4,7 +4,7 @@ import update from 'immutability-helper';
import { ApiCall } from '@gringlobal-ce/client/model/common';
import AppSetting from '@gringlobal-ce/client/model/gringlobal/AppSetting';
import { RECEIVE_APP_SETTING_ITEM, RECEIVE_APP_SETTING_LIST, REMOVE_APP_SETTING } from '_core/constants/appSetting';
import { RECEIVE_APP_SETTING_ITEM, RECEIVE_APP_SETTING_LIST, REMOVE_APP_SETTING } from '@gringlobal-ce/ui-express/src/_core/constants/appSetting';
import { Page } from '@gringlobal-ce/client/model/page';
const INITIAL_STATE: {
......
import update from 'immutability-helper';
// Model
import { IFileUpload } from '_core/model/IFileUpload';
import { IFileUpload } from '@gringlobal-ce/ui-express/src/_core/model/IFileUpload';
import { FILE_UPLOAD_CANCEL, FILE_UPLOAD_PROGRESS } from '_core/constants/fileUpload';
import { FILE_UPLOAD_CANCEL, FILE_UPLOAD_PROGRESS } from '@gringlobal-ce/ui-express/src/_core/constants/fileUpload';
const INITIAL_STATE: {
uploads: { [key: string]: IFileUpload },
......
......@@ -4,7 +4,7 @@ import update from 'immutability-helper';
import SsrError from '@gringlobal-ce/client/model/common/SsrError';
import SystemStatus from "@gringlobal-ce/client/model/gringlobal/SystemStatus";
import { RECEIVE_SSR_ERROR_INFO, RECEIVE_SERVER_STATUS } from '_core/constants/serverInfo';
import { RECEIVE_SSR_ERROR_INFO, RECEIVE_SERVER_STATUS } from '@gringlobal-ce/ui-express/src/_core/constants/serverInfo';
const INITIAL_STATE: {
ssrError: SsrError,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment