Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -13,7 +13,7 @@
[label]="submission().title | fixSpecialChar"
(onClick)="selected.emit()"
/>
@for (action of showAll ? submission().actions : submission().actions.slice(0, limitValue); track $index) {
@for (action of showAll ? visibleActions() : visibleActions().slice(0, limitValue); track $index) {
<div class="flex flex-wrap align-items-baseline gap-1 mt-2">
<span>{{ actionLabel[action.toState] | translate }}</span>
<span>{{ action.dateModified | dateAgo }}</span>
Expand All @@ -26,7 +26,7 @@
</div>
}

@if (submission().actions.length > 1) {
@if (visibleActions().length > 1) {
<p-button
class="link-btn-no-padding block mt-2"
[link]="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ContributorsListComponent } from '@osf/shared/components/contributors-l
import { IconComponent } from '@osf/shared/components/icon/icon.component';
import { TruncatedTextComponent } from '@osf/shared/components/truncated-text/truncated-text.component';
import { StopPropagationDirective } from '@osf/shared/directives/stop-propagation.directive';
import { ReviewActionTrigger } from '@osf/shared/enums/trigger-action.enum';
import { DateAgoPipe } from '@osf/shared/pipes/date-ago.pipe';
import { FixSpecialCharPipe } from '@osf/shared/pipes/fix-special-char.pipe';

Expand Down Expand Up @@ -47,6 +48,10 @@ export class PreprintSubmissionItemComponent {
readonly actionLabel = PREPRINT_ACTION_LABEL;
readonly actionState = ActionStatus;

readonly visibleActions = computed(() =>
this.submission().actions.filter((action) => action.trigger !== ReviewActionTrigger.ReportSpam)
);

limitValue = 1;
showAll = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h4>{{ submission().title }}</h4>
</p>
}

@for (action of showAll ? submission().actions : submission().actions.slice(0, limitValue); track $index) {
@for (action of showAll ? visibleActions() : visibleActions().slice(0, limitValue); track $index) {
<div class="flex flex-wrap gap-1 mt-2">
<span>{{ registryActionLabel[action.toState] | translate }}</span>
<span>{{ action.dateModified | dateAgo }}</span>
Expand All @@ -46,7 +46,7 @@ <h4>{{ submission().title }}</h4>
</div>
}

@if (submission().actions.length > 1) {
@if (visibleActions().length > 1) {
<p-button
class="link-btn-no-padding block mt-2"
[link]="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ContributorsListComponent } from '@osf/shared/components/contributors-l
import { FunderAwardsListComponent } from '@osf/shared/components/funder-awards-list/funder-awards-list.component';
import { IconComponent } from '@osf/shared/components/icon/icon.component';
import { TruncatedTextComponent } from '@osf/shared/components/truncated-text/truncated-text.component';
import { ReviewActionTrigger } from '@osf/shared/enums/trigger-action.enum';
import { DateAgoPipe } from '@osf/shared/pipes/date-ago.pipe';

import { REGISTRY_ACTION_LABEL, ReviewStatusIcon } from '../../constants';
Expand Down Expand Up @@ -47,6 +48,10 @@ export class RegistrySubmissionItemComponent {
readonly registryActionLabel = REGISTRY_ACTION_LABEL;
readonly registryActionState = ActionStatus;

readonly visibleActions = computed(() =>
this.submission().actions.filter((action) => action.trigger !== ReviewActionTrigger.ReportSpam)
);

limitValue = 1;
showAll = false;

Expand Down
Loading