Skip to content
Draft
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: 3 additions & 5 deletions src/app/datasets/admin-tab/admin-tab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import { Store } from "@ngrx/store";
import { FileObject } from "datasets/dataset-details-dashboard/dataset-details-dashboard.component";
import { Subscription } from "rxjs";
import { take } from "rxjs/operators";
import {
CreateJobDtoV3,
OutputDatasetObsoleteDto,
} from "@scicatproject/scicat-sdk-ts-angular";
import { CreateJobDtoV3 } from "@scicatproject/scicat-sdk-ts-angular";
import { submitJobAction } from "state-management/actions/jobs.actions";
import {
selectCurrentDatablocks,
Expand All @@ -17,6 +14,7 @@ import {
selectIsAdmin,
selectIsLoading,
} from "state-management/selectors/user.selectors";
import { CurrentDataset } from "state-management/state/datasets.store";

@Component({
selector: "app-admin-tab",
Expand All @@ -26,7 +24,7 @@ import {
})
export class AdminTabComponent implements OnInit, OnDestroy {
private subscriptions: Subscription[] = [];
dataset: OutputDatasetObsoleteDto | undefined;
dataset: CurrentDataset | undefined;
datablocks$ = this.store.select(selectCurrentDatablocks);
isAdmin$ = this.store.select(selectIsAdmin);
loading$ = this.store.select(selectIsLoading);
Expand Down
14 changes: 6 additions & 8 deletions src/app/datasets/archiving.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import {
selectProfile,
} from "state-management/selectors/user.selectors";
import { RetrieveDestinations } from "app-config.service";
import {
OutputDatasetObsoleteDto,
ReturnedUserDto,
} from "@scicatproject/scicat-sdk-ts-angular";
import { ReturnedUserDto } from "@scicatproject/scicat-sdk-ts-angular";
import { CurrentDataset } from "state-management/state/datasets.store";

@Injectable()
export class ArchivingService {
Expand All @@ -23,7 +21,7 @@ export class ArchivingService {

private createJob(
user: ReturnedUserDto,
datasets: OutputDatasetObsoleteDto[],
datasets: CurrentDataset[],
archive: boolean,
destinationPath?: Record<string, string>,
// Do not specify tape copies here
Expand Down Expand Up @@ -53,7 +51,7 @@ export class ArchivingService {
}

private archiveOrRetrieve(
datasets: OutputDatasetObsoleteDto[],
datasets: CurrentDataset[],
archive: boolean,
destPath?: Record<string, string>,
): Observable<void> {
Expand All @@ -80,12 +78,12 @@ export class ArchivingService {
);
}

public archive(datasets: OutputDatasetObsoleteDto[]): Observable<void> {
public archive(datasets: CurrentDataset[]): Observable<void> {
return this.archiveOrRetrieve(datasets, true);
}

public retrieve(
datasets: OutputDatasetObsoleteDto[],
datasets: CurrentDataset[],
destinationPath: Record<string, string>,
): Observable<void> {
return this.archiveOrRetrieve(datasets, false, destinationPath);
Expand Down
7 changes: 4 additions & 3 deletions src/app/datasets/batch-view/batch-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { DatasetsListService } from "shared/services/datasets-list.service";
import { fetchInstrumentsAction } from "state-management/actions/instruments.actions";
import { TranslateService } from "@ngx-translate/core";
import { translateComponentLabel } from "shared/pipes/component-translate.pipe";
import { CurrentDataset } from "state-management/state/datasets.store";

@Component({
selector: "batch-view",
Expand All @@ -41,7 +42,7 @@ import { translateComponentLabel } from "shared/pipes/component-translate.pipe";
standalone: false,
})
export class BatchViewComponent implements OnInit, OnDestroy {
batch$: Observable<OutputDatasetObsoleteDto[]> = this.store.select(
batch$: Observable<CurrentDataset[]> = this.store.select(
selectDatasetsInBatch,
);
userProfile$ = this.store.select(selectProfile);
Expand All @@ -55,7 +56,7 @@ export class BatchViewComponent implements OnInit, OnDestroy {
appConfig = this.appConfigService.getConfig();
shareEnabled = this.appConfig.shareEnabled;

datasetList: OutputDatasetObsoleteDto[] = [];
datasetList: CurrentDataset[] = [];
public hasBatch = false;
visibleColumns: string[] = ["remove", "pid", "sourceFolder", "creationTime"];

Expand All @@ -75,7 +76,7 @@ export class BatchViewComponent implements OnInit, OnDestroy {
this.store.dispatch(clearBatchAction());
}

private storeBatch(datasetUpdatedBatch: OutputDatasetObsoleteDto[]) {
private storeBatch(datasetUpdatedBatch: CurrentDataset[]) {
this.store.dispatch(storeBatchAction({ batch: datasetUpdatedBatch }));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import {

import { AttachmentService } from "shared/services/attachment.service";
import { DatePipe } from "@angular/common";
import { OutputDatasetObsoleteDto } from "@scicatproject/scicat-sdk-ts-angular/model/outputDatasetObsoleteDto";
import { Instrument } from "@scicatproject/scicat-sdk-ts-angular";
import { ActivatedRoute, Router } from "@angular/router";
import { MatSnackBar } from "@angular/material/snack-bar";
import {
ActionItemDataset,
ActionItems,
} from "shared/modules/configurable-actions/configurable-action.interfaces";
import { CurrentDataset } from "state-management/state/datasets.store";

/**
* Component to show customizable details for a dataset, using the
Expand Down Expand Up @@ -66,7 +66,7 @@ export class DatasetDetailDynamicComponent implements OnInit, OnDestroy {
show = false;

instrument: Instrument | undefined;
dataset: OutputDatasetObsoleteDto | undefined;
dataset: CurrentDataset | undefined;

actionItems: ActionItems = {
datasets: [],
Expand Down Expand Up @@ -202,10 +202,7 @@ export class DatasetDetailDynamicComponent implements OnInit, OnDestroy {
getThumbnailSize(value: string): string {
return value ? `thumbnail-image--${value}` : "";
}
getNestedValue(
obj: OutputDatasetObsoleteDto,
path: string,
): string | string[] {
getNestedValue(obj: CurrentDataset, path: string): string | string[] {
if (!path) {
return "field source is missing";
}
Expand All @@ -222,7 +219,7 @@ export class DatasetDetailDynamicComponent implements OnInit, OnDestroy {
.reduce((prev, curr) => (prev != null ? prev[curr] : undefined), obj);
}

getInternalLinkValue(obj: OutputDatasetObsoleteDto, path: string): string {
getInternalLinkValue(obj: CurrentDataset, path: string): string {
// For instrumentName internal links, return the instrument ID instead of the name
if (path === "instrumentName" && this.instrument) {
return this.instrument.pid || "";
Expand Down Expand Up @@ -257,10 +254,7 @@ export class DatasetDetailDynamicComponent implements OnInit, OnDestroy {
}
}

getScientificMetadata(
dataset: OutputDatasetObsoleteDto,
source?: string,
): any {
getScientificMetadata(dataset: CurrentDataset, source?: string): any {
const meta = dataset?.scientificMetadata;
if (!meta) return null;
if (!source) return meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ import { Message, MessageType } from "state-management/models";
import { DOCUMENT } from "@angular/common";
import {
Instrument,
OutputDatasetObsoleteDto,
ProposalClass,
ReturnedUserDto,
OutputSampleDto,
} from "@scicatproject/scicat-sdk-ts-angular";
import { AttachmentService } from "shared/services/attachment.service";
import { CurrentDataset } from "state-management/state/datasets.store";

/**
* Component to show details for a data set, using the
Expand All @@ -74,7 +74,7 @@ export class DatasetDetailComponent implements OnInit, OnDestroy {
appConfig = this.appConfigService.getConfig();

localization = "dataset";
dataset: OutputDatasetObsoleteDto | undefined;
dataset: CurrentDataset | undefined;
datasetWithout$ = this.store.select(selectCurrentDatasetWithoutFileInfo);
attachments$ = this.store.select(selectCurrentAttachments);
loading$ = this.store.select(selectIsLoading);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import {
AfterViewChecked,
} from "@angular/core";
import { Store } from "@ngrx/store";
import {
OutputDatasetObsoleteDto,
UsersService,
} from "@scicatproject/scicat-sdk-ts-angular";
import { UsersService } from "@scicatproject/scicat-sdk-ts-angular";
import {
selectCurrentDataset,
selectIsCurrentDatasetInBatch,
Expand All @@ -21,8 +18,8 @@ import {
selectProfile,
} from "state-management/selectors/user.selectors";
import { ActivatedRoute, IsActiveMatchOptions } from "@angular/router";
import { Subscription, Observable, combineLatest, Subject } from "rxjs";
import { map, takeUntil } from "rxjs/operators";
import { Subscription, Observable, combineLatest } from "rxjs";
import { map } from "rxjs/operators";
import * as fromDatasetActions from "state-management/actions/datasets.actions";
import {
clearCurrentDatasetStateAction,
Expand All @@ -47,6 +44,7 @@ import {
import { MatDialog } from "@angular/material/dialog";
import { AppConfigService } from "app-config.service";
import { fetchInstrumentAction } from "state-management/actions/instruments.actions";
import { CurrentDataset } from "state-management/state/datasets.store";

export interface JWT {
jwt: string;
Expand Down Expand Up @@ -83,7 +81,7 @@ export class DatasetDetailsDashboardComponent
jwt$: Observable<JWT> = new Observable<JWT>();
appConfig = this.appConfigService.getConfig();

dataset: OutputDatasetObsoleteDto | undefined;
dataset: CurrentDataset | undefined;
navLinks: {
location: string;
label: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import {
SubmitCaptionEvent,
} from "shared/modules/file-uploader/file-uploader.component";
import {
Attachment,
OutputAttachmentV3Dto,
OutputDatasetObsoleteDto,
ReturnedUserDto,
} from "@scicatproject/scicat-sdk-ts-angular";
import { OwnershipService } from "shared/services/ownership.service";
Expand All @@ -23,6 +21,7 @@ import {
selectCurrentDataset,
} from "state-management/selectors/datasets.selectors";
import { selectCurrentUser } from "state-management/selectors/user.selectors";
import { CurrentDataset } from "state-management/state/datasets.store";

@Component({
selector: "app-dataset-file-uploader",
Expand All @@ -34,7 +33,7 @@ export class DatasetFileUploaderComponent implements OnInit, OnDestroy {
attachments: OutputAttachmentV3Dto[] = [];
subscriptions: Subscription[] = [];
attachment: Partial<OutputAttachmentV3Dto> = {};
dataset: OutputDatasetObsoleteDto | undefined;
dataset: CurrentDataset | undefined;
user: ReturnedUserDto | undefined;
isOwner: boolean;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Component, OnInit, OnChanges, SimpleChange } from "@angular/core";
import {
HistoryClass,
OutputDatasetObsoleteDto,
} from "@scicatproject/scicat-sdk-ts-angular";
import { HistoryClass } from "@scicatproject/scicat-sdk-ts-angular";
import {
trigger,
state,
Expand All @@ -16,6 +13,7 @@ import { selectCurrentDataset } from "state-management/selectors/datasets.select
import { Store } from "@ngrx/store";
import { AppConfigService } from "app-config.service";
import { selectIsLoading } from "state-management/selectors/user.selectors";
import { CurrentDataset } from "state-management/state/datasets.store";

export interface HistoryItem {
property: string;
Expand Down Expand Up @@ -47,7 +45,7 @@ export type HistoryWithProperties = HistoryClass & { [key: string]: unknown };
export class DatasetLifecycleComponent implements OnInit, OnChanges {
appConfig = this.appConfigService.getConfig();

dataset: OutputDatasetObsoleteDto | undefined;
dataset: CurrentDataset | undefined;
historyItems: HistoryItem[] = [];

pageSizeOptions = [10, 25, 50, 100, 500, 1000];
Expand Down
5 changes: 3 additions & 2 deletions src/app/datasets/reduce/reduce.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
DatasetClass,
OutputDatasetObsoleteDto,
} from "@scicatproject/scicat-sdk-ts-angular";
import { CurrentDataset } from "state-management/state/datasets.store";

@Component({
selector: "reduce",
Expand All @@ -33,7 +34,7 @@ import {
standalone: false,
})
export class ReduceComponent implements OnInit, OnChanges, OnDestroy {
dataset: OutputDatasetObsoleteDto | undefined;
dataset: CurrentDataset | undefined;
subscriptions: Subscription[] = [];
derivedDatasets$ = this.store
.select(selectDatasets)
Expand Down Expand Up @@ -88,7 +89,7 @@ export class ReduceComponent implements OnInit, OnChanges, OnDestroy {
private ownershipService: OwnershipService,
) {}

reduceDataset(dataset: OutputDatasetObsoleteDto): void {
reduceDataset(dataset: CurrentDataset): void {
this.store.dispatch(reduceDatasetAction({ dataset }));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "shared/modules/table/table.component";
import {
DatasetClass,
OutputDatasetObsoleteDto,
PartialOutputDatasetDto,
} from "@scicatproject/scicat-sdk-ts-angular";
import {
changeRelatedDatasetsPageAction,
Expand Down Expand Up @@ -84,7 +84,7 @@ export class RelatedDatasetsComponent {
) {}

formatTableData(
datasets: OutputDatasetObsoleteDto[],
datasets: PartialOutputDatasetDto[],
): Record<string, unknown>[] {
if (!datasets) {
return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ export class IngestorNewTransferDialogPageComponent
this.createNewTransferData.scicatHeader["dataFormat"] = "root";
this.createNewTransferData.scicatHeader["owner"] = "User";

this.createNewTransferData.scicatHeader["principalInvestigator"] =
this.userProfile.username;
this.createNewTransferData.scicatHeader["principalInvestigators"] = [
this.userProfile.username,
];
this.createNewTransferData.scicatHeader["ownerEmail"] =
this.userProfile.email;
this.createNewTransferData.scicatHeader["contactEmail"] =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { JsonSchema, JsonSchema7 } from "@jsonforms/core";
import { CreateRawDatasetObsoleteDto } from "@scicatproject/scicat-sdk-ts-angular";
import {
CreateDatasetDto,
CreateRawDatasetObsoleteDto,
} from "@scicatproject/scicat-sdk-ts-angular";
import { isArray } from "mathjs";
import { PostDatasetResponse } from "shared/sdk/models/ingestor/postDatasetResponse";
import { UserInfo } from "shared/sdk/models/ingestor/userInfo";
Expand Down Expand Up @@ -198,7 +201,7 @@ export const getJsonSchemaFromDto = (sourceFolderEditable?: boolean) => {
// 0 => number
// -1 => skip number
// -2 => optional number
const emptyDatasetForSchema: CreateRawDatasetObsoleteDto = {
const emptyDatasetForSchema: CreateDatasetDto = {
ownerGroup: "--string",
accessGroups: [],
isPublished: false,
Expand All @@ -217,7 +220,7 @@ export const getJsonSchemaFromDto = (sourceFolderEditable?: boolean) => {
description: "--string --optional",
license: "--string --optional",
keywords: [],
principalInvestigator: "--string", // skip [],
principalInvestigators: [], // skip [],
scientificMetadata: {},
ownerEmail: "--mail --optional",

Expand All @@ -236,9 +239,9 @@ export const getJsonSchemaFromDto = (sourceFolderEditable?: boolean) => {
runNumber: "--optional",
datasetlifecycle: undefined,

proposalId: "--string --optional",
sampleId: "--string --optional",
instrumentId: "--string --optional",
proposalIds: [],
sampleIds: [],
instrumentIds: [],
inputDatasets: [],
usedSoftware: [],
jobLogData: "--string --optional",
Expand Down Expand Up @@ -308,7 +311,7 @@ export const getJsonSchemaFromDto = (sourceFolderEditable?: boolean) => {
"Short comment provided by the user about a given dataset. This is additional to the description field.",
dataQualityMetrics:
"Data Quality Metrics given by the user to rate the dataset.",
principalInvestigator:
principalInvestigators:
"First name and last name of principal investigator(s). If multiple PIs are present, use a semicolon separated list. This field is required if the dataset is a Raw dataset.",
startTime:
"Start time of data acquisition for the current dataset. It is expected to be in ISO8601 format according to specifications for internet date/time format in RFC 3339, chapter 5.6.",
Expand Down
Loading
Loading