Skip to content

Commit e75ffcd

Browse files
authored
Fix/844 bug (#520)
* fix(registry): fixed share options for not logged in user * fix(files): fixed long title * fix(registry): fixed refresh bug
1 parent 9b52cdd commit e75ffcd

File tree

5 files changed

+43
-37
lines changed

5 files changed

+43
-37
lines changed

src/app/features/files/components/move-file-dialog/move-file-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h2 class="font-normal">{{ storageName }}</h2>
2626

2727
@for (file of files(); track $index) {
2828
<div class="files-table-row flex align-items-center py-2" [class]="foldersStack().length ? 'pl-6' : 'px-3'">
29-
<div class="flex align-items-center gap-2">
29+
<div class="flex align-items-center gap-2 w-full">
3030
@if (file.kind !== 'folder') {
3131
<osf-icon class="disabled-icon" iconClass="fas fa-file disabled-icon"></osf-icon>
3232
<div class="filename-link overflow-ellipsis disabled">{{ file?.name ?? '' }}</div>

src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.html

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
}
2525

26-
@if (isCollectionsRoute() || hasViewOnly() || !canEdit()) {
26+
@if ((isCollectionsRoute() || hasViewOnly() || !canEdit()) && !isRegistration) {
2727
@if (isPublic()) {
2828
<div class="flex gap-2">
2929
<i class="fas fa-lock-open"></i>
@@ -37,16 +37,16 @@
3737
}
3838
}
3939

40-
@if (isAuthenticated()) {
41-
<div class="flex ml-auto">
42-
<div class="flex flex-1 flex-column-reverse gap-3 justify-content-end sm:gap-3 sm:flex-row-reverse lg:flex-row">
43-
@if (resource.storage && !isCollectionsRoute()) {
44-
<p class="font-bold mr-2 ml-0 mt-2 sm:ml-2 sm:mt-0 sm:align-self-center storage">
45-
{{ +resource.storage.storageUsage | fileSize }}
46-
</p>
47-
}
40+
<div class="flex ml-auto">
41+
<div class="flex flex-1 flex-column-reverse gap-3 justify-content-end sm:gap-3 sm:flex-row-reverse lg:flex-row">
42+
@if (resource.storage && !isCollectionsRoute()) {
43+
<p class="font-bold mr-2 ml-0 mt-2 sm:ml-2 sm:mt-0 sm:align-self-center storage">
44+
{{ +resource.storage.storageUsage | fileSize }}
45+
</p>
46+
}
4847

49-
<div class="flex gap-2 justify-content-start">
48+
<div class="flex gap-2 justify-content-start">
49+
@if (isAuthenticated()) {
5050
@if (showViewOnlyLinks() && canEdit()) {
5151
<p-button
5252
class="flex"
@@ -94,32 +94,32 @@
9494
}
9595
</p-button>
9696
}
97+
}
9798

98-
@if (resource.isPublic && !hasViewOnly()) {
99-
<p-button
100-
class="flex"
101-
(onClick)="socialsActionMenu.toggle($event)"
102-
[pTooltip]="'project.overview.tooltips.share' | translate"
103-
tooltipPosition="bottom"
104-
[ariaLabel]="'project.overview.tooltips.share' | translate"
105-
>
106-
<span class="font-bold">{{ socialsActionItems().length }}</span>
107-
<i class="fas fa-share-nodes text-2xl"></i>
108-
<p-menu appendTo="body" #socialsActionMenu [model]="socialsActionItems()" popup>
109-
<ng-template #item let-item>
110-
<a class="p-menu-item-link" [href]="item.url" target="_blank" rel="noopener noreferrer">
111-
<div class="social-link flex align-items-center justify-content-center">
112-
<osf-icon [iconClass]="`${item.icon} fa-sm`"></osf-icon>
113-
</div>
114-
{{ item.label | translate }}
115-
</a>
116-
</ng-template>
117-
</p-menu>
118-
</p-button>
119-
}
120-
</div>
99+
@if (resource.isPublic && !hasViewOnly()) {
100+
<p-button
101+
class="flex"
102+
(onClick)="socialsActionMenu.toggle($event)"
103+
[pTooltip]="'project.overview.tooltips.share' | translate"
104+
tooltipPosition="bottom"
105+
[ariaLabel]="'project.overview.tooltips.share' | translate"
106+
>
107+
<span class="font-bold">{{ socialsActionItems().length }}</span>
108+
<i class="fas fa-share-nodes text-2xl"></i>
109+
<p-menu appendTo="body" #socialsActionMenu [model]="socialsActionItems()" popup>
110+
<ng-template #item let-item>
111+
<a class="p-menu-item-link" [href]="item.url" target="_blank" rel="noopener noreferrer">
112+
<div class="social-link flex align-items-center justify-content-center">
113+
<osf-icon [iconClass]="`${item.icon} fa-sm`"></osf-icon>
114+
</div>
115+
{{ item.label | translate }}
116+
</a>
117+
</ng-template>
118+
</p-menu>
119+
</p-button>
120+
}
121121
</div>
122122
</div>
123-
}
123+
</div>
124124
</div>
125125
}

src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ export class OverviewToolbarComponent {
8989

9090
actions = createDispatchMap({ clearDuplicatedProject: ClearDuplicatedProject });
9191

92+
readonly ResourceType = ResourceType;
93+
9294
readonly forkActionItems = [
9395
{
9496
label: 'project.overview.actions.forkProject',
@@ -105,7 +107,6 @@ export class OverviewToolbarComponent {
105107
},
106108
},
107109
];
108-
readonly ResourceType = ResourceType;
109110

110111
get isRegistration(): boolean {
111112
return this.currentResource()?.resourceType === ResourceType.Registration;

src/app/features/registry/pages/registry-overview/registry-overview.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class RegistryOverviewComponent {
157157

158158
readonly selectedRevisionIndex = signal(0);
159159

160-
showToolbar = computed(() => !this.registry()?.archiving && !this.registry()?.withdrawn && !this.hasNoPermissions());
160+
showToolbar = computed(() => !this.registry()?.archiving && !this.registry()?.withdrawn);
161161

162162
toolbarResource = computed(() => {
163163
if (this.registry()) {

src/app/features/registry/store/registry-overview/registry-overview.state.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ export class RegistryOverviewState {
3535
@Action(GetRegistryById)
3636
getRegistryById(ctx: StateContext<RegistryOverviewStateModel>, action: GetRegistryById) {
3737
const state = ctx.getState();
38+
39+
if (state.registry.isLoading) {
40+
return;
41+
}
42+
3843
ctx.patchState({
3944
registry: {
4045
...state.registry,

0 commit comments

Comments
 (0)