Skip to content

Commit

Permalink
Merge branch 'main' into issue-14-base-table-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
amivanoff committed Sep 29, 2021
2 parents 78e7131 + 39c098a commit 9e17501
Show file tree
Hide file tree
Showing 27 changed files with 724 additions and 589 deletions.
58 changes: 29 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,49 +51,49 @@
"lint-staged": "lint-staged"
},
"peerDependencies": {
"@agentlab/sparql-jsld-client": ">=5.0.0-rc.12",
"@ant-design/icons": ">=4.6.4",
"@agentlab/sparql-jsld-client": ">=5.0.0-rc.13",
"@ant-design/icons": ">=4.7.0",
"@rdfjs/data-model": ">=1.3.3",
"@tinymce/tinymce-react": ">=3.12.6",
"antd": ">=4.16.13",
"history": ">=5.0.1",
"lodash-es": ">=4.17.21",
"mobx": ">=6.3.3",
"mobx-react-lite": ">=3.2.1",
"mobx-state-tree": ">=5.0.2",
"mobx-state-tree": ">=5.0.3",
"moment": ">=2.29.1",
"react": ">=17.0.2",
"react-base-table": ">=1.12.0",
"react-dom": ">=17.0.2",
"react-dnd": ">=13.1.1",
"react-dnd-html5-backend": ">=12.1.1",
"react-error-boundary": ">=3.1.3",
"react-router": ">=6.0.0-beta.3",
"react-router-dom": ">=6.0.0-beta.3",
"react-router": ">=6.0.0-beta.4",
"react-router-dom": ">=6.0.0-beta.4",
"react-sortable-hoc": ">=2.0.0",
"react-virtualized": ">=9.22.3",
"rc-util": ">=5.13.2",
"rc-util": ">=5.14.0",
"react-split-pane": ">=2.0.3",
"styled-components": ">=5.3.1",
"tinymce": ">=5.5.1",
"uri-js": ">=4.4.1",
"uuid62": ">=1.0.1"
},
"dependencies": {
"@agentlab/sparql-jsld-client": "^5.0.0-rc.12",
"@agentlab/sparql-jsld-client": "^5.0.0-rc.13",
"@ant-design/icons": "^4.6.4",
"@tinymce/tinymce-react": "^3.12.6",
"@types/react": "^17.0.20",
"@types/react": "^17.0.24",
"@types/react-dom": "^17.0.9",
"@types/react-router": "^5.1.16",
"@types/react-router-dom": "^5.1.8",
"@types/react-router-dom": "^5.3.0",
"@types/react-virtualized": "^9.21.13",
"@types/styled-components": "^5.1.14",
"@types/tinymce": "^4.6.4",
"antd": "^4.16.13",
"history": "^5.0.1",
"mobx-react-lite": "^3.2.1",
"mst-middlewares": "^5.0.2",
"mst-middlewares": "^5.0.3",
"react": "^17.0.2",
"react-base-table": "^1.12.0",
"react-dom": "^17.0.2",
Expand All @@ -102,8 +102,8 @@
"react-error-boundary": "^3.1.3",
"react-is": "^17.0.2",
"react-redux": "^7.2.5",
"react-router": "^6.0.0-beta.3",
"react-router-dom": "^6.0.0-beta.3",
"react-router": "^6.0.0-beta.4",
"react-router-dom": "^6.0.0-beta.4",
"react-sortable-hoc": "^2.0.0",
"react-virtualized": "^9.22.3",
"styled-components": "^5.3.1",
Expand All @@ -116,7 +116,7 @@
"devDependencies": {
"@babel/core": "^7.15.5",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"@rollup/plugin-node-resolve": "^13.0.5",
"@rollup/plugin-typescript": "^8.2.5",
"@storybook/addon-actions": "^6.3.8",
"@storybook/addon-essentials": "^6.3.8",
Expand All @@ -127,37 +127,37 @@
"@storybook/preset-scss": "^1.0.3",
"@storybook/react": "^6.3.8",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/react": "^12.1.0",
"@testing-library/user-event": "^13.2.1",
"@types/jest": "^27.0.1",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"autoprefixer": "^10.3.4",
"@types/jest": "^27.0.2",
"@typescript-eslint/eslint-plugin": "^4.31.2",
"@typescript-eslint/parser": "^4.31.2",
"autoprefixer": "^10.3.5",
"babel-loader": "^8.2.2",
"cross-env": "^7.0.3",
"cssnano": "^5.0.7",
"cypress": "^8.3.1",
"cssnano": "^5.0.8",
"cypress": "^8.4.1",
"cypress-storybook": "^0.5.1",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-cypress": "^2.11.3",
"eslint-plugin-flowtype": "^5.9.2",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-flowtype": "^6.1.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-jest": "^24.4.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.25.1",
"eslint-plugin-react": "^7.26.0",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^7.0.2",
"jest": "^27.1.0",
"jest": "^27.2.1",
"jest-watch-typeahead": "^0.6.4",
"lint-staged": "^11.1.2",
"npm-run-all": "^4.1.5",
"postcss": "^8.3.6",
"prettier": "^2.3.2",
"postcss": "^8.3.7",
"prettier": "2.3.2",
"rimraf": "^3.0.2",
"rollup": "^2.56.3",
"rollup": "^2.57.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.1",
Expand All @@ -168,7 +168,7 @@
"style-loader": "^2.0.0",
"ts-jest": "^27.0.5",
"tslib": "^2.3.1",
"typescript": "4.3.5",
"typescript": "4.4.3",
"typescript-plugin-css-modules": "^3.4.0"
},
"lint-staged": {
Expand Down
9 changes: 5 additions & 4 deletions src/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { MstContext } from './MstContext';
import { UnknownRenderer } from './UnknownRenderer';
import { RankedTester } from './testers';
import { IViewDescr, IViewDescrElement, IViewKind, IViewKindElement } from './models/uischema';
import { JsObject } from '@agentlab/sparql-jsld-client';

export interface ControlComponent {
data: any;
Expand Down Expand Up @@ -84,7 +85,7 @@ export interface DispatchCellProps extends RenderProps {
[key: string]: any;
}

export function mstJsonLdIds(o: any) {
export function mstJsonLdIds(o: JsObject): JsObject | undefined {
if (o) return { '@id': o['@id'], '@type': o['@type'] };
else return undefined;
}
Expand Down Expand Up @@ -181,7 +182,7 @@ export const FormsDispatch = observer<FormsDispatchProps>((props) => {
}
});

export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps): JSX.Element {
return (
<div role='alert'>
<p>Something went wrong:</p>
Expand Down Expand Up @@ -229,8 +230,8 @@ export const Form = observer<FormsInitStateProps>((props) => {
}
return (
<ErrorBoundary FallbackComponent={ErrorFallback} onReset={() => {}}>
{viewKindObs.elements.map((el: IViewKindElement) => (
<FormsDispatch {...props} viewKind={viewKindObs} viewKindElement={el} viewDescr={viewDescrObs} />
{viewKindObs.elements.map((el: IViewKindElement, idx: number) => (
<FormsDispatch key={idx} {...props} viewKind={viewKindObs} viewKindElement={el} viewDescr={viewDescrObs} />
))}
</ErrorBoundary>
);
Expand Down
2 changes: 1 addition & 1 deletion src/UnknownRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface UnknownRendererProps {
* A renderer that will be used in case no other renderer is applicable.
*/
export class UnknownRenderer extends Component<UnknownRendererProps, any> {
render() {
render(): JSX.Element {
return (
<div style={{ color: 'red' }}>
No applicable {this.props.type} found for element with id={this.props.elementId} and type=
Expand Down
2 changes: 1 addition & 1 deletion src/cells/AntdCellCardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Card } from 'antd';
import { DispatchCell } from '../DispatchCell';
import './cell.css';

export const AntdCellCardLayout = (props: any) => {
export const AntdCellCardLayout = (props: any): JSX.Element => {
const { viewKind, viewKindElement, viewDescr, viewDescrElement, schema, data, id } = props;
const createCardChilds = () =>
viewKindElement.elements
Expand Down
2 changes: 1 addition & 1 deletion src/cells/AntdCellG2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const template: any = {
'https://www.wildberries.ru/catalog/16170086/detail.aspx': '/img/chart_3.png',
'https://www.wildberries.ru/catalog/18247707/detail.aspx': '/img/chart_4.png',
};
export const AntdCellG2 = (props: any) => {
export const AntdCellG2 = (props: any): JSX.Element => {
return <Image style={{ height: '217px' }} src={template[props.data['@id']]} />;
};

Expand Down
1 change: 1 addition & 0 deletions src/cells/AntdCellHorizontalLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const AntdCellHorizontalLayoutRenderer: React.FC<DispatchCellProps> = ({
<Row justify={justify} style={rowStyle} align={'middle'}>
{(viewKindElement.elements || []).map((e: IViewKindElement, idx: number) => (
<Render
key={idx}
viewKind={viewKind}
viewKindElement={e}
viewDescr={viewDescr}
Expand Down
20 changes: 9 additions & 11 deletions src/cells/AntdSimpleCells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
*
* SPDX-License-Identifier: GPL-3.0-only
********************************************************************************/
import { get } from 'lodash-es';

import React from 'react';
import { Button, Card, Image, Row, Col, Rate } from 'antd';
import { Button, Image, Rate } from 'antd';

import {
rankWith,
Expand All @@ -37,7 +35,7 @@ import './cell.css';
/**
* AntdBooleanCell
*/
export const AntdBooleanCell = (props: any) => {
export const AntdBooleanCell = (props: any): JSX.Element => {
return <CellRenderer Cell={AntdCheckbox} {...props} />;
};
export const antdBooleanCellTester: RankedTester = rankWith(2, isBooleanControl);
Expand All @@ -46,7 +44,7 @@ export const AntdBooleanCellWithStore = withStoreToCellProps(AntdBooleanCell);
/**
* AntdButtonCell
*/
export const AntdButtonCell = (props: any) => {
export const AntdButtonCell = (props: any): JSX.Element => {
const options = props.uiOptions;
return (
<Button size={'small'} style={options.style}>
Expand All @@ -60,14 +58,14 @@ export const AntdButtonCellWithStore = withStoreToCellProps(AntdButtonCell);
/**
* AntdEnumCell
*/
export const AntdEnumCell = (props: any /*: EnumCellProps & WithClassname*/) => <AntdSelect {...props} />;
export const AntdEnumCell = (props: any /*: EnumCellProps & WithClassname*/): JSX.Element => <AntdSelect {...props} />;
export const antdEnumCellTester: RankedTester = rankWith(2, isEnumControl);
export const AntdEnumCellWithStore = withStoreToCellProps(AntdEnumCell);

/**
* AntdNumberCell & AntdIntegerCell
*/
export const AntdNumberCell = (props: any) => {
export const AntdNumberCell = (props: any): JSX.Element => {
return <CellRenderer Cell={AntdInputNumber} {...props} />;
};

Expand All @@ -80,7 +78,7 @@ export const AntdNumberCellWithStore = withStoreToCellProps(AntdNumberCell);
/**
* AntdImageCell
*/
export const AntdImageCell = (props: any) => {
export const AntdImageCell = (props: any): JSX.Element => {
const { data } = props;
return <Image style={{ height: '100%', width: '100%' }} src={data[0]} />;
};
Expand All @@ -90,7 +88,7 @@ export const AntdImageCellWithStore = withStoreToCellProps(AntdImageCell);
/**
* AntdRateCell
*/
export const AntdRateCell = (props: any /*: EnumCellProps & WithClassname*/) => {
export const AntdRateCell = (props: any /*: EnumCellProps & WithClassname*/): JSX.Element => {
return (
<React.Fragment>
<Rate
Expand All @@ -109,7 +107,7 @@ export const AntdRateCellWithStore = withStoreToCellProps(AntdRateCell);
/**
* AntdTextCell
*/
export const AntdTextCell = (props: any) => {
export const AntdTextCell = (props: any): JSX.Element => {
return <CellRenderer Cell={AntdInputText} {...props} />;
};
export const antdTextCellTester: RankedTester = rankWith(1, isStringControl);
Expand All @@ -118,7 +116,7 @@ export const AntdTextCellWithStore = withStoreToCellProps(AntdTextCell);
/**
* AntdTimeCell
*/
export const AntdTimeCell = (props: any) => {
export const AntdTimeCell = (props: any): JSX.Element => {
return <CellRenderer Cell={AntdInputDate} {...props} />;
};
export const antdTimeCellTester: RankedTester = rankWith(2, isDateTimeControl);
Expand Down
2 changes: 1 addition & 1 deletion src/cells/TinyMCECell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { withStoreToCellProps } from '../util/ContextToProps';
import { TinyMCE } from '../antd-controls/TinyMCE';
import { CellRenderer } from './CellRenderer';

export const TinyMCECell = (props: any) => {
export const TinyMCECell = (props: any): JSX.Element => {
return <CellRenderer Cell={TinyMCE} {...props} />;
};

Expand Down
2 changes: 1 addition & 1 deletion src/controls/AntdEnumControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { withStoreToControlProps } from '../util/ContextToProps';
import { AntdSelect } from '../antd-controls/AntdSelect';
import { AntdInputControl } from './AntdInputControl';

export const AntdEnumControl = (props: any) => <AntdInputControl {...props} input={AntdSelect} />;
export const AntdEnumControl = (props: any): JSX.Element => <AntdInputControl {...props} input={AntdSelect} />;

export const antdEnumControlTester: RankedTester = rankWith(2, isEnumControl);
export const AntdEnumControlWithStore = withStoreToControlProps(AntdEnumControl);
6 changes: 4 additions & 2 deletions src/controls/AntdRadioGroupControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ export const AntdRadioGroupControl: React.FC<ControlComponent> = (props) => {
</Col>
<Col span={16}>
<Radio.Group value={currentData} onChange={onChange}>
{(uiOptions as any[]).map((optionValue) => (
<Radio checked={data === optionValue}>{optionValue}</Radio>
{(uiOptions as any[]).map((optionValue, idx: number) => (
<Radio key={idx} checked={data === optionValue}>
{optionValue}
</Radio>
))}
</Radio.Group>
</Col>
Expand Down
2 changes: 1 addition & 1 deletion src/data-controls/TabControlRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const TabControl: React.FC<TabControlProps> = ({ tabs = [], handleChange
);
};

export const TabControlRenderer = (props: any) => {
export const TabControlRenderer = (props: any): JSX.Element => {
return <TabControl {...props} />;
};

Expand Down
2 changes: 0 additions & 2 deletions src/data-controls/TreeRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
********************************************************************************/
import { sortBy } from 'lodash-es';
import React, { useState, useEffect } from 'react';
import SplitPane from 'react-split-pane';
import { Tree, Input } from 'antd';

import { SaveReqDialoglWithStore } from '../util/OnSaveDialog';
import { FormsDispatch } from '../Form';
import { NodeRenderer } from './NodeRenderer';
import { TreeContextMenu } from './TreeContextMenu';

Expand Down
Loading

0 comments on commit 9e17501

Please sign in to comment.