Skip to content
Open
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
2 changes: 1 addition & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The full testing reference (Vitest stack, recipes, anti-patterns, coverage troub
| Path | What lives here |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `src/app/workspace/` | Workflow editor — operator graph, property panel, result panel, code editor. |
| `src/app/dashboard/` | User dashboard — workflows, datasets, projects, computing units, admin. |
| `src/app/dashboard/` | User dashboard — workflows, datasets, computing units, admin. |
| `src/app/hub/` | Public hub — discover and share workflows. |
| `src/app/common/` | Cross-cutting services, types, formly extensions, and shared test helpers (`common/testing/test-utils.ts`). |
| `src/app/workspace/service/operator-metadata/` | Operator metadata service + the `Stub…Service` test doubles other specs reuse. |
Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/app-routing.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const HUB_DATASET_RESULT = `${HUB_DATASET}/result`;
export const HUB_DATASET_RESULT_DETAIL = `${HUB_DATASET_RESULT}/detail`;

export const USER = "/user";
export const USER_PROJECT = `${USER}/project`;
export const USER_WORKSPACE = `${USER}/workflow`;
export const USER_WORKFLOW = `${USER}/workflow`;
export const USER_DATASET = `${USER}/dataset`;
Expand Down
10 changes: 0 additions & 10 deletions frontend/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import { RouterModule, Routes } from "@angular/router";
import { DashboardComponent } from "./dashboard/component/dashboard.component";
import { UserWorkflowComponent } from "./dashboard/component/user/user-workflow/user-workflow.component";
import { UserQuotaComponent } from "./dashboard/component/user/user-quota/user-quota.component";
import { UserProjectSectionComponent } from "./dashboard/component/user/user-project/user-project-section/user-project-section.component";
import { UserProjectComponent } from "./dashboard/component/user/user-project/user-project.component";
import { UserComputingUnitComponent } from "./dashboard/component/user/user-computing-unit/user-computing-unit.component";
import { UserVenvComponent } from "./dashboard/component/user/user-venv/user-venv.component";
import { WorkspaceComponent } from "./workspace/component/workspace.component";
Expand Down Expand Up @@ -98,14 +96,6 @@ routes.push({
path: "user",
canActivate: [AuthGuardService],
children: [
{
path: "project",
component: UserProjectComponent,
},
{
path: "project/:pid",
component: UserProjectSectionComponent,
},
{
path: "workflow",
component: UserWorkflowComponent,
Expand Down
12 changes: 0 additions & 12 deletions frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ import { VersionsListComponent } from "./workspace/component/left-panel/versions
import { NzPaginationModule } from "ng-zorro-antd/pagination";
import { JwtModule } from "@auth0/angular-jwt";
import { AuthService } from "./common/service/user/auth.service";
import { UserProjectComponent } from "./dashboard/component/user/user-project/user-project.component";
import { UserProjectSectionComponent } from "./dashboard/component/user/user-project/user-project-section/user-project-section.component";
import { NgbdModalAddProjectWorkflowComponent } from "./dashboard/component/user/user-project/user-project-section/ngbd-modal-add-project-workflow/ngbd-modal-add-project-workflow.component";
import { NgbdModalRemoveProjectWorkflowComponent } from "./dashboard/component/user/user-project/user-project-section/ngbd-modal-remove-project-workflow/ngbd-modal-remove-project-workflow.component";
import { PresetWrapperComponent } from "./common/formly/preset-wrapper/preset-wrapper.component";
import { MarkdownDescriptionComponent } from "./dashboard/component/user/markdown-description/markdown-description.component";
import { NzModalCommentBoxComponent } from "./workspace/component/workflow-editor/comment-box-modal/nz-modal-comment-box.component";
Expand Down Expand Up @@ -125,15 +121,13 @@ import { FileSaverService } from "./dashboard/service/user/file/file-saver.servi
import { DragDropModule } from "@angular/cdk/drag-drop";
import { ScrollingModule } from "@angular/cdk/scrolling";
import { UserWorkflowListItemComponent } from "./dashboard/component/user/user-workflow/user-workflow-list-item/user-workflow-list-item.component";
import { UserProjectListItemComponent } from "./dashboard/component/user/user-project/user-project-list-item/user-project-list-item.component";
import { SortButtonComponent } from "./dashboard/component/user/sort-button/sort-button.component";
import { FiltersComponent } from "./dashboard/component/user/filters/filters.component";
import { FiltersInstructionsComponent } from "./dashboard/component/user/filters-instructions/filters-instructions.component";
import { SearchComponent } from "./dashboard/component/user/search/search.component";
import { SearchResultsComponent } from "./dashboard/component/user/search-results/search-results.component";
import { PortPropertyEditFrameComponent } from "./workspace/component/property-editor/port-property-edit-frame/port-property-edit-frame.component";
import { AdminGmailComponent } from "./dashboard/component/admin/gmail/admin-gmail.component";
import { PublicProjectComponent } from "./dashboard/component/user/user-project/public-project/public-project.component";
import { FormlyNgZorroAntdModule } from "@ngx-formly/ng-zorro-antd";
import { FlarumComponent } from "./dashboard/component/user/flarum/flarum.component";
import { NzAlertModule } from "ng-zorro-antd/alert";
Expand Down Expand Up @@ -274,7 +268,6 @@ registerLocaleData(en);
ScrollingModule,
UiUdfParametersComponent,
AdminGmailComponent,
PublicProjectComponent,
WorkspaceComponent,
MenuComponent,
OperatorMenuComponent,
Expand Down Expand Up @@ -313,10 +306,6 @@ registerLocaleData(en);
ErrorFrameComponent,
ResultTableFrameComponent,
OperatorPropertyEditFrameComponent,
UserProjectComponent,
UserProjectSectionComponent,
NgbdModalAddProjectWorkflowComponent,
NgbdModalRemoveProjectWorkflowComponent,
FilesUploaderComponent,
ConflictingFileModalContentComponent,
UserDatasetComponent,
Expand Down Expand Up @@ -344,7 +333,6 @@ registerLocaleData(en);
CollabWrapperComponent,
AboutComponent,
UserWorkflowListItemComponent,
UserProjectListItemComponent,
SortButtonComponent,
FiltersComponent,
FiltersInstructionsComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ describe("WorkflowPersistService", () => {
owners: [],
ids: [],
operators: [],
projectIds: [],
};
const keywords = ["test"];
const entry = { workflow: { wid: 1, name: "w", content: '{"operators":[]}' } } as unknown as DashboardWorkflow;
Expand Down Expand Up @@ -277,28 +276,19 @@ describe("WorkflowPersistService", () => {
expect(emitted).toBe(false);
});

it("duplicateWorkflow POSTs only wids when no pid is provided", () => {
it("duplicateWorkflow POSTs the wids", () => {
let result: DashboardWorkflow[] | undefined;
service.duplicateWorkflow([3, 4]).subscribe(r => (result = r));

const req = httpTestingController.expectOne(`${API}/${WORKFLOW_DUPLICATE_URL}`);
expect(req.request.method).toBe("POST");
expect(req.request.body).toEqual({ wids: [3, 4] });
expect(req.request.body).not.toHaveProperty("pid");

const dup = [{ workflow: { wid: 10 } }] as unknown as DashboardWorkflow[];
req.flush(dup);
expect(result).toEqual(dup);
});

it("duplicateWorkflow includes pid in the body when provided", () => {
service.duplicateWorkflow([5], 42).subscribe();

const req = httpTestingController.expectOne(`${API}/${WORKFLOW_DUPLICATE_URL}`);
expect(req.request.body).toEqual({ wids: [5], pid: 42 });
req.flush([{ workflow: { wid: 11 } }]);
});

it("duplicateWorkflow filters out an empty-array response", () => {
let emitted = false;
service.duplicateWorkflow([6]).subscribe(() => (emitted = true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,11 @@ export class WorkflowPersistService {
/**
* creates a workflow and insert it to backend database and return its information
* @param targetWids
* @param pid
*/
public duplicateWorkflow(targetWids: number[], pid?: number): Observable<DashboardWorkflow[]> {
public duplicateWorkflow(targetWids: number[]): Observable<DashboardWorkflow[]> {
return this.http
.post<DashboardWorkflow[]>(`${AppSettings.getApiEndpoint()}/${WORKFLOW_DUPLICATE_URL}`, {
wids: targetWids,
...(pid !== undefined && { pid }),
})
.pipe(filter((createdWorkflows: DashboardWorkflow[]) => createdWorkflows != null && createdWorkflows.length > 0));
}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/common/type/gui-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export interface SidebarTabs {
workflow_enabled: boolean;
dataset_enabled: boolean;
your_work_enabled: boolean;
projects_enabled: boolean;
workflows_enabled: boolean;
compute_enabled: boolean;
datasets_enabled: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,6 @@ <h2 class="page-title">General Settings</h2>
</nz-switch>
</summary>

<div class="submenu-item">
<span>Projects</span>
<nz-switch
class="tab-switch"
[(ngModel)]="sidebarTabs.projects_enabled"
[nzDisabled]="!sidebarTabs.your_work_enabled">
</nz-switch>
</div>

<div class="submenu-item">
<span>Workflows</span>
<nz-switch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ describe("AdminSettingsComponent", () => {
});
/**
* The settings form is four near-identical Save/Reset cards, three near-identical upload blocks and
* twelve switches whose keys include two confusable singular/plural pairs (workflow_enabled vs
* eleven switches whose keys include two confusable singular/plural pairs (workflow_enabled vs
* workflows_enabled, dataset_enabled vs datasets_enabled). Cross-wiring from copy-paste is the
* realistic defect here, and the suite above never renders an interaction, so none of it was pinned.
*/
Expand All @@ -438,7 +438,6 @@ describe("AdminSettingsComponent wiring", () => {
"workflow_enabled",
"dataset_enabled",
"your_work_enabled",
"projects_enabled",
"workflows_enabled",
"datasets_enabled",
"compute_enabled",
Expand Down Expand Up @@ -527,7 +526,7 @@ describe("AdminSettingsComponent wiring", () => {
});

it("locks the Your Work children until Your Work itself is on", () => {
const yourWorkChildren = [5, 6, 7, 8, 9, 10];
const yourWorkChildren = [5, 6, 7, 8, 9];

component.sidebarTabs.your_work_enabled = false;
fixture.detectChanges();
Expand All @@ -544,7 +543,7 @@ describe("AdminSettingsComponent wiring", () => {
component.sidebarTabs.your_work_enabled = false;
fixture.detectChanges();

[0, 4, 11].forEach(i => expect(switches()[i].componentInstance.nzDisabled).toBeFalsy());
[0, 4, 10].forEach(i => expect(switches()[i].componentInstance.nzDisabled).toBeFalsy());
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export class AdminSettingsComponent implements OnInit {
workflow_enabled: false,
dataset_enabled: false,
your_work_enabled: false,
projects_enabled: false,
workflows_enabled: false,
compute_enabled: false,
datasets_enabled: false,
Expand Down
13 changes: 0 additions & 13 deletions frontend/src/app/dashboard/component/dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,6 @@
nzIcon="user"
nzOpen="true">
<ul>
<li
*ngIf="sidebarTabs.projects_enabled"
nz-menu-item
nz-tooltip="Look up the user projects"
nzMatchRouter="true"
nzTooltipPlacement="right"
[routerLink]="USER_PROJECT">
<span
nz-icon
nzType="container"></span>
<span>Projects</span>
</li>

<li
*ngIf="sidebarTabs.workflows_enabled"
nz-menu-item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import {
USER_COMPUTING_UNIT,
USER_DATASET,
USER_DISCUSSION,
USER_PROJECT,
USER_QUOTA,
USER_WORKFLOW,
} from "../../app-routing.constant";
Expand Down Expand Up @@ -246,11 +245,9 @@ describe("DashboardComponent", () => {
it("should hide the navbar on workflow workspace routes", () => {
expect(component.isNavbarEnabled("/user/workflow/42")).toBe(false);
expect(component.isNavbarEnabled("/user/workflow")).toBe(true);
expect(component.isNavbarEnabled("/user/project")).toBe(true);
});

it("exposes route constants without the legacy /dashboard prefix", () => {
expect(USER_PROJECT).toBe("/user/project");
expect(USER_WORKFLOW).toBe("/user/workflow");
expect(USER_DATASET).toBe("/user/dataset");
expect(USER_COMPUTING_UNIT).toBe("/user/compute");
Expand All @@ -273,7 +270,6 @@ describe("DashboardComponent", () => {
workflow_enabled: true,
dataset_enabled: true,
your_work_enabled: true,
projects_enabled: true,
workflows_enabled: true,
datasets_enabled: true,
compute_enabled: true,
Expand All @@ -283,8 +279,8 @@ describe("DashboardComponent", () => {
};
fixture.detectChanges();

// 7 "Your Work" links (incl. Python Venvs) + 4 admin links + 1 about link + 1 feedback link = 13
expect(fixture.debugElement.queryAll(By.directive(RouterLink)).length).toBe(13);
// 6 "Your Work" links (incl. Python Venvs) + 4 admin links + 1 about link + 1 feedback link = 12
expect(fixture.debugElement.queryAll(By.directive(RouterLink)).length).toBe(12);
});

describe("sidebar active-route highlighting (#3490)", () => {
Expand All @@ -294,7 +290,6 @@ describe("DashboardComponent", () => {
workflow_enabled: true,
dataset_enabled: true,
your_work_enabled: true,
projects_enabled: true,
workflows_enabled: true,
datasets_enabled: true,
compute_enabled: true,
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/app/dashboard/component/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
USER_COMPUTING_UNIT,
USER_DATASET,
USER_DISCUSSION,
USER_PROJECT,
USER_PYTHON_VENV,
USER_QUOTA,
USER_WORKFLOW,
Expand Down Expand Up @@ -102,7 +101,6 @@ export class DashboardComponent implements OnInit {
workflow_enabled: false,
dataset_enabled: false,
your_work_enabled: false,
projects_enabled: false,
workflows_enabled: false,
datasets_enabled: false,
compute_enabled: false,
Expand All @@ -111,7 +109,6 @@ export class DashboardComponent implements OnInit {
about_enabled: false,
};

protected readonly USER_PROJECT = USER_PROJECT;
protected readonly USER_WORKFLOW = USER_WORKFLOW;
protected readonly USER_DATASET = USER_DATASET;
protected readonly USER_COMPUTING_UNIT = USER_COMPUTING_UNIT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import { ExecutionMode, Workflow, WorkflowContent } from "../../common/type/workflow";
import { DashboardEntry } from "../type/dashboard-entry";
import { DashboardProject } from "../type/dashboard-project.interface";

//the Date class creates unix timestamp based on local timezone, therefore test workflow time needs to be in local timezone
const oneDay = 86400000;
Expand Down Expand Up @@ -136,7 +135,6 @@ export const testWorkflowFileNameConflictEntries: DashboardEntry[] = [
isOwner: true,
ownerName: "Texera",
accessLevel: "Write",
projectIDs: [1],
ownerId: 1,
coverImage: null,
}),
Expand All @@ -145,7 +143,6 @@ export const testWorkflowFileNameConflictEntries: DashboardEntry[] = [
isOwner: true,
ownerName: "Texera",
accessLevel: "Write",
projectIDs: [1, 2],
ownerId: 1,
coverImage: null,
}),
Expand All @@ -154,7 +151,6 @@ export const testWorkflowFileNameConflictEntries: DashboardEntry[] = [
isOwner: true,
ownerName: "Angular",
accessLevel: "Write",
projectIDs: [1],
ownerId: 2,
coverImage: null,
}),
Expand All @@ -166,7 +162,6 @@ export const testWorkflowEntries: DashboardEntry[] = [
isOwner: true,
ownerName: "Texera",
accessLevel: "Write",
projectIDs: [1],
ownerId: 1,
coverImage: null,
}),
Expand All @@ -175,7 +170,6 @@ export const testWorkflowEntries: DashboardEntry[] = [
isOwner: true,
ownerName: "Texera",
accessLevel: "Write",
projectIDs: [1, 2],
ownerId: 1,
coverImage: null,
}),
Expand All @@ -184,7 +178,6 @@ export const testWorkflowEntries: DashboardEntry[] = [
isOwner: true,
ownerName: "Angular",
accessLevel: "Write",
projectIDs: [1],
ownerId: 2,
coverImage: null,
}),
Expand All @@ -193,7 +186,6 @@ export const testWorkflowEntries: DashboardEntry[] = [
isOwner: true,
ownerName: "Angular",
accessLevel: "Write",
projectIDs: [3],
ownerId: 2,
coverImage: null,
}),
Expand All @@ -202,18 +194,11 @@ export const testWorkflowEntries: DashboardEntry[] = [
isOwner: true,
ownerName: "UCI",
accessLevel: "Write",
projectIDs: [3],
ownerId: 3,
coverImage: null,
}),
];

export const testUserProjects: DashboardProject[] = [
{ pid: 1, name: "Project1", description: "p1", ownerId: 1, color: "#ffffff", creationTime: 0, accessLevel: "WRITE" },
{ pid: 2, name: "Project2", description: "p1", ownerId: 1, color: "#ffffff", creationTime: 0, accessLevel: "WRITE" },
{ pid: 3, name: "Project3", description: "p1", ownerId: 1, color: "#ffffff", creationTime: 0, accessLevel: "WRITE" },
];

export const mockUserInfo = {
1: { userName: "Texera", googleAvatar: "avatar_url_1" },
2: { userName: "Angular", googleAvatar: "avatar_url_2" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
<li>Search by Workflow Owner: <strong>owner: John</strong></li>
<li>Search by Workflow Id: <strong>id: workflowId</strong></li>
<li>Search by Workflows' Operators: <strong>operator: operatorName</strong></li>
<li>Search by User Projects: <strong>project: projectName</strong></li>
</ul>
You can change search parameters by:
<ul>
Expand Down
Loading
Loading