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
8 changes: 8 additions & 0 deletions src/app/core/store/user/user.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ export class UserState {
data: user,
},
});

localStorage.setItem('currentUser', JSON.stringify(user));
})
);
}
Expand All @@ -168,6 +170,8 @@ export class UserState {
data: user,
},
});

localStorage.setItem('currentUser', JSON.stringify(user));
})
);
}
Expand All @@ -191,6 +195,8 @@ export class UserState {
data: user,
},
});

localStorage.setItem('currentUser', JSON.stringify(user));
})
);
}
Expand Down Expand Up @@ -221,6 +227,8 @@ export class UserState {
data: user,
},
});

localStorage.setItem('currentUser', JSON.stringify(user));
})
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { DynamicDialogRef } from 'primeng/dynamicdialog';
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';

import { AddProjectFormComponent } from '@osf/shared/components';
import { MY_PROJECTS_TABLE_PARAMS } from '@osf/shared/constants';
import { ProjectFormControls } from '@osf/shared/enums';
import { CustomValidators } from '@osf/shared/helpers';
import { AddProjectFormComponent } from '@shared/components';
import { ProjectFormControls } from '@shared/enums';
import { ProjectForm } from '@shared/models';
import { CreateProject, GetMyProjects, MyResourcesSelectors } from '@shared/stores';
import { ProjectForm } from '@osf/shared/models';
import { CreateProject, GetMyProjects, MyResourcesSelectors } from '@osf/shared/stores';

@Component({
selector: 'osf-create-project-dialog',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MyResourcesItem, MyResourcesItemGetResponseJsonApi } from 'src/app/shared/models/my-resources';
import { MyResourcesItem, MyResourcesItemGetResponseJsonApi } from '@osf/shared/models';

export class MyResourcesMapper {
static fromResponse(response: MyResourcesItemGetResponseJsonApi): MyResourcesItem {
Expand Down
11 changes: 5 additions & 6 deletions src/app/features/my-projects/my-projects.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,26 @@ import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
import { FormControl, FormsModule } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';

import { CreateProjectDialogComponent } from '@osf/features/my-projects/components';
import { MyProjectsTableComponent, SelectComponent, SubHeaderComponent } from '@osf/shared/components';
import { MY_PROJECTS_TABLE_PARAMS } from '@osf/shared/constants';
import { ResourceType, SortOrder } from '@osf/shared/enums';
import { IS_MEDIUM, parseQueryFilterParams } from '@osf/shared/helpers';
import { QueryParams, TableParameters } from '@osf/shared/models';
import { BookmarksSelectors, GetBookmarksCollectionId } from '@osf/shared/stores';
import { MyResourcesItem, MyResourcesSearchFilters, QueryParams, TableParameters } from '@osf/shared/models';
import {
BookmarksSelectors,
ClearMyResources,
GetBookmarksCollectionId,
GetMyBookmarks,
GetMyPreprints,
GetMyProjects,
GetMyRegistrations,
MyResourcesSelectors,
} from '@shared/stores';
} from '@osf/shared/stores';

import { CreateProjectDialogComponent } from './components';
import { MY_PROJECTS_TABS } from './constants';
import { MyProjectsTab } from './enums';

import { MyResourcesItem, MyResourcesSearchFilters } from 'src/app/shared/models/my-resources';

@Component({
selector: 'osf-my-projects',
imports: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h2 class="text-2xl">{{ 'preprints.createServer.title' | translate }}</h2>
</a>
{{ 'preprints.createServer.and' | translate }}
<a class="font-bold" href="https://www.cos.io/product-roadmap" target="_blank">
{{ 'preprints.createServer.publicRoadmap' | translate }} </a
{{ 'preprints.createServer.publicRoadmap' | translate }}</a
>. {{ 'preprints.createServer.inputWelcome' | translate }}
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="flex flex-column flex-1 bg-white gap-5 p-3 sm:p-4">
@if (!isDuplicatesLoading() && currentResource()) {
@if (!duplicates().length) {
<h3 class="mt-5 text-center">{{ 'project.overview.dialog.fork.noForksMessage' | translate }}</h3>
<p class="mt-5 text-center">{{ 'project.overview.dialog.fork.noForksMessage' | translate }}</p>
} @else {
<p>{{ 'project.overview.dialog.fork.forksMessage' | translate }}</p>

Expand Down Expand Up @@ -63,7 +63,7 @@ <h2 class="flex align-items-center gap-2">
</div>

<div class="component-description">
<div class="flex flex-wrap align-items-center gap-1">
<div class="flex flex-wrap align-items-baseline gap-1">
<span class="font-bold">{{ 'common.labels.description' | translate }}:</span>
<osf-truncated-text [text]="duplicate.description" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
<p-button
class="w-full"
styleClass="w-full"
(click)="dialogRef.close()"
(onClick)="dialogRef.close()"
severity="info"
[label]="'project.contributors.addDialog.cancel' | translate"
></p-button>

<p-button
class="w-full"
styleClass="w-full"
(click)="addLink()"
(onClick)="addLink()"
[label]="'project.contributors.addDialog.next' | translate"
></p-button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h1 class="py-5 px-3 md:px-5 xl:px-4">{{ 'navigation.contributors' | translate }
<p-button
[label]="'project.contributors.addContributor' | translate"
[disabled]="isContributorsLoading()"
(click)="openAddContributorDialog()"
(onClick)="openAddContributorDialog()"
></p-button>

<div class="filters-container flex flex-column xl:flex-row">
Expand Down Expand Up @@ -73,13 +73,13 @@ <h1 class="py-5 px-3 md:px-5 xl:px-4">{{ 'navigation.contributors' | translate }
<p-button
class="w-3"
styleClass="w-full"
(click)="cancel()"
(onClick)="cancel()"
severity="info"
[label]="'common.buttons.cancel' | translate"
>
</p-button>

<p-button class="w-3" styleClass="w-full" (click)="save()" [label]="'common.buttons.save' | translate">
<p-button class="w-3" styleClass="w-full" (onClick)="save()" [label]="'common.buttons.save' | translate">
</p-button>
</div>
}
Expand All @@ -89,7 +89,7 @@ <h2>{{ 'project.contributors.viewOnly' | translate }}</h2>

<p>{{ 'project.contributors.createLink' | translate }}</p>

<p-button class="w-10rem" [label]="'project.contributors.createButton' | translate" (click)="createViewLink()">
<p-button class="w-10rem" [label]="'project.contributors.createButton' | translate" (onClick)="createViewLink()">
</p-button>

<osf-view-only-table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ChangeDetectionStrategy, Component, DestroyRef, inject, OnInit } from '
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';

import { STORAGE_LOCATIONS } from '@osf/core/constants';
import { STORAGE_LOCATIONS } from '@core/constants';
import { ComponentFormControls } from '@osf/shared/enums';
import { IS_XSMALL } from '@osf/shared/helpers';
import { ComponentForm } from '@osf/shared/models';
Expand Down Expand Up @@ -43,7 +43,8 @@ import { CreateComponent, GetComponents, ProjectOverviewSelectors } from '../../
})
export class AddComponentDialogComponent implements OnInit {
private store = inject(Store);
private toastService = inject(ToastService);
private readonly toastService = inject(ToastService);

protected isMobile = toSignal(inject(IS_XSMALL));
protected dialogRef = inject(DynamicDialogRef);
protected destroyRef = inject(DestroyRef);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
{{ 'project.overview.dialog.deleteComponent.confirmation' | translate }}
<strong> {{ selectedScientist() }}</strong>
</p>

<input pInputText class="mt-3" [ngModel]="userInput()" (ngModelChange)="onInputChange($event)" />

<div class="flex pt-5 justify-content-end gap-3">
<p-button
class="w-12rem btn-full-width"
[label]="'project.overview.dialog.deleteComponent.cancelButton' | translate"
severity="info"
(click)="dialogRef.close()"
(onClick)="dialogRef.close()"
[disabled]="isSubmitting()"
/>
<p-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import { ChangeDetectionStrategy, Component, computed, DestroyRef, inject, signa
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { FormsModule } from '@angular/forms';

import { DeleteComponent, GetComponents, ProjectOverviewSelectors } from '@osf/features/project/overview/store';
import { RegistryOverviewSelectors } from '@osf/features/registry/store/registry-overview';
import { ScientistsNames } from '@osf/shared/constants';
import { ResourceType } from '@shared/enums';
import { ToastService } from '@shared/services';
import { ResourceType } from '@osf/shared/enums';
import { ToastService } from '@osf/shared/services';

import { DeleteComponent, GetComponents, ProjectOverviewSelectors } from '../../store';

@Component({
selector: 'osf-delete-component-dialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class="w-12rem btn-full-width"
[label]="'common.buttons.cancel' | translate"
severity="info"
(click)="dialogRef.close()"
(onClick)="dialogRef.close()"
[disabled]="isSubmitting()"
/>
<p-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { DynamicDialogConfig, DynamicDialogRef } from 'primeng/dynamicdialog';

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

import { ProjectOverviewSelectors } from '@osf/features/project/overview/store';
import { ToastService } from '@shared/services';
import { DeleteNodeLink, GetLinkedResources, NodeLinksSelectors } from '@shared/stores';
import { ToastService } from '@osf/shared/services';
import { DeleteNodeLink, GetLinkedResources, NodeLinksSelectors } from '@osf/shared/stores';

import { ProjectOverviewSelectors } from '../../store';

@Component({
selector: 'osf-delete-node-link-dialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
<p-button
[label]="'project.overview.dialog.duplicate.cancelButton' | translate"
severity="info"
(click)="dialogRef.close(false)"
(onClick)="dialogRef.close(false)"
[disabled]="isSubmitting()"
class="btn-half-width"
/>
<p-button
[label]="'project.overview.dialog.duplicate.confirmButton' | translate"
(click)="handleDuplicateConfirm()"
(onClick)="handleDuplicateConfirm()"
[loading]="isSubmitting()"
class="btn-half-width"
/>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
.dialog-container {
line-height: 1.7rem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import { DynamicDialogRef } from 'primeng/dynamicdialog';
import { ChangeDetectionStrategy, Component, DestroyRef, inject } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';

import { DuplicateProject, ProjectOverviewSelectors } from '@osf/features/project/overview/store';
import { ToastService } from '@shared/services';
import { ToastService } from '@osf/shared/services';

import { DuplicateProject, ProjectOverviewSelectors } from '../../store';

@Component({
selector: 'osf-duplicate-dialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<p-button
[label]="'project.overview.dialog.fork.cancelButton' | translate"
severity="info"
(click)="dialogRef.close(false)"
(onClick)="dialogRef.close(false)"
[disabled]="isSubmitting()"
class="btn-full-width"
/>
<p-button
[label]="'project.overview.dialog.fork.confirmButton' | translate"
(click)="handleForkConfirm()"
(onClick)="handleForkConfirm()"
[loading]="isSubmitting()"
class="btn-full-width"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { finalize } from 'rxjs';
import { ChangeDetectionStrategy, Component, DestroyRef, inject } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';

import { ForkResource, ProjectOverviewSelectors } from '@osf/features/project/overview/store';
import { ResourceType } from '@shared/enums';
import { ToolbarResource } from '@shared/models';
import { ToastService } from '@shared/services';
import { ToolbarResource } from '@osf/shared/models';
import { ToastService } from '@osf/shared/services';

import { ForkResource, ProjectOverviewSelectors } from '../../store';

@Component({
selector: 'osf-fork-dialog',
Expand Down Expand Up @@ -45,6 +45,4 @@ export class ForkDialogComponent {
)
.subscribe();
}

protected readonly ResourceType = ResourceType;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,31 @@
[placeholder]="'project.overview.dialog.linkProject.searchObjectsPlaceholder' | translate"
[control]="searchControl"
></osf-search-input>

<p-buttonGroup>
<p-button
class="link-project-button w-6 md:w-auto"
[label]="'project.overview.dialog.linkProject.searchAllObjects' | translate"
[ngClass]="{ active: searchMode() === ResourceSearchMode.All }"
(onClick)="onSearchModeChange(ResourceSearchMode.All)"
></p-button>

<p-button
class="link-project-button w-6 md:w-auto"
[label]="'project.overview.dialog.linkProject.searchMyObjects' | translate"
[ngClass]="{ active: searchMode() === ResourceSearchMode.User }"
(onClick)="onSearchModeChange(ResourceSearchMode.User)"
></p-button>
</p-buttonGroup>

<p-buttonGroup>
<p-button
class="link-project-button w-6 md:w-auto"
[label]="'project.overview.dialog.linkProject.projects' | translate"
[ngClass]="{ active: resourceType() === ResourceType.Project }"
(onClick)="onObjectTypeChange(ResourceType.Project)"
></p-button>

<p-button
class="link-project-button w-6 md:w-auto"
[label]="'project.overview.dialog.linkProject.registrations' | translate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ import {
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { FormControl, FormsModule } from '@angular/forms';

import { ProjectOverviewSelectors } from '@osf/features/project/overview/store';
import { SearchInputComponent } from '@shared/components';
import { ResourceSearchMode, ResourceType } from '@shared/enums';
import { MyResourcesItem, MyResourcesSearchFilters } from '@shared/models';
import { SearchInputComponent } from '@osf/shared/components';
import { ResourceSearchMode, ResourceType } from '@osf/shared/enums';
import { MyResourcesItem, MyResourcesSearchFilters } from '@osf/shared/models';
import {
CreateNodeLink,
DeleteNodeLink,
Expand All @@ -37,7 +36,9 @@ import {
GetMyRegistrations,
MyResourcesSelectors,
NodeLinksSelectors,
} from '@shared/stores';
} from '@osf/shared/stores';

import { ProjectOverviewSelectors } from '../../store';

@Component({
selector: 'osf-link-resource-dialog',
Expand All @@ -63,6 +64,7 @@ export class LinkResourceDialogComponent {
protected readonly dialogRef = inject(DynamicDialogRef);
protected readonly ResourceSearchMode = ResourceSearchMode;
protected readonly ResourceType = ResourceType;

protected currentPage = signal(1);
protected searchMode = signal<ResourceSearchMode>(ResourceSearchMode.User);
protected resourceType = signal<ResourceType>(ResourceType.Project);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h2>{{ 'project.overview.linkedProjects.title' | translate }}</h2>
<p-button
severity="secondary"
[label]="'project.overview.components.linkProjectsButton' | translate"
(click)="openLinkProjectModal()"
(onClick)="openLinkProjectModal()"
/>
}
</div>
Expand Down
Loading