diff --git a/frontend/dashboard-2/.env.mock b/frontend/dashboard-2/.env.mock new file mode 100644 index 000000000..de4516fc3 --- /dev/null +++ b/frontend/dashboard-2/.env.mock @@ -0,0 +1 @@ +VITE_ENABLE_MOCKING=true diff --git a/frontend/dashboard-2/.env.production b/frontend/dashboard-2/.env.production new file mode 100644 index 000000000..3937a7882 --- /dev/null +++ b/frontend/dashboard-2/.env.production @@ -0,0 +1,9 @@ +VITE_USE_AUTH_GATEWAY = "{{ USE_AUTH_GATEWAY }}" +VITE_KEYCLOAK_URL = "{{ KEYCLOAK_URL }}" +VITE_KEYCLOAK_REALM = "{{ KEYCLOAK_REALM }}" +VITE_KEYCLOAK_CLIENT = "{{ KEYCLOAK_CLIENT }}" +VITE_KEYCLOAK_SCOPE = "{{ KEYCLOAK_SCOPE }}" +VITE_GRAPH_URL = "{{ GRAPH_URL }}" +VITE_GRAPH_WS_URL = "{{ GRAPH_WS_URL }}" +VITE_AUTH_GATEWAY_LOGIN_URL = "{{ AUTH_GATEWAY_LOGIN_URL }}" +VITE_LOGOUT_URL = "{{ LOGOUT_URL }}" diff --git a/frontend/dashboard-2/.env.test b/frontend/dashboard-2/.env.test new file mode 100644 index 000000000..b79e983d6 --- /dev/null +++ b/frontend/dashboard-2/.env.test @@ -0,0 +1 @@ +VITE_ENABLE_MOCKING = true diff --git a/frontend/dashboard-2/CHANGELOG.md b/frontend/dashboard-2/CHANGELOG.md new file mode 100644 index 000000000..e69de29bb diff --git a/frontend/dashboard-2/index.html b/frontend/dashboard-2/index.html new file mode 100644 index 000000000..058c7919f --- /dev/null +++ b/frontend/dashboard-2/index.html @@ -0,0 +1,15 @@ + + +
+ + +Sorry, an unexpected error has occurred.
++ {errorMessage} +
+Example Component
; +} diff --git a/frontend/workflows-ui/lib/main.ts b/frontend/workflows-ui/lib/main.ts new file mode 100644 index 000000000..b9153aca8 --- /dev/null +++ b/frontend/workflows-ui/lib/main.ts @@ -0,0 +1 @@ +export { default as ExampleComponent } from "./components/ExampleComponent"; diff --git a/frontend/workflows-ui/lib/types.ts b/frontend/workflows-ui/lib/types.ts new file mode 100644 index 000000000..c8bd1a905 --- /dev/null +++ b/frontend/workflows-ui/lib/types.ts @@ -0,0 +1,153 @@ +import { PayloadError } from "relay-runtime"; + +// HOPEFULLY this file is unecessary +// As all graphql types can be generated + +export type TaskStatus = + | "PENDING" + | "RUNNING" + | "SUCCEEDED" + | "SKIPPED" + | "FAILED" + | "ERROR" + | "OMITTED"; + +export interface Task { + id: string; + name: string; + status: TaskStatus; + depends?: string[]; + artifacts: Artifact[]; + workflow: string; + instrumentSession: Visit; + stepType: string; +} + +export interface Artifact { + name: string; + url: string; + mimeType: string; + parentTask: string; + parentTaskId: string; +} + +export interface TaskNode extends Task { + children?: TaskNode[]; +} + +export type WorkflowStatus = + | "Unknown" + | "WorkflowPendingStatus" + | "WorkflowRunningStatus" + | "WorkflowSucceededStatus" + | "WorkflowFailedStatus" + | "WorkflowErroredStatus"; + +export interface Workflow { + name: string; + id: string; + instrumentSession: Visit; + status: WorkflowStatus; + creator: string; + submittedTime?: string; +} + +export interface Visit { + proposalCode: string; + proposalNumber: number; + number: number; +} + +export interface Template { + name: string; + description?: string | null; + title?: string | null; + maintainer: string; + repository?: string | null; + source?: TemplateSource; +} + +export interface WorkflowQueryFilter { + creator?: string; + template?: string; + workflowStatusFilter?: WorkflowStatusBool; +} + +export enum ScienceGroup { + MX = "MX", + Examples = "EXAMPLES", + MagneticMaterials = "MAGNETIC_MATERIALS", + CondensedMatter = "CONDENSED_MATTER", + Imaging = "IMAGING", + BioCryoImaging = "BIO_CRYO_IMAGING", + Surfaces = "SURFACES", + Crystallography = "CRYSTALLOGRAPHY", + Spectroscopy = "SPECTROSCOPY", +} + +export interface WorkflowTemplatesFilter { + scienceGroup?: ScienceGroup[]; +} + +export interface WorkflowStatusBool { + pending?: boolean; + running?: boolean; + succeeded?: boolean; + failed?: boolean; + error?: boolean; +} + +export interface SubmissionSuccessMessage { + type: "success"; + message: string; + link: string; +} + +export interface SubmissionNetworkErrorMessage { + type: "networkError"; + error: Error; +} + +export interface SubmissionGraphQLErrorMessage { + type: "graphQLError"; + errors: PayloadError[]; +} + +export interface SubmissionData { + submissionResult: + | SubmissionSuccessMessage + | SubmissionGraphQLErrorMessage + | SubmissionNetworkErrorMessage; + visit: Visit; + workflowName?: string; + workflowId?: string; +} + +export interface UploadedFile { + fileName: string; + content: string | ArrayBuffer | null; + type: string; +} + +export interface ScanRange { + start: number; + end: number; + excluded?: number[]; +} + +export type JSONValue = + string | number | boolean | null | JSONObject | JSONValue[]; +export interface JSONObject { + [key: string]: JSONValue; +} + +export type ArtifactSortType = { + name: "name" | "parentTask"; + order: boolean; +}; + +export type TemplateSource = { + repositoryUrl?: string; + path?: string; + targetRevision?: string; +}; diff --git a/frontend/workflows-ui/lib/vite-env.d.ts b/frontend/workflows-ui/lib/vite-env.d.ts new file mode 100644 index 000000000..11f02fe2a --- /dev/null +++ b/frontend/workflows-ui/lib/vite-env.d.ts @@ -0,0 +1 @@ +///