Skip to content
Open
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 @@ -5,17 +5,16 @@ <h2 class="mb-2 flex">
<osf-icon iconClass="text-red-500 fas fa-hourglass-half mr-2 text-4xl"></osf-icon>
{{ 'registry.archiving.title' | translate }}
</h2>
<p class="text-red-500 mb-2 font-bold pl-5">{{ 'registry.archiving.pleaseNote' | translate }}</p>
<p class="pl-5">
<p class="ml-6">
{{ 'registry.archiving.description' | translate }}
<a [href]="'mailto:' + supportEmail">{{ supportEmail }}</a>
<a class="font-bold" [href]="'mailto:' + supportEmail">{{ supportEmail }}</a>
{{ 'registry.archiving.descriptionEnd' | translate }}
</p>
</div>
<p-divider layout="vertical" class="hidden lg:block" />
<p-divider class="lg:hidden" />
<div class="lg:w-6">
<osf-short-registration-info [registration]="registration()"></osf-short-registration-info>
<osf-short-registration-info [registration]="registration()" [showAssociatedProject]="false" />
</div>
</div>
</p-card>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ShortRegistrationInfoComponent } from '../short-registration-info/short
export class ArchivingMessageComponent {
private readonly environment = inject(ENVIRONMENT);

registration = input.required<RegistrationOverviewModel>();
readonly registration = input.required<RegistrationOverviewModel>();

readonly supportEmail = this.environment.supportEmail;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ <h4>{{ 'common.labels.dateCreated' | translate }}</h4>
<p>{{ registration().dateCreated | date }}</p>
</div>

<div class="mb-3 w-6">
<h4>{{ 'registry.overview.metadata.associatedProject' | translate }}</h4>
<a class="font-bold" [routerLink]="['/', registration().associatedProjectId]">{{ associatedProjectUrl() }}</a>
</div>
@if (showAssociatedProject()) {
<div class="mb-3 w-6" data-test-short-registration-info-associated-project>
<h4>{{ 'registry.overview.metadata.associatedProject' | translate }}</h4>
<a class="font-bold" [routerLink]="['/', registration().associatedProjectId]">{{ associatedProjectUrl() }}</a>
</div>
}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ describe('ShortRegistrationInfoComponent', () => {
expect(fixture.componentInstance.associatedProjectUrl()).toBe(expectedUrl);
});

it('should show associated project by default', () => {
const fixture = TestBed.createComponent(ShortRegistrationInfoComponent);
fixture.componentRef.setInput('registration', MOCK_REGISTRATION_OVERVIEW_MODEL);
fixture.detectChanges();

expect(
fixture.nativeElement.querySelector('[data-test-short-registration-info-associated-project]')
).not.toBeNull();
});

it('should hide associated project when showAssociatedProject is false', () => {
const fixture = TestBed.createComponent(ShortRegistrationInfoComponent);
fixture.componentRef.setInput('registration', MOCK_REGISTRATION_OVERVIEW_MODEL);
fixture.componentRef.setInput('showAssociatedProject', false);
fixture.detectChanges();

expect(fixture.nativeElement.querySelector('[data-test-short-registration-info-associated-project]')).toBeNull();
});

it('should dispatch LoadMoreBibliographicContributors', () => {
const fixture = TestBed.createComponent(ShortRegistrationInfoComponent);
fixture.componentRef.setInput('registration', MOCK_REGISTRATION_OVERVIEW_MODEL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@ import { RegistrationOverviewModel } from '../../models';
export class ShortRegistrationInfoComponent {
private readonly environment = inject(ENVIRONMENT);

registration = input.required<RegistrationOverviewModel>();
readonly registration = input.required<RegistrationOverviewModel>();
readonly showAssociatedProject = input(true);

bibliographicContributors = select(ContributorsSelectors.getBibliographicContributors);
isBibliographicContributorsLoading = select(ContributorsSelectors.isBibliographicContributorsLoading);
hasMoreBibliographicContributors = select(ContributorsSelectors.hasMoreBibliographicContributors);
readonly bibliographicContributors = select(ContributorsSelectors.getBibliographicContributors);
readonly isBibliographicContributorsLoading = select(ContributorsSelectors.isBibliographicContributorsLoading);
readonly hasMoreBibliographicContributors = select(ContributorsSelectors.hasMoreBibliographicContributors);

private readonly actions = createDispatchMap({
loadMoreBibliographicContributors: LoadMoreBibliographicContributors,
});

associatedProjectUrl = computed(() => `${this.environment.webUrl}/${this.registration().associatedProjectId}`);
readonly associatedProjectUrl = computed(
() => `${this.environment.webUrl}/${this.registration().associatedProjectId}`
);

handleLoadMoreContributors(): void {
this.actions.loadMoreBibliographicContributors(this.registration()?.id, ResourceType.Registration);
Expand Down
7 changes: 3 additions & 4 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2266,10 +2266,9 @@
},
"registry": {
"archiving": {
"description": "Changes to any files (1) in the projects or components being registered, (2) uploaded or selected as prompt responses, including those connected through add-ons during archiving will result in archiving failure and loss of your registration timestamp. Please do not modify your files until after you have received email confirmation of archiving completion. If this registration has been archiving for more than 72 hours, please email ",
"descriptionEnd": " for assistance.",
"pleaseNote": "Please note",
"title": "This registration is currently archiving, and no changes can be made at this time."
"description": "If this registration has been archiving for more than 72 hours, email ",
"descriptionEnd": " for help.",
"title": "This registration is currently archiving. No changes can be made at this time."
},
"components": {
"noComponentsFound": "No components found"
Expand Down
Loading