Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2 class="font-normal">{{ storageName }}</h2>

@for (file of files(); track $index) {
<div class="files-table-row flex align-items-center py-2" [class]="foldersStack().length ? 'pl-6' : 'px-3'">
<div class="flex align-items-center gap-2">
<div class="flex align-items-center gap-2 w-full">
@if (file.kind !== 'folder') {
<osf-icon class="disabled-icon" iconClass="fas fa-file disabled-icon"></osf-icon>
<div class="filename-link overflow-ellipsis disabled">{{ file?.name ?? '' }}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>
}

@if (isCollectionsRoute() || hasViewOnly() || !canEdit()) {
@if ((isCollectionsRoute() || hasViewOnly() || !canEdit()) && !isRegistration) {
@if (isPublic()) {
<div class="flex gap-2">
<i class="fas fa-lock-open"></i>
Expand All @@ -37,16 +37,16 @@
}
}

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

<div class="flex gap-2 justify-content-start">
<div class="flex gap-2 justify-content-start">
@if (isAuthenticated()) {
@if (showViewOnlyLinks() && canEdit()) {
<p-button
class="flex"
Expand Down Expand Up @@ -94,32 +94,32 @@
}
</p-button>
}
}

@if (resource.isPublic && !hasViewOnly()) {
<p-button
class="flex"
(onClick)="socialsActionMenu.toggle($event)"
[pTooltip]="'project.overview.tooltips.share' | translate"
tooltipPosition="bottom"
[ariaLabel]="'project.overview.tooltips.share' | translate"
>
<span class="font-bold">{{ socialsActionItems().length }}</span>
<i class="fas fa-share-nodes text-2xl"></i>
<p-menu appendTo="body" #socialsActionMenu [model]="socialsActionItems()" popup>
<ng-template #item let-item>
<a class="p-menu-item-link" [href]="item.url" target="_blank" rel="noopener noreferrer">
<div class="social-link flex align-items-center justify-content-center">
<osf-icon [iconClass]="`${item.icon} fa-sm`"></osf-icon>
</div>
{{ item.label | translate }}
</a>
</ng-template>
</p-menu>
</p-button>
}
</div>
@if (resource.isPublic && !hasViewOnly()) {
<p-button
class="flex"
(onClick)="socialsActionMenu.toggle($event)"
[pTooltip]="'project.overview.tooltips.share' | translate"
tooltipPosition="bottom"
[ariaLabel]="'project.overview.tooltips.share' | translate"
>
<span class="font-bold">{{ socialsActionItems().length }}</span>
<i class="fas fa-share-nodes text-2xl"></i>
<p-menu appendTo="body" #socialsActionMenu [model]="socialsActionItems()" popup>
<ng-template #item let-item>
<a class="p-menu-item-link" [href]="item.url" target="_blank" rel="noopener noreferrer">
<div class="social-link flex align-items-center justify-content-center">
<osf-icon [iconClass]="`${item.icon} fa-sm`"></osf-icon>
</div>
{{ item.label | translate }}
</a>
</ng-template>
</p-menu>
</p-button>
}
</div>
</div>
}
</div>
</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ export class OverviewToolbarComponent {

actions = createDispatchMap({ clearDuplicatedProject: ClearDuplicatedProject });

readonly ResourceType = ResourceType;

readonly forkActionItems = [
{
label: 'project.overview.actions.forkProject',
Expand All @@ -105,7 +107,6 @@ export class OverviewToolbarComponent {
},
},
];
readonly ResourceType = ResourceType;

get isRegistration(): boolean {
return this.currentResource()?.resourceType === ResourceType.Registration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class RegistryOverviewComponent {

readonly selectedRevisionIndex = signal(0);

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

toolbarResource = computed(() => {
if (this.registry()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export class RegistryOverviewState {
@Action(GetRegistryById)
getRegistryById(ctx: StateContext<RegistryOverviewStateModel>, action: GetRegistryById) {
const state = ctx.getState();

if (state.registry.isLoading) {
return;
}

ctx.patchState({
registry: {
...state.registry,
Expand Down
Loading