Skip to content

Commit

Permalink
[fix] Nullish unselects in table, upd client
Browse files Browse the repository at this point in the history
  • Loading branch information
amivanoff committed Oct 19, 2021
1 parent 84b8178 commit 22ca979
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 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.19",
"@ant-design/icons": ">=4.7.0",
"@rdfjs/data-model": ">=1.3.4",
"@tinymce/tinymce-react": ">=3.13.0",
Expand Down Expand Up @@ -81,7 +81,7 @@
"uuid62": ">=1.0.1"
},
"dependencies": {
"@agentlab/sparql-jsld-client": "^5.0.0-rc.18",
"@agentlab/sparql-jsld-client": "^5.0.0-rc.19",
"@ant-design/icons": "^4.7.0",
"@tinymce/tinymce-react": "^3.13.0",
"@types/react": "^17.0.30",
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
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@agentlab/sparql-jsld-client@^5.0.0-rc.18":
version "5.0.0-rc.18"
resolved "https://registry.yarnpkg.com/@agentlab/sparql-jsld-client/-/sparql-jsld-client-5.0.0-rc.18.tgz#c05d44ad9501a33dc90a690fb42b6be8850e613b"
integrity sha512-x8pJuyOQuVdTv/8HRStC2muEFoHaKmkBfInnaHzDhyTsxfc0Vm1ZmEWQQ2D86LToyS8upU8F2JDfYGuKziNgJA==
"@agentlab/sparql-jsld-client@^5.0.0-rc.19":
version "5.0.0-rc.19"
resolved "https://registry.yarnpkg.com/@agentlab/sparql-jsld-client/-/sparql-jsld-client-5.0.0-rc.19.tgz#eed849407631d6f70226ca0f5ddc78bafb424af3"
integrity sha512-HPT8xhyLReMIE3VLratDPA00a0VAydwhwsFMcgqe9iasvy6H5uXU9yMM3MvVFLt2EyQqNFmCIuzKCwr6LO7DPg==
dependencies:
"@rdfjs/data-model" "^1.3.4"
"@types/json-schema" "^7.0.9"
Expand Down

0 comments on commit 22ca979

Please sign in to comment.