Skip to content

Commit

Permalink
[FIX] delete unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
Artkrygin committed Nov 2, 2021
2 parents 54685ce + c9e76be commit e6b3218
Show file tree
Hide file tree
Showing 16 changed files with 361 additions and 400 deletions.
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"lint-staged": "lint-staged"
},
"peerDependencies": {
"@agentlab/sparql-jsld-client": ">=5.0.0-rc.18",
"@agentlab/sparql-jsld-client": ">=5.0.0-rc.21",
"@ant-design/icons": ">=4.7.0",
"@rdfjs/data-model": ">=1.3.4",
"@tinymce/tinymce-react": ">=3.13.0",
Expand All @@ -65,27 +65,28 @@
"rc-util": ">=5.14.0",
"react": ">=17.0.2",
"react-base-table": ">=1.12.0",
"react-collapse-pane": ">=2.0.1",
"react-dnd": ">=13.1.1",
"react-dnd-html5-backend": ">=12.1.1",
"react-dom": ">=17.0.2",
"react-error-boundary": ">=3.1.3",
"react-horizontal-scrolling-menu": ">=2.4.4",
"react-horizontal-scrolling-menu": ">=2.5.0",
"react-router": ">=6.0.0-beta.7",
"react-router-dom": ">=6.0.0-beta.7",
"react-sortable-hoc": ">=2.0.0",
"react-split-pane": ">=2.0.3",
"react-virtualized": ">=9.22.3",
"styled-components": ">=5.3.1",
"styled-components": ">=5.3.3",
"tinymce": ">=5.9.2",
"uri-js": ">=4.4.1",
"uuid62": ">=1.0.1"
},
"dependencies": {
"@agentlab/sparql-jsld-client": "^5.0.0-rc.18",
"@agentlab/sparql-jsld-client": "^5.0.0-rc.21",
"@ant-design/icons": "^4.7.0",
"@tinymce/tinymce-react": "^3.13.0",
"@types/react": "^17.0.30",
"@types/react-dom": "^17.0.9",
"@types/react-dom": "^17.0.10",
"@types/react-router": "^5.1.17",
"@types/react-router-dom": "^5.3.1",
"@types/react-virtualized": "^9.21.13",
Expand All @@ -102,7 +103,7 @@
"react-dnd-html5-backend": "12.1.1",
"react-dom": "^17.0.2",
"react-error-boundary": "^3.1.3",
"react-horizontal-scrolling-menu": "^2.4.4",
"react-horizontal-scrolling-menu": "^2.5.0",
"react-is": "^17.0.2",
"react-redux": "^7.2.5",
"react-router": "^6.0.0-beta.7",
Expand All @@ -112,14 +113,14 @@
"react-virtualized": "^9.22.3",
"redux": "^4.1.1",
"remotedev": "^0.2.9",
"styled-components": "^5.3.1",
"styled-components": "^5.3.3",
"tinymce": "5.9.2",
"uri-js": "^4.4.1"
},
"devDependencies": {
"@babel/core": "^7.15.8",
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/plugin-node-resolve": "^13.0.5",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-node-resolve": "^13.0.6",
"@rollup/plugin-typescript": "^8.3.0",
"@storybook/addon-actions": "^6.3.12",
"@storybook/addon-essentials": "^6.3.12",
Expand All @@ -131,7 +132,7 @@
"@storybook/react": "^6.3.12",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.4.2",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.0.2",
"@typescript-eslint/eslint-plugin": "^5.1.0",
"@typescript-eslint/parser": "^5.1.0",
Expand All @@ -153,7 +154,7 @@
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^7.0.2",
"jest": "^27.3.0",
"jest": "^27.3.1",
"jest-watch-typeahead": "^1.0.0",
"lint-staged": "^11.2.3",
"npm-run-all": "^4.1.5",
Expand Down
6 changes: 5 additions & 1 deletion src/data-controls/TabControlRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ export const AntdTabControlWithStore = observer<any>((props) => {
const withConnections = options.connections;
let tabs: JsObject[] = data;

//if (tabs && tabs[0] && tabs[0].rank) {
// tabs = tabs.slice().sort((t1, t2) => t1.rank - t2.rank);
//}

let additionalTabs = (viewKindElement as IMstVkeTabControl).tabs;
if (additionalTabs) {
additionalTabs = additionalTabs.slice().sort((t1, t2) => t2.rank - t1.rank);
additionalTabs = additionalTabs.slice().sort((t1, t2) => t1.rank - t2.rank);
tabs = [...additionalTabs.filter((t) => t.rank <= 100), ...tabs, ...additionalTabs.filter((t) => t.rank > 100)];
}

Expand Down
36 changes: 18 additions & 18 deletions src/models/MstViewDescr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ export const MstViewKindDataType = types.union(
if (snapshot) {
const mstModel = mstViewKindSchemas[snapshot['@type']];
if (mstModel) {
console.log('ViewKindDataType, create mstModel for', {
snapshotId: snapshot['@id'],
mstModelName: mstModel.name,
});
//console.log('ViewKindDataType, create mstModel for', {
// snapshotId: snapshot['@id'],
// mstModelName: mstModel.name,
//});
return mstModel;
}
}
console.log('ViewKindDataType, create ViewKindElement for', snapshot['@id']);
//console.log('ViewKindDataType, create ViewKindElement for', snapshot['@id']);
return MstViewKindElement;
},
},
Expand Down Expand Up @@ -120,17 +120,17 @@ export const MstViewKind = types
let dispose: any;
return {
afterAttach() {
console.log('ViewKind afterAttach, @id=', self['@id']);
//console.log('ViewKind afterAttach, @id=', self['@id']);
if (coll.resolveCollConstrs) {
dispose = reaction(
() => self.collsConstrs,
(
newArr: (IMSTArray<any> & IStateTreeNode<IArrayType<any>>) | undefined,
oldArr: (IMSTArray<any> & IStateTreeNode<IArrayType<any>>) | undefined,
) => {
console.log('ViewKind reaction, add coll ref, @id=', self['@id']);
//console.log('ViewKind reaction, add coll ref, @id=', self['@id']);
const { deleted, added } = arrDiff(newArr, oldArr);
console.log('ViewKind reaction, add coll ref, {deleted,added}=', { deleted, added });
//console.log('ViewKind reaction, add coll ref, {deleted,added}=', { deleted, added });
deleted.forEach((e: any) => rep.colls.delete(e['@id']));
added.forEach((e: any) => rep.addCollByConstrRef(e));
},
Expand All @@ -139,7 +139,7 @@ export const MstViewKind = types
}
},
beforeDetach() {
console.log('ViewKind beforeDetach, @id=', self['@id']);
//console.log('ViewKind beforeDetach, @id=', self['@id']);
if (coll.resolveCollConstrs) {
if (dispose) dispose();
self.collsConstrs.forEach((e) => rep.colls.delete(e['@id']));
Expand Down Expand Up @@ -205,14 +205,14 @@ export const MstViewDescrDataType = types.union(
if (snapshot) {
const mstModel = mstViewDescrSchemas[snapshot['@type']];
if (mstModel) {
console.log('ViewDescrDataType, create mstModel for', {
snapshotId: snapshot['@id'],
mstModelName: mstModel.name,
});
//console.log('ViewDescrDataType, create mstModel for', {
// snapshotId: snapshot['@id'],
// mstModelName: mstModel.name,
//});
return mstModel;
}
}
console.log('ViewDescrDataType, create ViewDescrElement for', snapshot['@id']);
//console.log('ViewDescrDataType, create ViewDescrElement for', snapshot['@id']);
return MstViewDescrElement;
},
},
Expand Down Expand Up @@ -244,17 +244,17 @@ export const MstViewDescr = types
let dispose: any;
return {
afterAttach() {
console.log('MstViewDescr afterAttach, @id=', self['@id']);
//console.log('MstViewDescr afterAttach, @id=', self['@id']);
if (coll.resolveCollConstrs) {
dispose = reaction(
() => self.collsConstrs,
(
newArr: (IMSTArray<any> & IStateTreeNode<IArrayType<any>>) | undefined,
oldArr: (IMSTArray<any> & IStateTreeNode<IArrayType<any>>) | undefined,
) => {
console.log('MstViewDescr reaction, add coll ref, @id=', self['@id']);
//console.log('MstViewDescr reaction, add coll ref, @id=', self['@id']);
const { deleted, added } = arrDiff(newArr, oldArr);
console.log('MstViewDescr reaction, add coll ref, {deleted,added}=', { deleted, added });
//console.log('MstViewDescr reaction, add coll ref, {deleted,added}=', { deleted, added });
deleted.forEach((e: any) => rep.colls.delete(e['@id']));
added.forEach((e: any) => rep.addCollByConstrRef(e));
},
Expand All @@ -263,7 +263,7 @@ export const MstViewDescr = types
}
},
beforeDetach() {
console.log('MstViewDescr beforeDetach, @id=', self['@id']);
//console.log('MstViewDescr beforeDetach, @id=', self['@id']);
if (coll.resolveCollConstrs) {
if (dispose) dispose();
self.collsConstrs.forEach((e) => rep.colls.delete(e['@id']));
Expand Down
4 changes: 2 additions & 2 deletions src/util/ContextToProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ export const withStoreToArrayProps = (Component: React.FC<any>): React.FC<any> =
store.setSelectedData(collIriOverride, data[0]);
withConnections && store.editConn(withConnections, data[0]);
} else {
store.setSelectedData(collIriOverride, undefined);
withConnections && store.editConn(withConnections, undefined);
store.setSelectedData(collIriOverride, null);
withConnections && store.editConn(withConnections, null);
}
}
};
Expand Down
12 changes: 1 addition & 11 deletions stories/FormColumnsAndTable.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const Empty: Story<{}> = () => {

const client = new SparqlClientImpl(
'https://rdf4j.agentlab.ru/rdf4j-server',
'https://rdf4j.agentlab.ru/rdf4j-server/repositories/mktp/namespaces',
'https://rdf4j.agentlab.ru/rdf4j-server/repositories/mktp-schema/namespaces',
);
const rootStore = createUiModelFromState('mktp-fed', client, rootModelInitialState, additionalColls);
const store: any = asReduxStore(rootStore);
Expand Down Expand Up @@ -107,8 +107,6 @@ const viewKinds = [
collapseDirection: 'up',
initialSizes: [25, 65],
minSizes: [100, 100],
//height: 'all-empty-space',
//width: 'all-empty-space',
},
elements: [
{
Expand All @@ -118,7 +116,6 @@ const viewKinds = [
style: {
width: '100%',
},
width: 'all-empty-space',
},
elements: [
{
Expand All @@ -141,7 +138,6 @@ const viewKinds = [
height: '100%',
width: '100%',
},
width: 'all-empty-space',
},
elements: [
{
Expand Down Expand Up @@ -191,7 +187,6 @@ const viewKinds = [
//flexGrow: '5',
width: '100%',
},
width: 'all-empty-space',
},
elements: [
{
Expand All @@ -202,7 +197,6 @@ const viewKinds = [
verticalAlign: 'top',
padding: '5px',
},
width: 'all-empty-space',
},
elements: [
{
Expand Down Expand Up @@ -240,7 +234,6 @@ const viewKinds = [
verticalAlign: 'top',
padding: '5px',
},
width: 'all-empty-space',
},
elements: [
{
Expand Down Expand Up @@ -273,7 +266,6 @@ const viewKinds = [
verticalAlign: 'top',
padding: '5px',
},
width: 'all-empty-space',
},
elements: [
{
Expand Down Expand Up @@ -311,7 +303,6 @@ const viewKinds = [
verticalAlign: 'top',
padding: '5px',
},
width: 'all-empty-space',
},
elements: [
{
Expand Down Expand Up @@ -373,7 +364,6 @@ const viewKinds = [
options: {
draggable: true,
resizeableHeader: true,
height: 'all-empty-space',
style: { height: '100%' },
order: [
'imageUrl',
Expand Down
4 changes: 3 additions & 1 deletion stories/PanelLayout.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import { tableRenderers } from '../src';
export default {
title: 'Layout',
component: Form,
// Due to Storybook bug https://github.com/storybookjs/storybook/issues/12747
parameters: { docs: { source: { type: 'code' } } },
} as Meta;

const baseStyle = {
Expand All @@ -55,7 +57,7 @@ const Template: Story = (args: any) => {

const client = new SparqlClientImpl(
'https://rdf4j.agentlab.ru/rdf4j-server',
'https://rdf4j.agentlab.ru/rdf4j-server/repositories/mktp/namespaces',
'https://rdf4j.agentlab.ru/rdf4j-server/repositories/mktp-schema/namespaces',
);
const rootStore = createUiModelFromState('mktp-fed', client, rootModelInitialState, additionalColls);
const store: any = asReduxStore(rootStore);
Expand Down
2 changes: 1 addition & 1 deletion stories/PanelWithFlexLayout.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Template: Story = (args: any) => {

const client = new SparqlClientImpl(
'https://rdf4j.agentlab.ru/rdf4j-server',
'https://rdf4j.agentlab.ru/rdf4j-server/repositories/mktp/namespaces',
'https://rdf4j.agentlab.ru/rdf4j-server/repositories/mktp-schema/namespaces',
);

const rootStore = createUiModelFromState('mktp-fed', client, rootModelInitialState, additionalColls);
Expand Down
1 change: 0 additions & 1 deletion stories/QueryTable.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const viewKinds = [
options: {
draggable: true,
resizeableHeader: true,
height: 'all-empty-space',
style: { height: '100%' },
order: [
'imageUrl',
Expand Down
1 change: 0 additions & 1 deletion stories/QueryTreeTableArtifacts.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ const viewKinds = [
width: '100%',
height: '100%',
},
//width: 'all-empty-space',
collapseDirection: 'left',
initialSizes: [17, 83],
},
Expand Down
1 change: 0 additions & 1 deletion stories/TableRemoteArtifacts.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ const viewKinds = [
options: {
draggable: true,
resizeableHeader: true,
height: 'all-empty-space',
style: { height: '100%' },
order: [
'identifier',
Expand Down
3 changes: 1 addition & 2 deletions stories/TableRemoteMktp.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Template: Story = (args: any) => {

const client = new SparqlClientImpl(
'https://rdf4j.agentlab.ru/rdf4j-server',
'https://rdf4j.agentlab.ru/rdf4j-server/repositories/mktp/namespaces',
'https://rdf4j.agentlab.ru/rdf4j-server/repositories/mktp-schema/namespaces',
);
const rootStore = createUiModelFromState('mktp-fed', client, rootModelInitialState, additionalColls);
const store: any = asReduxStore(rootStore);
Expand Down Expand Up @@ -98,7 +98,6 @@ const viewKinds = [
options: {
draggable: true,
resizeableHeader: true,
height: 'all-empty-space',
style: { height: '100%' },
multiSelect: true,
order: [
Expand Down
2 changes: 0 additions & 2 deletions stories/TreeAndFormArtifact.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ const viewKinds = [

collapseDirection: 'left',
initialSizes: [17, 83],
height: 'all-empty-space',
//width: 'all-empty-space',
},
elements: [
{
Expand Down
Loading

0 comments on commit e6b3218

Please sign in to comment.