-
Notifications
You must be signed in to change notification settings - Fork 1
TD-4336: Implement Code Changes in Web UI-My contributions Page #542
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
Merged
sarathlal-sarangadharan
merged 5 commits into
CI
from
Develop/Fixes/TD-4336-mplement-Code-Changes-in-Web-UI-My-contributions-Page
Sep 4, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f41715f
TD-4336: Implement Code Changes in Web UI-My contributions Page
sarathlal-sarangadharan 5a66b88
TD-4336: Restricting move functionality in Catalogue which has extern…
sarathlal-sarangadharan 0efcb1a
TD-4336: method name changed to meaningful name
sarathlal-sarangadharan 05bff2b
TD-4336: Scenario when a single resource is added as external referen…
sarathlal-sarangadharan df60faa
TD-4336: Unused tables has been removed.
sarathlal-sarangadharan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
...arningHub.Nhs.Database/Stored Procedures/Hierarchy/CheckCatalogueHasExternalReference.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| ------------------------------------------------------------------------------- | ||
| -- Author Sarathlal | ||
| -- Created 29 August 2024 | ||
| -- Purpose Return if Node has an external reference | ||
| -- | ||
| -- Modification History | ||
| -- | ||
| -- 29-08-2024 SS Initial Revision. | ||
|
|
||
| ------------------------------------------------------------------------------- | ||
| CREATE PROCEDURE [hierarchy].[CheckCatalogueHasExternalReference] | ||
| ( | ||
| @CatalogueNodeId int, | ||
| @HasExternalCatalogueReference bit OUTPUT | ||
| ) | ||
| AS | ||
|
|
||
| BEGIN | ||
| ;WITH | ||
| cteNode(NodeId, ParentNodeId, PrimaryCatalogueNodeId, InitialNodePath) | ||
| AS | ||
| ( | ||
| SELECT | ||
| n.Id AS NodeId, | ||
| ParentNodeId = NULL, | ||
| nv.PrimaryCatalogueNodeId, | ||
| CAST(n.Id AS nvarchar(128)) AS InitialNodePath | ||
| FROM | ||
| hierarchy.NodePath np | ||
| INNER JOIN | ||
| hierarchy.[Node] n ON np.NodeId = n.Id | ||
| INNER JOIN | ||
| hierarchy.NodeVersion nv ON n.CurrentNodeVersionId = nv.Id | ||
| WHERE | ||
| nv.NodeId=@catalogueNodeId | ||
| AND nv.VersionStatusId = 2 -- Published | ||
| AND np.Deleted = 0 | ||
| AND n.Deleted = 0 | ||
| AND nv.Deleted = 0 | ||
|
|
||
| UNION ALL | ||
|
|
||
| SELECT | ||
| ChildNodeId AS NodeId, | ||
| nl.ParentNodeId, | ||
| nv.PrimaryCatalogueNodeId, | ||
| CAST(cte.InitialNodePath + '\' + CAST(ChildNodeId AS nvarchar(8)) AS nvarchar(128)) AS InitialNodePath | ||
| FROM | ||
| hierarchy.NodeLink nl | ||
| INNER JOIN | ||
| hierarchy.[Node] n ON nl.ChildNodeId = n.Id | ||
| INNER JOIN | ||
| cteNode cte ON nl.ParentNodeId = cte.NodeId | ||
| INNER JOIN | ||
| hierarchy.NodeVersion nv ON n.CurrentNodeVersionId = nv.Id | ||
| WHERE | ||
| n.CurrentNodeVersionId IS NOT NULL | ||
| AND nv.VersionStatusId = 2 -- Published | ||
| AND n.Deleted = 0 | ||
| AND nl.Deleted = 0 | ||
|
|
||
| ), | ||
|
|
||
| cteResource | ||
| AS ( | ||
| SELECT cte.PrimaryCatalogueNodeId | ||
| FROM | ||
| cteNode cte | ||
| UNION | ||
|
|
||
| SELECT | ||
| rv.PrimaryCatalogueNodeId AS PrimaryCatalogueNodeId | ||
| FROM | ||
| hierarchy.NodePath np | ||
| INNER JOIN | ||
| hierarchy.NodeResource nr ON np.NodeId = nr.NodeId | ||
| INNER JOIN | ||
| resources.[Resource] r ON nr.ResourceId = r.Id | ||
| INNER JOIN | ||
| resources.ResourceVersion rv ON rv.resourceId = nr.ResourceId | ||
| INNER JOIN | ||
| resources.ResourceReference rr ON rr.ResourceId = nr.ResourceId AND rr.NodePathId = np.Id AND rr.Deleted = 0 | ||
|
|
||
| WHERE | ||
| np.CatalogueNodeId = @CatalogueNodeId | ||
| and rv.PrimaryCatalogueNodeId <>np.CatalogueNodeId | ||
| AND r.CurrentResourceVersionId IS not NULL | ||
| AND nr.VersionStatusId=2 | ||
| AND nr.Deleted = 0 | ||
| AND r.Deleted = 0 | ||
| AND rv.Deleted = 0 | ||
| ) | ||
| SELECT @HasExternalCatalogueReference=case when count(distinct cte.PrimaryCatalogueNodeId ) > 1 then 1 ELSE 0 END | ||
|
|
||
| FROM | ||
| cteResource cte | ||
| END | ||
| GO | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.