Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rahti Deployment from current develop #241

Merged
merged 31 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c128dc3
CSCFC4EMSCR-561 Clicking mapping source/target node only highlights o…
masillan Oct 31, 2024
4d6838c
added putMscrRevision mutation
Nov 5, 2024
44e9285
Merge branch 'develop' into CSCFC4EMSCR-591-Remove-File-Upload-from-A…
Nov 5, 2024
c14f983
Merge branch 'develop' into CSCFC4EMSCR-591-Remove-File-Upload-from-A…
Nov 8, 2024
56f3839
removing log messages
Nov 11, 2024
6cee1df
Removing duplicate code
Nov 11, 2024
cd9cfaf
CSCFC4EMSCR-599 Fix mapping table rendering for all schema formats. A…
masillan Nov 11, 2024
20830aa
Merge pull request #227 from CSCfi/CSCFC4EMSCR-561
masillan Nov 11, 2024
dccae7b
CSCFC4EMSCR-602 When filtering from mappings, results get duplicated.…
masillan Nov 11, 2024
61d7167
Merge pull request #232 from CSCfi/CSCFC4EMSCR-602
masillan Nov 12, 2024
10a9a18
Merge branch 'develop' into CSCFC4EMSCR-599
masillan Nov 12, 2024
a60e05c
CSCFC4EMSCR-599 allow ROOT element selection to mapping.
masillan Nov 12, 2024
f6d1c81
CSCFC4EMSCR-599 fix to add ROOT element or ROOT element as parent cla…
masillan Nov 12, 2024
1ce8bce
Merge pull request #231 from CSCfi/CSCFC4EMSCR-599
masillan Nov 13, 2024
70aa938
CSCFC4EMSCR-612 Hide create content buttons from group members
maariaw Nov 13, 2024
eb151ec
CSCFC4EMSCR-616 Construct tree without extra ROOT node
maariaw Nov 13, 2024
e66ceea
Merge branch 'develop' into CSCFC4EMSCR-591-Remove-File-Upload-from-A…
Nov 20, 2024
524c258
added changes from the review
Nov 20, 2024
796f292
Merge pull request #230 from CSCfi/CSCFC4EMSCR-591-Remove-File-Upload…
rquazi Nov 20, 2024
bae033d
revert back to mscr copy
Nov 21, 2024
b3a7717
Merge pull request #234 from CSCfi/CSCFC4EMSCR-612_Member-permissions
rquazi Nov 21, 2024
1c83530
Merge branch 'develop' into CSCFC4EMSCR-617-Revert-bacl-to-MSCR-Copy
Nov 21, 2024
dfb78f3
changing permission for mscr-copy
Nov 21, 2024
a5a961e
CSCFC4EMSCR-616 Change expanding behavior of schema tree
maariaw Nov 21, 2024
33fad58
Merge pull request #235 from CSCfi/CSCFC4EMSCR-616_Remove-generated-R…
rquazi Nov 25, 2024
2d095ce
CSCFC4EMSCR-611 Enable reordering of target properties in the mapping…
masillan Dec 4, 2024
995160d
CSCFC4EMSCR-585 Change node elementpath to array
maariaw Dec 10, 2024
34fd91f
Merge pull request #236 from CSCfi/CSCFC4EMSCR-617-Revert-bacl-to-MSC…
rquazi Dec 10, 2024
7db19f8
Merge pull request #238 from CSCfi/CSCFC4EMSCR-611
masillan Dec 10, 2024
86d6bac
CSCFC4EMSCR-585 Rename node property elementPath to rootPathIds
maariaw Dec 11, 2024
df14a39
Merge pull request #239 from CSCfi/CSCFC4EMSCR-585_Suggestion-for-imp…
masillan Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mscr-ui/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"finish-editing": "Finish editing",
"invalidate-crosswalk": "Invalidate crosswalk",
"invalidate-schema": "Invalidate schema",
"mscr-copy": "Covert to MSCR Format",
"mscr-copy": "Make a MSCR Copy",
"publish-crosswalk": "Publish crosswalk",
"publish-schema": "Publish schema",
"revision": "Add new revision",
Expand Down Expand Up @@ -91,7 +91,7 @@
"crosswalk-create": "Create Crosswalk",
"crosswalk-register": "Register Crosswalk",
"crosswalk-revision": "Register revision",
"mscr-copy": "Convert to MSCR Format",
"mscr-copy": "MSCR Copy",
"schema-register": "Register Schema",
"schema-revision": "Register revision"
},
Expand All @@ -109,7 +109,7 @@
"crosswalk-mscr-copy": "Register MSCR copy of crosswalk",
"crosswalk-register": "Register existing crosswalk",
"crosswalk-revision": "Register revision of crosswalk",
"schema-mscr-copy": "Convert Schema to MSCR Format",
"schema-mscr-copy": "Make a MSCR copy",
"schema-register": "Register schema",
"schema-revision": "Register revision of schema"
},
Expand Down Expand Up @@ -278,7 +278,7 @@
"add-schema": "New schema added",
"add-schema-revision": "New schema version added",
"copy-crosswalk": "MSCR copy of crosswalk added",
"copy-schema": "Schema is converted to MSCR format",
"copy-schema": "MSCR copy of schema added",
"crosswalk-deleted": "Crosswalk was removed",
"crosswalk-deprecated": "Crosswalk deprecated",
"crosswalk-invalidated": "Crosswalk invalidated",
Expand Down
36 changes: 11 additions & 25 deletions mscr-ui/src/common/components/schema-info/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ export default function SchemaInfo(props: {
generatedTree.then((res) => {
if (res) {
setTreeDataOriginal(res);
// Expand tree when data is loaded
setPartlyExpanded();
setTreeData(res);
setTreeDataFetched(true);
setNodeIdToNodeDictionary(nodeIdToShallowNode);
Expand All @@ -82,11 +80,6 @@ export default function SchemaInfo(props: {
}
}, [getSchemaDataIsSuccess, getSchemaData]);

// Expand tree when data is loaded
useEffect(() => {
setPartlyExpanded();
}, [isTreeDataFetched]);

// Expand and select nodes when input changed (from mappings accordion)
useEffect(() => {
if (props.treeSelection) {
Expand All @@ -108,47 +101,40 @@ export default function SchemaInfo(props: {
setSelectedTreeNodes(selectedNodes);
}, [treeSelectedArray, nodeIdToNodeDictionary]);

const setPartlyExpanded = () => {
const setFullyExpanded = () => {
const nodeIdsToExpand: string[] = [];
treeData.forEach(({ children, id }) => {
if (children && children.length > 0) {
nodeIdsToExpand.push(id);
if (children.length === 1) {
nodeIdsToExpand.push(children[0].id);
}
}
Object.entries(nodeIdToNodeDictionary).map(([nodeId, node]) => {
if (node.some((n) => n.children.length > 0)) nodeIdsToExpand.push(nodeId);
});
setTreeExpandedArray(nodeIdsToExpand);
};

function clearTreeSearch() {
setTreeSelectedArray([]);
setPartlyExpanded();
setSelectedTreeNodes([]);
}

// Used by tree select and filtering
function getAllNodeIdsOnPathToLeaf(nodeIds: string[]) {
const elementPaths: string[] = [];
let idsOnPath: string[] = [];
nodeIds.forEach((nodeId) => {
const nodes = nodeIdToNodeDictionary[nodeId];
nodes.map((node) => elementPaths.push(node.elementPath));
nodes.map((node) => {
idsOnPath = idsOnPath.concat(node.rootPathIds);
});
});

const nodesToSelect: Set<string> = new Set();
elementPaths.forEach((path) => {
const nodeIdsOnPath = path.split('.');
nodeIdsOnPath.forEach((nodeId) => {
nodesToSelect.add(nodeId);
});
idsOnPath.forEach((pathNodeId) => {
nodesToSelect.add(pathNodeId);
});

return Array.from(nodesToSelect);
}

const handleExpandClick = () => {
if (treeExpandedArray.length === 0) {
setPartlyExpanded();
setFullyExpanded();
} else {
setTreeExpandedArray([]);
}
Expand Down Expand Up @@ -321,7 +307,7 @@ export default function SchemaInfo(props: {
>
{isTreeDataFetched && (
<SchemaTree
nodes={treeData[0]}
nodes={treeData}
treeSelectedArray={treeSelectedArray}
treeExpanded={treeExpandedArray}
performTreeAction={performCallbackFromTreeAction}
Expand Down
13 changes: 2 additions & 11 deletions mscr-ui/src/common/components/schema-info/schema-tree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function SchemaTree({
showQname,
isSourceTree,
}: {
nodes: RenderTree;
nodes: RenderTree[];
treeSelectedArray: string[];
treeExpanded: string[];
performTreeAction: (action: string, nodeIds: string[]) => void;
Expand Down Expand Up @@ -78,16 +78,7 @@ export default function SchemaTree({
defaultExpandIcon={<ChevronRightIcon />}
multiSelect
>
<TreeItem
key={nodes.visualTreeId}
nodeId={nodes.id}
label={nodes.name}
className="linked-tree-item"
>
{Array.isArray(nodes.children)
? nodes.children.map((node: RenderTree) => toTree(node, showQname))
: null}
</TreeItem>
{nodes.map((node: RenderTree) => toTree(node, showQname))}
</TreeView>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export default function NodeInfo(props: {
)}
{props.isNodeEditable &&
selectedNode &&
selectedNode?.elementPath !== 'ROOT' &&
!isLeafNode &&
!props.hasCustomRoot && (
<Button
Expand Down
Loading
Loading