Skip to content

Commit

Permalink
Merge pull request #132 from dinukadesilva/gh-131-fix-shared-by-me-re…
Browse files Browse the repository at this point in the history
…source-list

gh-131: Fix shared by me resource list
  • Loading branch information
dinukadesilva authored Dec 1, 2022
2 parents 3f4dcd8 + 909d674 commit e15c9f9
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/pages/resource/resource-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ export default {
let collectionsLink = '/collections';
let queryParams = [];
if (this.sharedBy) {
queryParams.push("sharedByMe=true");
} else if (this.sharedWith) {
queryParams.push("sharedWithMe=true");
}
// if (this.sharedBy) {
// queryParams.push("sharedByMe=true");
// } else if (this.sharedWith) {
// queryParams.push("sharedWithMe=true");
// }
if (this.parentResource && this.parentResource.type === EmcResource.EMC_RESOURCE_TYPE.EMC_RESOURCE_TYPE_COLLECTION_GROUP) {
queryParams.push(`types=${EmcResource.EMC_RESOURCE_TYPE.EMC_RESOURCE_TYPE_COLLECTION_GROUP}`);
Expand Down Expand Up @@ -389,6 +389,13 @@ export default {
return this.parentDirectory !== "/";
},
directories() {
if (this.resources && (this.sharedWith || this.sharedBy)) {
return this.resources.map(resource => {
let _directory = resource.resourcePath.replace(`${this.rootDirectory}${this.parentDirectory}`, "");
return {...resource, name: _directory};
});
}
if (!this.parentResourceId && this.resources) {
const _directories = [];
const _directoriesMap = {};
Expand Down Expand Up @@ -479,13 +486,13 @@ export default {
resourceLink = `/collections?parentDirectory=${resource.path}`;
}
if (this.sharedBy) {
resourceLink += `&sharedByMe=true`;
}
if (this.sharedWith) {
resourceLink += `&sharedWithMe=true`;
}
// if (this.sharedBy) {
// resourceLink += `&sharedByMe=true`;
// }
//
// if (this.sharedWith) {
// resourceLink += `&sharedWithMe=true`;
// }
return resourceLink;
},
Expand Down

0 comments on commit e15c9f9

Please sign in to comment.