Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3dc33bb
TD-4394: Publishing catalogues needs to update referencing catalogues
sarathlal-sarangadharan Aug 21, 2024
95a0d21
TD-4394: Hardcoded value chnaged to variable
sarathlal-sarangadharan Aug 21, 2024
bc7a6aa
Merge pull request #538 from TechnologyEnhancedLearning/TD-4570_Optio…
Swapnamol Aug 22, 2024
f41715f
TD-4336: Implement Code Changes in Web UI-My contributions Page
sarathlal-sarangadharan Aug 28, 2024
7c74966
Td-4584: Adding content to, or re-aranging content within, a referenc…
Swapnamol Aug 28, 2024
bf9d58a
Update texts and fix error message in content structure
DRJTechnology Aug 29, 2024
bd8ddec
Operations are restricted to the current HierarchyEditId
Swapnamol Sep 2, 2024
f47de2c
Added Distinct condition to avoid duplicate entries in to the [hierar…
Swapnamol Sep 2, 2024
5a66b88
TD-4336: Restricting move functionality in Catalogue which has extern…
sarathlal-sarangadharan Sep 2, 2024
0efcb1a
TD-4336: method name changed to meaningful name
sarathlal-sarangadharan Sep 2, 2024
4eec69b
Merge pull request #543 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Sep 2, 2024
05bff2b
TD-4336: Scenario when a single resource is added as external referen…
sarathlal-sarangadharan Sep 3, 2024
df60faa
TD-4336: Unused tables has been removed.
sarathlal-sarangadharan Sep 4, 2024
413f25a
Merge pull request #542 from TechnologyEnhancedLearning/Develop/Fixes…
sarathlal-sarangadharan Sep 4, 2024
d4309c4
TD-4450 : The problem with creating the subfolder has been resolved.
Swapnamol Sep 4, 2024
facb0de
Comments added
Swapnamol Sep 4, 2024
26007a6
Comments modified
Swapnamol Sep 4, 2024
29033b3
Merge pull request #568 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Sep 4, 2024
7296004
TD-4409 Implement editing and deletion of Folder and Resource referen…
DRJTechnology Sep 4, 2024
56e85a2
Merge from CI branch
DRJTechnology Sep 4, 2024
436220d
Merge pull request #569 from TechnologyEnhancedLearning/Develop/Fixes…
DRJTechnology Sep 5, 2024
06aafa0
Merge branch 'CI' into Develop/Fixes/TD-4394-Publishing-catalogues-ne…
sarathlal-sarangadharan Sep 5, 2024
6d9cf6c
Merge pull request #537 from TechnologyEnhancedLearning/Develop/Fixes…
sarathlal-sarangadharan Sep 5, 2024
2b7846c
Update NodeResource Deleted status, if the reference is removed.
Swapnamol Sep 5, 2024
198126e
Merge pull request #573 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Sep 5, 2024
c9257dc
TD-4650: Remove this reference" option should not be available in Pri…
sarathlal-sarangadharan Sep 11, 2024
38bf544
TD-4650: Changes applied in WebUI.
sarathlal-sarangadharan Sep 12, 2024
b3b7a77
Merge pull request #579 from TechnologyEnhancedLearning/Develop/Fixes…
sarathlal-sarangadharan Sep 12, 2024
f68f3f7
TD-4736: Resource which is contributed after external referencing is …
sarathlal-sarangadharan Sep 24, 2024
83e78d2
TD-4385: Referenced folder not being added to all required locations
Swapnamol Sep 24, 2024
19d54de
Merge pull request #604 from TechnologyEnhancedLearning/Develop/Fixes…
sarathlal-sarangadharan Sep 24, 2024
c4652e1
Merge pull request #607 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Sep 24, 2024
743b03c
TD-4373-Allow .ppsx file types
Swapnamol Sep 27, 2024
8a2d8ba
Merge pull request #613 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Sep 27, 2024
6c1c059
TD-4408: Creating a reference/folder to a resource does not refresh a…
sarathlal-sarangadharan Sep 27, 2024
339add6
Merge pull request #616 from TechnologyEnhancedLearning/Develop/Fixes…
sarathlal-sarangadharan Sep 30, 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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using LearningHub.Nhs.AdminUI.Configuration;
using LearningHub.Nhs.AdminUI.Controllers.Api;
using LearningHub.Nhs.AdminUI.Interfaces;
using LearningHub.Nhs.Models.Common;
using LearningHub.Nhs.Models.Hierarchy;
using LearningHub.Nhs.WebUI.Models.Contribute;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -439,5 +438,29 @@ public async Task<IActionResult> RemoveReferenceNode(int hierarchyEditDetailId)
var apiResponse = await this.hierarchyService.RemoveReferenceNodeAsync(hierarchyEditDetailId);
return this.Ok(apiResponse.ValidationResult);
}

/// <summary>
/// The DeleteNodeReferenceDetails.
/// </summary>
/// <param name="hierarchyEditDetailId">The hierarchyEditDetailId<see cref="hierarchyEditDetailId"/>.</param>
/// <returns>IActionResult.</returns>
[Route("DeleteNodeReferenceDetails/{hierarchyEditDetailId}")]
public async Task<IActionResult> DeleteNodeReferenceDetails(int hierarchyEditDetailId)
{
var apiResponse = await this.hierarchyService.DeleteNodeReferenceDetailsAsync(hierarchyEditDetailId);
return this.Ok(apiResponse.ValidationResult);
}

/// <summary>
/// Deletes the resource reference details for a hierarchy edit.
/// </summary>
/// <param name="hierarchyEditDetailId">The hierarchy edit detail id.</param>
/// <returns>The <see cref="IActionResult"/>.</returns>
[Route("DeleteResourceReferenceDetails/{hierarchyEditDetailId}")]
public async Task<IActionResult> DeleteResourceReferenceDetails(int hierarchyEditDetailId)
{
var apiResponse = await this.hierarchyService.DeleteResourceReferenceDetailsAsync(hierarchyEditDetailId);
return this.Ok(apiResponse.ValidationResult);
}
}
}
14 changes: 14 additions & 0 deletions AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IHierarchyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,19 @@ public interface IHierarchyService
/// <param name="hierarchyEditDetailId">The hierarchy Edit Detail Id.</param>
/// <returns>The <see cref="Task"/>.</returns>
Task<ApiResponse> RemoveReferenceNodeAsync(int hierarchyEditDetailId);

/// <summary>
/// Deletes the node reference details.
/// </summary>
/// <param name="hierarchyEditDetailId">The hierarchy Edit Detail Id.</param>
/// <returns>The <see cref="Task"/>.</returns>
Task<ApiResponse> DeleteNodeReferenceDetailsAsync(int hierarchyEditDetailId);

/// <summary>
/// Deletes the resource reference details.
/// </summary>
/// <param name="hierarchyEditDetailId">The hierarchy Edit Detail Id.</param>
/// <returns>The <see cref="Task"/>.</returns>
Task<ApiResponse> DeleteResourceReferenceDetailsAsync(int hierarchyEditDetailId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,13 @@
<input type="button" class="btn btn-custom-green mr-3" @click="onSaveFolderReferenceEdit()" v-bind:class="{disabled: !canSaveFolderReferenceEdit}" v-bind:disabled="!canSaveFolderReferenceEdit" value="Save changes" />
<input type="button" class="btn btn-admin btn-cancel" @click="onCancelFolderReferenceEdit()" value="Cancel" />

<span class="ml-auto mt-3">
<a class="delete-folder-link" @click.prevent="onEditFolderReferenceDeleteFolder" href="#">
Delete this folder reference <i class="fa-solid fa-trash-can delete-folder ml-2"></i>
<span class="ml-auto mt-3" v-if="editingFolderNodeReference.nodePathDisplayVersionId>0">
<a class="delete-folder-link" @click.prevent="onEditFolderReferenceDetailsDeleteFolder" href="#">
Delete folder reference details <i class="fa-solid fa-trash-can delete-folder ml-2"></i>
</a>
</span>
</div>
</div>

<div v-if="editMode === EditModeEnum.ResourceReference" id="editResourceReference">
<div class="col-12">
<label class="control-label">Resource location</label>
Expand Down Expand Up @@ -148,18 +147,16 @@
<input type="button" class="btn btn-custom-green mr-3" @click="onSaveResourceReferenceEdit()" v-bind:class="{disabled: !canSaveResourceReferenceEdit}" v-bind:disabled="!canSaveResourceReferenceEdit" value="Save changes" />
<input type="button" class="btn btn-admin btn-cancel" @click="onCancelResourceReferenceEdit()" value="Cancel" />

<span class="ml-auto mt-3">
<span class="ml-auto mt-3" v-if="editingResourceNodeReference.resourceReferenceDisplayVersionId>0">
<a class="delete-folder-link" @click.prevent="onEditResourceReferenceDeleteFolder" href="#">
Delete this resource reference <i class="fa-solid fa-trash-can delete-folder ml-2"></i>
Delete resource reference details <i class="fa-solid fa-trash-can delete-folder ml-2"></i>
</a>
</span>
</div>
</div>

<div v-if="editMode === EditModeEnum.ReferenceExternalContent" id="referenceExternalContentContainer">
<content-search :editingCatalogueNodePathId="catalogue.rootNodePathId"></content-search>
</div>

<div id="deleteFolderModal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboad="false">
<div class="modal-dialog modal-dialog-centered modal-md" role="document">
<div class="modal-content">
Expand All @@ -182,53 +179,50 @@
</div>
</div>
</div>

<div id="deleteFolderReferenceModal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboad="false">
<div id="deleteFolderReferenceDetailsModal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboad="false">
<div class="modal-dialog modal-dialog-centered modal-md" role="document">
<div class="modal-content">
<div class="modal-header alert-modal-header text-center">
<h2 class="heading-lg w-100"><i class="delete-folder-warning-triangle fas fa-exclamation-triangle pr-3"></i>Delete folder reference</h2>
<h2 class="heading-lg w-100"><i class="delete-folder-warning-triangle fas fa-exclamation-triangle pr-3"></i>Delete folder reference details</h2>
</div>

<div class="modal-body alert-modal-body">
<div class="mt-3">You have chosen to delete the folder reference <span id="deleteFolderReferenceName">{{ deleteFolderReferenceName}}</span>. The folder will display using the default folder properties.</div>
<div class="mt-3">You have chosen to delete the folder reference details <span id="deleteFolderReferenceName">{{ deleteFolderReferenceName}}</span>. The folder will display using the default folder properties.</div>
</div>

<div class="modal-footer alert-modal-footer">
<div class="form-group col-12 p-0 m-0">
<div class="d-flex">
<input type="button" class="btn btn-action-cancel" data-dismiss="modal" value="Cancel" />
<input type="button" class="btn btn-action-red ml-auto" @click="onDeleteFolderReference()" value="Continue" />
<input type="button" class="btn btn-action-red ml-auto" @click="onDeleteFolderReferenceDetails()" value="Continue" />
</div>
</div>
</div>
</div>
</div>
</div>

<div id="deleteResourceReferenceModal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboad="false">
<div class="modal-dialog modal-dialog-centered modal-md" role="document">
<div class="modal-content">
<div class="modal-header alert-modal-header text-center">
<h2 class="heading-lg w-100"><i class="delete-folder-warning-triangle fas fa-exclamation-triangle pr-3"></i>Delete resource reference</h2>
<h2 class="heading-lg w-100"><i class="delete-folder-warning-triangle fas fa-exclamation-triangle pr-3"></i>Delete resource reference details</h2>
</div>

<div class="modal-body alert-modal-body">
<div class="mt-3">You have chosen to delete the resource reference <span id="deleteResourceReferenceName">{{ deleteResourceReferenceName}}</span>. The resource will display using the default resource properties.</div>
<div class="mt-3">You have chosen to delete the resource reference details <span id="deleteResourceReferenceName">{{ deleteResourceReferenceName}}</span>. The resource will display using the default resource properties.</div>
</div>

<div class="modal-footer alert-modal-footer">
<div class="form-group col-12 p-0 m-0">
<div class="d-flex">
<input type="button" class="btn btn-action-cancel" data-dismiss="modal" value="Cancel" />
<input type="button" class="btn btn-action-red ml-auto" @click="onDeleteResourceReference()" value="Continue" />
<input type="button" class="btn btn-action-red ml-auto" @click="onDeleteResourceReferenceDetails()" value="Continue" />
</div>
</div>
</div>
</div>
</div>
</div>

<div id="cancelHierarchyEditModal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboad="false">
<div class="modal-dialog modal-dialog-centered modal-md" role="document">
<div class="modal-content">
Expand Down Expand Up @@ -272,7 +266,6 @@ import { ResourceReferenceDisplayVersionModel } from '../models/content-structur
import { NodeType } from '../constants';
import CKEditorToolbar from '../models/ckeditorToolbar';
import ckeditorwithhint from '../ckeditorwithhint.vue';

export default Vue.extend({
name: 'contentStructure',
components: {
Expand Down Expand Up @@ -418,28 +411,28 @@ export default Vue.extend({
},
onEditFolderDeleteFolder() {
this.deleteFolderName = this.editingFolderNode.name;
$('#deleteFolderReferenceModal').modal('show');
$('#deleteFolderModal').modal('show');
},
onEditFolderReferenceDeleteFolder() {
onEditFolderReferenceDetailsDeleteFolder() {
this.deleteFolderReferenceName = this.editingFolderNodeReference.name;
$('#deleteFolderReferenceModal').modal('show');
$('#deleteFolderReferenceDetailsModal').modal('show');
},
onEditResourceReferenceDeleteFolder() {
onEditResourceReferenceDeleteFolder() {
this.deleteResourceReferenceName = this.editingResourceNodeReference.name;
$('#deleteResourceReferenceModal').modal('show');
},
onDeleteFolder() {
this.$store.dispatch('contentStructureState/deleteFolder');
$('#deleteFolderModal').modal('hide');
},
onDeleteFolderReference() {
this.$store.dispatch('contentStructureState/deleteFolderReference');
$('#deleteFolderReferenceModal').modal('hide');
onDeleteFolderReferenceDetails() {
this.$store.dispatch('contentStructureState/deleteFolderReferenceDetails');
$('#deleteFolderReferenceDetailsModal').modal('hide');
this.onCancelFolderEdit()
},
onDeleteResourceReference() {
this.$store.dispatch('contentStructureState/deleteResourceReference');
$('#deleteFolderModal').modal('hide');
onDeleteResourceReferenceDetails() {
this.$store.dispatch('contentStructureState/deleteResourceReferenceDetails');
$('#deleteResourceReferenceModal').modal('hide');
},
onEdit() {
this.editFolderStructureButtonDisabled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ async function refreshNodeContents(node: NodeContentAdminModel, refreshParentPat
existing.displayOrder = child.displayOrder;
existing.name = child.name;
existing.nodePathDisplayVersionId = child.nodePathDisplayVersionId;
existing.resourceReferenceDisplayVersionId = child.resourceReferenceDisplayVersionId;
existing.nodePaths = child.nodePaths;
existing.isResource = child.nodeTypeId === NodeType.Resource;
if (child.nodePaths) {
Expand Down Expand Up @@ -164,20 +165,22 @@ async function refreshNodeContents(node: NodeContentAdminModel, refreshParentPat
state.lastErrorMessage = `Error refreshing Node contents of ${node.name}`;
});
}

async function refreshNodeIfMatchingNodeId(node: NodeContentAdminModel, nodeId: number, hierarchyEditDetailId: number) {
async function refreshNodeIfMatchingNodeId(node: NodeContentAdminModel, nodeId: number, hierarchyEditDetailId: number, removeChildren?: boolean) {
if (node.nodeId === nodeId && node.hierarchyEditDetailId != hierarchyEditDetailId) {
if (removeChildren && node.parent) {
node.parent.children = [];
node.parent.childrenLoaded = false;
}
await refreshNodeContents(node.parent, false);
}
if (node.childrenLoaded) {
if (node.children.filter(c => c.hierarchyEditDetailId === hierarchyEditDetailId).length == 0) {
for (const child of node.children) {
await refreshNodeIfMatchingNodeId(child, nodeId, hierarchyEditDetailId);
await refreshNodeIfMatchingNodeId(child, nodeId, hierarchyEditDetailId, removeChildren);
}
}
}
}

async function processChildNodeContents(child: NodeContentAdminModel, parent: NodeContentAdminModel) {
child.parent = parent;
child.inEdit = child.parent.inEdit;
Expand Down Expand Up @@ -413,13 +416,34 @@ const actions = <ActionTree<State, any>>{
state.lastErrorMessage = "Error deleting folder.";
});
},
deleteFolderReference(context: ActionContext<State, State>) {
deleteFolderReferenceDetails(context: ActionContext<State, State>) {
state.inError = false;
state.updatedNode = null;
contentStructureData.deleteFolderReferenceDetails(state.editingTreeNode.hierarchyEditDetailId).then(async response => {
if (response.isValid) {
var parent = state.editingTreeNode.parent;
await refreshNodeContents(parent, false);
await refreshNodeIfMatchingNodeId(state.rootNode, state.editingTreeNode.nodeId, state.editingTreeNode.hierarchyEditDetailId, true);
state.updatedNode = parent;
context.commit("setEditMode", EditModeEnum.Structure);
}
else {
state.inError = true;
state.lastErrorMessage = "Error: " + response.details.join(",");
}
}).catch(e => {
state.inError = true;
state.lastErrorMessage = "Error deleting folder reference details.";
});
},
deleteResourceReferenceDetails(context: ActionContext<State, State>) {
state.inError = false;
state.updatedNode = null;
contentStructureData.deleteFolderReference(state.editingTreeNode.hierarchyEditDetailId).then(async response => {
contentStructureData.deleteResourceReferenceDetails(state.editingTreeNode.hierarchyEditDetailId).then(async response => {
if (response.isValid) {
var parent = state.editingTreeNode.parent;
await refreshNodeContents(parent, false);
await refreshNodeIfMatchingNodeId(state.rootNode, state.editingTreeNode.nodeId, state.editingTreeNode.hierarchyEditDetailId, true);
state.updatedNode = parent;
context.commit("setEditMode", EditModeEnum.Structure);
}
Expand All @@ -429,7 +453,7 @@ const actions = <ActionTree<State, any>>{
}
}).catch(e => {
state.inError = true;
state.lastErrorMessage = "Error deleting folder reference.";
state.lastErrorMessage = "Error deleting resource reference details.";
});
},
async moveNodeUp(context: ActionContext<State, State>, payload: { node: NodeContentAdminModel }) {
Expand Down Expand Up @@ -457,6 +481,7 @@ const actions = <ActionTree<State, any>>{
await refreshNodeContents(payload.destinationNode, true).then(async x => {
await refreshNodeContents(state.editingTreeNode.parent, true).then(y => {
});
refreshHierarchyEdit(state);
state.rootNode.children.forEach(async (child) => {
if (child.nodeId != null) {
await refreshNodeContents(child, false);
Expand Down Expand Up @@ -514,6 +539,7 @@ const actions = <ActionTree<State, any>>{
state.inError = false;
contentStructureData.removeReferenceNode(payload.node.hierarchyEditDetailId).then(async response => {
await refreshNodeContents(payload.node.parent, false);
await refreshNodeIfMatchingNodeId(state.rootNode, payload.node.nodeId, payload.node.hierarchyEditDetailId, true);
if (payload.node.parent.parent != null) {
await refreshNodeContents(payload.node.parent.parent, false);
}
Expand All @@ -527,7 +553,8 @@ const actions = <ActionTree<State, any>>{
await refreshNodeContents(state.referencingResource.parent, true).then(async x => {
await refreshNodeContents(payload.destinationNode, true);
});

state.editingTreeNode.parent.childrenLoaded = false;
await refreshNodeContents(state.editingTreeNode.parent, true);
context.commit("setEditMode", EditModeEnum.Structure);
}).catch(e => {
state.inError = true;
Expand Down Expand Up @@ -562,6 +589,7 @@ const actions = <ActionTree<State, any>>{
contentStructureData.updateNodePathDisplayVersion(state.editingFolderNodeReference).then(async response => {
state.editingFolderNodeReference.nodePathDisplayVersionId = response.createdId;
await refreshNodeContents(state.editingTreeNode.parent, false);
await refreshNodeIfMatchingNodeId(state.rootNode, state.editingTreeNode.nodeId, state.editingTreeNode.hierarchyEditDetailId, true);
}).catch(e => {
state.inError = true;
state.lastErrorMessage = "Error creating folder reference.";
Expand All @@ -572,9 +600,10 @@ const actions = <ActionTree<State, any>>{
contentStructureData.updateResourceReferenceDisplayVersion(state.editingResourceNodeReference).then(async response => {
state.editingResourceNodeReference.resourceReferenceDisplayVersionId = response.createdId;
await refreshNodeContents(state.editingTreeNode.parent, false);
await refreshNodeIfMatchingNodeId(state.rootNode, state.editingTreeNode.nodeId, state.editingTreeNode.hierarchyEditDetailId, true);
}).catch(e => {
state.inError = true;
state.lastErrorMessage = "Error creating folder reference.";
state.lastErrorMessage = "Error creating resource reference.";
});
context.commit("setEditMode", EditModeEnum.Structure);
},
Expand Down
Loading
Loading