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

task/WG-274: Update projects for next #232

Merged
merged 5 commits into from
Apr 30, 2024
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 @@ -41,19 +41,18 @@ export class UsersPanelComponent implements OnInit {

ngOnInit() {
this.agaveSystemsService.list();

combineLatest([this.projectsService.activeProject, this.agaveSystemsService.projects]).subscribe(([activeProject, dsProjects]) => {
if (activeProject) {
const portalUrl = this.envService.portalUrl + 'data/browser/';
this.activeProject = this.agaveSystemsService.getProjectMetadata([activeProject], dsProjects)[0];
if (activeProject.system_id) {
if (activeProject.system_id.startsWith('project')) {
this.dsHref = portalUrl + 'projects/' + activeProject.system_id.substr(8) + '/' + activeProject.system_path + '/';
this.dsHref = portalUrl + 'projects/' + activeProject.ds_id + '/' + activeProject.system_path + '/';
if (activeProject.ds_id) {
this.projectHref = portalUrl + 'projects/' + activeProject.system_id.substr(8) + '/';
this.projectHref = portalUrl + 'projects/' + activeProject.ds_id + '/';
}
} else {
this.myDataHref = portalUrl + 'agave/' + activeProject.system_id;
this.myDataHref = portalUrl + 'tapis/' + activeProject.system_id;
this.dsHref = this.myDataHref + activeProject.system_path + '/';
}
}
Expand Down
2 changes: 1 addition & 1 deletion angular/src/app/models/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,5 +241,5 @@ export interface DesignSafeProject {
}

export interface DesignSafeProjectCollection {
projects: DesignSafeProject[];
result: DesignSafeProject[];
}
29 changes: 4 additions & 25 deletions angular/src/app/services/agave-systems.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { map } from 'rxjs/operators';
import { HttpClient } from '@angular/common/http';
import { EnvService } from '../services/env.service';
import { Project } from '../models/models';
import { projectFixturev3 } from '../fixtures/projectv3.fixture';
import { DesignSafeProjectCollection } from '../models/models';

export interface AgaveProjectsData {
projects: SystemSummary[];
Expand Down Expand Up @@ -59,14 +59,12 @@ export class AgaveSystemsService {
this._loadingProjects.next(true);
this._loadingProjectsFailedMessage.next(null);

// TODO_TAPISV3 mock a response from projects endpoint and use designsafe directly i.e. /api/projects
// See https://tacc-main.atlassian.net/browse/WG-261
this._projects.next([]);
this._loadingProjects.next(false);
/*
this.http.get<DesignSafeProjectCollection>(this.envService.designSafeUrl + `/projects/v2/`).subscribe(

this.http.get<DesignSafeProjectCollection>(this.envService.designSafeUrl + `/api/projects/v2/`).subscribe(
(resp) => {
const projectSystems = resp.projects.map((project) => {
const projectSystems = resp.result.map((project) => {
return {
id: 'project-' + project.uuid,
name: project.value.projectId,
Expand All @@ -82,25 +80,6 @@ export class AgaveSystemsService {
this._loadingProjects.next(false);
}
);
*/
const useMockSuccess = true; // Change this to false to simulate an error
if (useMockSuccess) {
const mockResponse = projectFixturev3;
const projectSystems = mockResponse.result.map((project) => {
return {
id: 'project-' + project.uuid,
name: project.value.projectId,
description: project.value.title,
};
});
this._projects.next(projectSystems);
this._loadingProjects.next(false);
} else {
const errorMessage = 'An error occurred. Contact support';
this._projects.next(null);
this._loadingProjectsFailedMessage.next(errorMessage);
this._loadingProjects.next(false);
}
}

getProjectMetadata(projects: Project[], dsProjects: SystemSummary[]): Project[] {
Expand Down
5 changes: 2 additions & 3 deletions angular/src/app/services/env.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ export class EnvService {
}

get designSafeUrl(): string {
// TODO_TAPISV3 just used for projects endpoint so shoud this be designsafe portal and not tapis tenant.
return 'https://designsafe.tapis.io/';
return 'https://designsafeci-next.tacc.utexas.edu';
}

get portalUrl(): string {
Expand Down Expand Up @@ -119,7 +118,7 @@ export class EnvService {
if (/^localhost/.test(hostname) || /^hazmapper.local/.test(hostname)) {
this._env = EnvironmentType.Local;
this._apiUrl = this.getApiUrl(environment.backend);
this._portalUrl = this.getPortalUrl(environment.backend);
this._portalUrl = this.getPortalUrl(EnvironmentType.Experimental);
// TODO: Currently taggit is hosted on same port 4200
// Have to change port on taggit or hazmapper (requires adding callbackUrl to that port)
this._taggitUrl = 'http://localhost:4200/taggit';
Expand Down
Loading