Skip to content

Commit

Permalink
feat: Switch owner subview to all subview if has shared resources
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgrozav committed Nov 21, 2022
1 parent 3ac9ba3 commit d5f4db6
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
</ul>
<n8n-text color="text-base" size="medium" v-else>
{{ $locale.baseText(`${resourceKey}.noResults`) }}
<template v-if="!hasFilters && isOwnerSubview && resourcesNotOwned.length > 0">
<template v-if="shouldChangeToAllSubview">
<span v-if="!filters.search">
({{ $locale.baseText(`${resourceKey}.noResults.switchToShared.preamble`) }}
<n8n-link @click="setOwnerSubview(false)">{{$locale.baseText(`${resourceKey}.noResults.switchToShared.link`) }}</n8n-link>)
Expand Down Expand Up @@ -275,6 +275,9 @@ export default mixins(
return resource.ownedBy && resource.ownedBy.id !== this.usersStore.currentUser?.id;
});
},
shouldChangeToAllSubview(): boolean {
return !this.hasFilters && this.isOwnerSubview && this.resourcesNotOwned.length > 0;
},
},
methods: {
async onMounted() {
Expand Down Expand Up @@ -369,6 +372,11 @@ export default mixins(
sortBy() {
this.sendSortingTelemetry();
},
loading(value) {
if (!value && this.shouldChangeToAllSubview) {
this.isOwnerSubview = false;
}
},
},
});
</script>
Expand Down

0 comments on commit d5f4db6

Please sign in to comment.