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
39 changes: 0 additions & 39 deletions src/app/core/animations/fade.in-out.animation.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Component: Cookie Consent Banner', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [OSFTestingModule, CookieConsentBannerComponent, MockComponent(IconComponent)],
imports: [CookieConsentBannerComponent, OSFTestingModule, MockComponent(IconComponent)],
providers: [{ provide: CookieService, useValue: cookieServiceMock }],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,20 @@ import { Message } from 'primeng/message';
import { isPlatformBrowser } from '@angular/common';
import { ChangeDetectionStrategy, Component, inject, PLATFORM_ID, signal } from '@angular/core';

import { fadeInOutAnimation } from '@core/animations/fade.in-out.animation';
import { IconComponent } from '@osf/shared/components/icon/icon.component';

/**
* Displays a cookie consent banner until the user accepts.
*
* - Uses `ngx-cookie-service` to persist acceptance across sessions.
* - Automatically hides the banner if consent is already recorded.
* - Animates in/out using the `fadeInOutAnimation`.
* - Supports translation via `TranslatePipe`.
*/
@Component({
selector: 'osf-cookie-consent-banner',
templateUrl: './cookie-consent-banner.component.html',
styleUrls: ['./cookie-consent-banner.component.scss'],
imports: [Button, TranslatePipe, IconComponent, Message],
animations: [fadeInOutAnimation],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CookieConsentBannerComponent {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
@if (maintenance() && !dismissed()) {
<p-message
class="block p-3"
styleClass="w-full"
icon="pi pi-info-circle"
[severity]="maintenance()?.severity"
[text]="maintenance()?.message"
[closable]="true"
(onClose)="dismiss()"
class="block p-3"
icon="pi pi-info-circle"
@fadeInOut
>
</p-message>
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { CookieService } from 'ngx-cookie-service';

import { MessageModule } from 'primeng/message';

import { of } from 'rxjs';

import { HttpClient } from '@angular/common/http';
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

import { MaintenanceBannerComponent } from './maintenance-banner.component';

import { OSFTestingModule } from '@testing/osf.testing.module';

describe('Component: Maintenance Banner', () => {
let fixture: ComponentFixture<MaintenanceBannerComponent>;
let httpClient: { get: jest.Mock };
Expand All @@ -25,7 +24,7 @@ describe('Component: Maintenance Banner', () => {
httpClient = { get: jest.fn() } as any;

await TestBed.configureTestingModule({
imports: [MaintenanceBannerComponent, NoopAnimationsModule, MessageModule],
imports: [MaintenanceBannerComponent, OSFTestingModule],
providers: [
{ provide: CookieService, useValue: cookieService },
{ provide: HttpClient, useValue: httpClient },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { MessageModule } from 'primeng/message';
import { CommonModule, isPlatformBrowser } from '@angular/common';
import { ChangeDetectionStrategy, Component, inject, OnInit, PLATFORM_ID, signal } from '@angular/core';

import { fadeInOutAnimation } from '@core/animations/fade.in-out.animation';

import { MaintenanceModel } from '../models/maintenance.model';
import { MaintenanceService } from '../services/maintenance.service';

Expand All @@ -17,8 +15,6 @@ import { MaintenanceService } from '../services/maintenance.service';
* the banner. If not, it queries the maintenance status from the server and displays
* the maintenance message if one is active.
*
* The component supports animation via `fadeInOutAnimation` and is optimized with `OnPush` change detection.
*
* @example
* ```html
* <osf-maintenance-banner />
Expand All @@ -29,7 +25,6 @@ import { MaintenanceService } from '../services/maintenance.service';
imports: [CommonModule, MessageModule],
templateUrl: './maintenance-banner.component.html',
styleUrls: ['./maintenance-banner.component.scss'],
animations: [fadeInOutAnimation],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MaintenanceBannerComponent implements OnInit {
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/services/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { inject, Injectable } from '@angular/core';
import { ENVIRONMENT } from '@core/provider/environment.provider';
import { ProfileSettingsKey } from '@osf/shared/enums/profile-settings-key.enum';
import { UserMapper } from '@osf/shared/mappers/user';
import { UserData, UserModel } from '@osf/shared/models/user/user.model';
import { JsonApiService } from '@osf/shared/services/json-api.service';
import { ProfileSettingsUpdate } from '@shared/models/profile-settings-update.model';
import { UserData, UserModel } from '@shared/models/user/user.models';
import {
UserAcceptedTermsOfServiceJsonApi,
UserDataJsonApi,
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/store/user/user.actions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Education } from '@osf/shared/models/user/education.model';
import { Employment } from '@osf/shared/models/user/employment.model';
import { SocialModel } from '@osf/shared/models/user/social.model';
import { UserModel } from '@osf/shared/models/user/user.models';
import { UserModel } from '@osf/shared/models/user/user.model';

export class GetCurrentUser {
static readonly type = '[User] Get Current User';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/store/user/user.model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AsyncStateModel } from '@osf/shared/models/store/async-state.model';
import { UserModel } from '@osf/shared/models/user/user.models';
import { UserModel } from '@osf/shared/models/user/user.model';

export interface UserStateModel {
currentUser: AsyncStateModel<UserModel | null>;
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/store/user/user.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Selector } from '@ngxs/store';
import { Education } from '@osf/shared/models/user/education.model';
import { Employment } from '@osf/shared/models/user/employment.model';
import { SocialModel } from '@osf/shared/models/user/social.model';
import { UserModel } from '@osf/shared/models/user/user.models';
import { UserModel } from '@osf/shared/models/user/user.model';

import { UserStateModel } from './user.model';
import { UserState } from './user.state';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/store/user/user.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { UserService } from '@core/services/user.service';
import { ProfileSettingsKey } from '@osf/shared/enums/profile-settings-key.enum';
import { removeNullable } from '@osf/shared/helpers/remove-nullable.helper';
import { UserMapper } from '@osf/shared/mappers/user';
import { UserModel } from '@osf/shared/models/user/user.model';
import { SocialModel } from '@shared/models/user/social.model';
import { UserModel } from '@shared/models/user/user.models';

import {
AcceptTermsOfServiceByUser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ActivatedRoute } from '@angular/router';
import { BarChartComponent } from '@osf/shared/components/bar-chart/bar-chart.component';
import { LoadingSpinnerComponent } from '@osf/shared/components/loading-spinner/loading-spinner.component';
import { StatisticCardComponent } from '@osf/shared/components/statistic-card/statistic-card.component';
import { DatasetInput } from '@osf/shared/models/charts/dataset-input';
import { DatasetInput } from '@osf/shared/models/charts/dataset-input.model';
import { SelectOption } from '@osf/shared/models/select-option.model';
import { DoughnutChartComponent } from '@shared/components/doughnut-chart/doughnut-chart.component';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Institution } from '@osf/shared/models/institutions/institutions.models';
import { Institution } from '@osf/shared/models/institutions/institutions.model';
import { AsyncStateModel } from '@osf/shared/models/store/async-state.model';
import { AsyncStateWithTotalCount } from '@osf/shared/models/store/async-state-with-total-count.model';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Selector } from '@ngxs/store';

import { Institution } from '@osf/shared/models/institutions/institutions.models';
import { Institution } from '@osf/shared/models/institutions/institutions.model';

import { InstitutionDepartment, InstitutionSearchFilter, InstitutionSummaryMetrics, InstitutionUser } from '../models';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { catchError, tap, throwError } from 'rxjs';
import { inject, Injectable } from '@angular/core';

import { handleSectionError } from '@osf/shared/helpers/state-error.handler';
import { Institution } from '@osf/shared/models/institutions/institutions.models';
import { Institution } from '@osf/shared/models/institutions/institutions.model';
import { InstitutionsService } from '@osf/shared/services/institutions.service';

import { InstitutionsAdminService } from '../services/institutions-admin.service';
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/analytics/analytics.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { ViewOnlyLinkMessageComponent } from '@osf/shared/components/view-only-l
import { IS_WEB } from '@osf/shared/helpers/breakpoints.tokens';
import { replaceBadEncodedChars } from '@osf/shared/helpers/format-bad-encoding.helper';
import { Primitive } from '@osf/shared/helpers/types.helper';
import { DatasetInput } from '@osf/shared/models/charts/dataset-input';
import { DatasetInput } from '@osf/shared/models/charts/dataset-input.model';
import { ViewOnlyLinkHelperService } from '@osf/shared/services/view-only-link-helper.service';

import { AnalyticsKpiComponent } from './components';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { collectionFilterTypes } from '@osf/features/collections/constants';
import { AddToCollectionSteps, CollectionFilterType } from '@osf/features/collections/enums';
import { CollectionFilterEntry } from '@osf/features/collections/models/collection-filter-entry.model';
import { AddToCollectionSelectors } from '@osf/features/collections/store/add-to-collection';
import { CollectionSubmissionWithGuid } from '@osf/shared/models/collections/collections.models';
import { CollectionSubmissionWithGuid } from '@osf/shared/models/collections/collections.model';
import { CollectionsSelectors, GetCollectionDetails } from '@osf/shared/stores/collections';

@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { TruncatedTextComponent } from '@osf/shared/components/truncated-text/tr
import { InputLimits } from '@osf/shared/constants/input-limits.const';
import { ResourceType } from '@osf/shared/enums/resource-type.enum';
import { LicenseModel } from '@osf/shared/models/license/license.model';
import { ProjectModel } from '@osf/shared/models/projects/projects.models';
import { ProjectModel } from '@osf/shared/models/projects/projects.model';
import { InterpolatePipe } from '@osf/shared/pipes/interpolate.pipe';
import { ToastService } from '@osf/shared/services/toast.service';
import { GetAllContributors } from '@osf/shared/stores/contributors';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { ChangeDetectionStrategy, Component, computed, input, output, signal } f

import { AddToCollectionSteps } from '@osf/features/collections/enums';
import { ProjectSelectorComponent } from '@osf/shared/components/project-selector/project-selector.component';
import { ProjectModel } from '@osf/shared/models/projects/projects.model';
import { SetSelectedProject } from '@osf/shared/stores/projects';
import { ProjectModel } from '@shared/models/projects/projects.models';
import { CollectionsSelectors, GetUserCollectionSubmissions } from '@shared/stores/collections';
import { ProjectsSelectors } from '@shared/stores/projects/projects.selectors';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ComponentRef } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ContributorsListComponent } from '@osf/shared/components/contributors-list/contributors-list.component';
import { CollectionSubmissionWithGuid } from '@osf/shared/models/collections/collections.models';
import { CollectionSubmissionWithGuid } from '@osf/shared/models/collections/collections.model';

import { CollectionsSearchResultCardComponent } from './collections-search-result-card.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/co

import { collectionFilterNames } from '@osf/features/collections/constants';
import { ContributorsListComponent } from '@osf/shared/components/contributors-list/contributors-list.component';
import { CollectionSubmissionWithGuid } from '@osf/shared/models/collections/collections.models';
import { CollectionSubmissionWithGuid } from '@osf/shared/models/collections/collections.model';

@Component({
selector: 'osf-collections-search-result-card',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';

import { ProjectMetadataFormControls } from '@osf/features/collections/enums';
import { CustomValidators } from '@osf/shared/helpers/custom-form-validators.helper';
import { ProjectModel } from '@osf/shared/models/projects/projects.model';
import { LicenseModel } from '@shared/models/license/license.model';
import { ProjectMetadataUpdatePayload } from '@shared/models/project-metadata-update-payload.model';
import { ProjectModel } from '@shared/models/projects/projects.models';

import { ProjectMetadataForm } from '../models/project-metadata-form.model';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CollectionProjectSubmission } from '@osf/shared/models/collections/collections.models';
import { CollectionProjectSubmission } from '@osf/shared/models/collections/collections.model';
import { LicenseModel } from '@shared/models/license/license.model';
import { AsyncStateModel } from '@shared/models/store/async-state.model';

Expand Down
2 changes: 1 addition & 1 deletion src/app/features/contributors/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './resource-info.model';
export * from './view-only-components.models';
export * from './view-only-components.model';
4 changes: 2 additions & 2 deletions src/app/features/home/pages/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import { SearchInputComponent } from '@osf/shared/components/search-input/search
import { SubHeaderComponent } from '@osf/shared/components/sub-header/sub-header.component';
import { DEFAULT_TABLE_PARAMS } from '@osf/shared/constants/default-table-params.constants';
import { SortOrder } from '@osf/shared/enums/sort-order.enum';
import { MyResourcesItem } from '@osf/shared/models/my-resources/my-resources.model';
import { MyResourcesSearchFilters } from '@osf/shared/models/my-resources/my-resources-search-filters.model';
import { CustomDialogService } from '@osf/shared/services/custom-dialog.service';
import { ProjectRedirectDialogService } from '@osf/shared/services/project-redirect-dialog.service';
import { ClearMyResources, GetMyProjects, MyResourcesSelectors } from '@osf/shared/stores/my-resources';
import { MyResourcesItem } from '@shared/models/my-resources/my-resources.models';
import { MyResourcesSearchFilters } from '@shared/models/my-resources/my-resources-search-filters.models';
import { TableParameters } from '@shared/models/table-parameters.model';

@Component({
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/meetings/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './meeting-feature-card.model';
export * from './meetings.models';
export * from './meetings.model';
export * from './meetings-json-api.model';
export * from './partner-organization.model';
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Card } from 'primeng/card';
import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';

import { AffiliatedInstitutionsViewComponent } from '@osf/shared/components/affiliated-institutions-view/affiliated-institutions-view.component';
import { Institution } from '@osf/shared/models/institutions/institutions.models';
import { Institution } from '@osf/shared/models/institutions/institutions.model';

@Component({
selector: 'osf-metadata-affiliated-institutions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MockComponents } from 'ng-mocks';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { CollectionSubmissionReviewState } from '@osf/shared/enums/collection-submission-review-state.enum';
import { CollectionSubmission } from '@osf/shared/models/collections/collections.models';
import { CollectionSubmission } from '@osf/shared/models/collections/collections.model';

import { MetadataCollectionItemComponent } from './metadata-collection-item.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { RouterLink } from '@angular/router';

import { collectionFilterNames } from '@osf/features/collections/constants';
import { CollectionSubmissionReviewState } from '@osf/shared/enums/collection-submission-review-state.enum';
import { CollectionSubmission } from '@osf/shared/models/collections/collections.models';
import { CollectionSubmission } from '@osf/shared/models/collections/collections.model';
import { KeyValueModel } from '@osf/shared/models/common/key-value.model';
import { CollectionStatusSeverityPipe } from '@osf/shared/pipes/collection-status-severity.pipe';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Skeleton } from 'primeng/skeleton';

import { ChangeDetectionStrategy, Component, input } from '@angular/core';

import { CollectionSubmission } from '@osf/shared/models/collections/collections.models';
import { CollectionSubmission } from '@osf/shared/models/collections/collections.model';

import { MetadataCollectionItemComponent } from '../metadata-collection-item/metadata-collection-item.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { DynamicDialogConfig, DynamicDialogRef } from 'primeng/dynamicdialog';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AffiliatedInstitutionSelectComponent } from '@osf/shared/components/affiliated-institution-select/affiliated-institution-select.component';
import { Institution } from '@osf/shared/models/institutions/institutions.model';
import { InstitutionsSelectors } from '@osf/shared/stores/institutions';
import { Institution } from '@shared/models/institutions/institutions.models';

import { AffiliatedInstitutionsDialogComponent } from './affiliated-institutions-dialog.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, inject, OnInit, signal } from '@ang
import { ReactiveFormsModule } from '@angular/forms';

import { AffiliatedInstitutionSelectComponent } from '@osf/shared/components/affiliated-institution-select/affiliated-institution-select.component';
import { Institution } from '@osf/shared/models/institutions/institutions.models';
import { Institution } from '@osf/shared/models/institutions/institutions.model';
import { FetchUserInstitutions, InstitutionsSelectors } from '@osf/shared/stores/institutions';

@Component({
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/metadata/models/metadata.model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Institution } from '@osf/shared/models/institutions/institutions.model';
import { UserPermissions } from '@shared/enums/user-permissions.enum';
import { IdentifierModel } from '@shared/models/identifiers/identifier.model';
import { Institution } from '@shared/models/institutions/institutions.models';
import { LicenseModel } from '@shared/models/license/license.model';

export interface MetadataModel {
Expand Down
Loading