progress
This commit is contained in:
parent
d70253d6a6
commit
fa645dde92
51 changed files with 657 additions and 281 deletions
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable @typescript-eslint/no-this-alias */
|
||||
export const ArrayExtensions = () => {
|
||||
if ([].equals === undefined) {
|
||||
// eslint-disable-next-line no-extend-native
|
||||
|
@ -23,11 +24,11 @@ export const ArrayExtensions = () => {
|
|||
if ([].lastElement === undefined) {
|
||||
// eslint-disable-next-line no-extend-native
|
||||
Array.prototype.lastElement = function () {
|
||||
let instanceCheck = this;
|
||||
const instanceCheck = this;
|
||||
if (instanceCheck === undefined) {
|
||||
return undefined;
|
||||
} else {
|
||||
let instance = instanceCheck as [];
|
||||
const instance = instanceCheck as [];
|
||||
return instance[instance.length - 1];
|
||||
}
|
||||
};
|
||||
|
@ -38,4 +39,10 @@ export const ArrayExtensions = () => {
|
|||
return this.length === 0;
|
||||
};
|
||||
}
|
||||
if ([].isNotEmpty === undefined) {
|
||||
// eslint-disable-next-line no-extend-native
|
||||
Array.prototype.isNotEmpty = function () {
|
||||
return this.length !== 0;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -7,6 +7,7 @@ declare global {
|
|||
equals(array: Array<T>, strict: boolean): boolean;
|
||||
lastElement(): T | undefined;
|
||||
isEmpty(): boolean;
|
||||
isNotEmpty():boolean;
|
||||
}
|
||||
interface String {
|
||||
isEmpty(): boolean;
|
||||
|
|
7
ui/src/core/model/active_pipiline.ts
Normal file
7
ui/src/core/model/active_pipiline.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
|
||||
export interface ActivePipeline {
|
||||
pipelineIsRunning: boolean;
|
||||
projectUUID?: string | null;
|
||||
lastProcessCompleteCount: number | null;
|
||||
error: any;
|
||||
}
|
|
@ -23,15 +23,27 @@ import {
|
|||
CreateTriggerScreenPath,
|
||||
TriggerScreen,
|
||||
} from "../../features/create_trigger/presentation/create_trigger_screen";
|
||||
import { CreateProcessScreen, CreateProcessScreenPath } from "../../features/create_process/presentation/create_process_screen";
|
||||
import {
|
||||
CreateProcessScreen,
|
||||
CreateProcessScreenPath,
|
||||
} from "../../features/create_process/presentation/create_process_screen";
|
||||
import { ProjectRepository } from "../../features/all_projects/data/project_repository";
|
||||
import {
|
||||
CreateProjectInstancePath,
|
||||
CreateProjectInstanceScreen,
|
||||
} from "../../features/create_project_instance/create_project_instance";
|
||||
|
||||
|
||||
const idURL = ":id";
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
{
|
||||
path: AllProjectScreenPath,
|
||||
loader: new ProjectRepository().loader,
|
||||
element: <AllProjectScreen />,
|
||||
},
|
||||
{
|
||||
path: PipelineInstanceScreenPath,
|
||||
path: PipelineInstanceScreenPath + idURL,
|
||||
element: <PipelineInstanceScreen />,
|
||||
},
|
||||
{
|
||||
|
@ -54,4 +66,8 @@ export const router = createBrowserRouter([
|
|||
path: CreateProcessScreenPath,
|
||||
element: <CreateProcessScreen />,
|
||||
},
|
||||
{
|
||||
path: CreateProjectInstancePath + idURL,
|
||||
element: <CreateProjectInstanceScreen />,
|
||||
},
|
||||
]);
|
||||
|
|
22
ui/src/core/store/base_store.ts
Normal file
22
ui/src/core/store/base_store.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
// TODO(IDONTSUDO): нужно переписать все запросы под BaseStore
|
||||
|
||||
import { Result } from "../helper/result";
|
||||
|
||||
export class BaseStore {
|
||||
isLoading = false;
|
||||
isError = false;
|
||||
|
||||
async loadingHelper<T>(callBack: Promise<Result<any, T>>) {
|
||||
this.isLoading = true;
|
||||
|
||||
const result = await callBack;
|
||||
if (result.isFailure()) {
|
||||
this.isError = true;
|
||||
this.isLoading = false;
|
||||
return result.forward();
|
||||
}
|
||||
|
||||
this.isLoading = false;
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ import { useNavigate } from "react-router-dom";
|
|||
const { Title } = Typography;
|
||||
|
||||
export interface IHeader {
|
||||
largeText: string;
|
||||
largeText?: string;
|
||||
minText?: string;
|
||||
path?: string;
|
||||
needBackButton?: undefined | any;
|
||||
|
@ -25,7 +25,7 @@ export const Header: React.FunctionComponent<IHeader> = (props: IHeader) => {
|
|||
marginTop: "20px",
|
||||
marginRight: "20px",
|
||||
display: "contents",
|
||||
}}
|
||||
}}
|
||||
>
|
||||
{needBackButton ? (
|
||||
<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue