Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: renamed generic data collection endpoint and properties #17

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 @@ -23,7 +23,7 @@ export class GenericDataCollectionDetailComponent implements OnInit, AfterViewIn

genericDataCollection: GenericDataCollection = new GenericDataCollection();
job: Job = null;
genericDataId: Observable<string>;
genericDataCollectionId: Observable<string>;
mohamedOuladi marked this conversation as resolved.
Show resolved Hide resolved
uploadOption = 'regular';
genericFiles: Observable<GenericFile[]>;
resultsLengthGenericFiles = 0;
Expand All @@ -47,6 +47,9 @@ export class GenericDataCollectionDetailComponent implements OnInit, AfterViewIn
private router: Router,
private genericDataCollectionService: GenericDataCollectionService,
private keycloakService: KeycloakService) {
this.genericDataCollectionId = this.route.params.pipe(
map(data => data.id)
);
this.genericFilesParamsChange = new BehaviorSubject({
index: 0,
size: this.pageSize,
Expand Down Expand Up @@ -101,7 +104,7 @@ export class GenericDataCollectionDetailComponent implements OnInit, AfterViewIn
}

getGenericDataCollection() {
mohamedOuladi marked this conversation as resolved.
Show resolved Hide resolved
return this.genericDataId.pipe(
return this.genericDataCollectionId.pipe(
switchMap(id => this.genericDataCollectionService.getById(id))
);
}
Expand Down Expand Up @@ -214,8 +217,8 @@ export class GenericDataCollectionDetailComponent implements OnInit, AfterViewIn

makePublicCollection(): void {
this.genericDataCollectionService.makePublicGenericDataCollection(
this.genericDataCollection).subscribe(genericData => {
this.genericDataCollection = genericData;
this.genericDataCollection).subscribe(genericDataCollection => {
this.genericDataCollection = genericDataCollection;
}, error => {
const modalRefErr = this.modalService.open(ModalErrorComponent);
modalRefErr.componentInstance.title = 'Error while changing Collection visibility to public';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { GenericFile, PaginatedGenericFiles } from './generic-file';
})
export class GenericDataCollectionService implements DataService<GenericDataCollection, PaginatedGenericDataCollections> {

private genericDataCollectionUrl = this.env.apiRootUrl + '/genericDatas';
private genericDataCollectionUrl = this.env.apiRootUrl + '/genericDataCollections';
private genericDataCollectionUiPath = this.env.uiPaths.genericDataCollectionsPath;

constructor(
Expand All @@ -39,7 +39,7 @@ export class GenericDataCollectionService implements DataService<GenericDataColl
}
return this.http.get<any>(this.genericDataCollectionUrl, httpOptions).pipe(
map((result: any) => {
result.data = result._embedded.genericDatas;
result.data = result._embedded.genericDataCollections;
return result;
}));
}
Expand All @@ -59,7 +59,7 @@ export class GenericDataCollectionService implements DataService<GenericDataColl
httpOptions.params = httpParams;
return this.http.get<any>(this.genericDataCollectionUrl + '/search/findByNameContainingIgnoreCase', httpOptions).pipe(
map((result: any) => {
result.data = result._embedded.genericDatas;
result.data = result._embedded.genericDataCollections;
return result;
}));
}
Expand Down