Skip to content

Commit

Permalink
[Refactor][Xiaomeng] extract pipeline.ts.
Browse files Browse the repository at this point in the history
  • Loading branch information
xmshen committed Mar 29, 2021
1 parent e635b70 commit b760d5a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 1 addition & 5 deletions frontend/src/clients/pipelineApis.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createRequest } from "./createRequest";
import { PipelineTool } from "../models/pipeline";

export const createPipelineUsingPost = createRequest<{
projectId: string;
Expand Down Expand Up @@ -75,8 +76,3 @@ export type Pipeline = JenkinsPipeline | BambooPipeline;
export type PipelineVerification =
| Omit<JenkinsPipeline, "id" | "name">
| Omit<BambooPipeline, "id" | "name">;

export enum PipelineTool {
BAMBOO = "BAMBOO",
JENKINS = "JENKINS",
}
2 changes: 1 addition & 1 deletion frontend/src/components/PipelineSetup/PipelineSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import {
BambooPipeline,
JenkinsPipeline,
Pipeline,
PipelineTool,
verifyPipelineUsingPost,
} from "../../clients/pipelineApis";
import React, { FC, useState } from "react";
import { Alert, Button, Col, Divider, Form, Input, Row, Select, Typography } from "antd";
import { css } from "@emotion/react";
import { PIPELINE_CONFIG, PIPELINE_TYPE_NOTE } from "../../utils/pipelineConfig/pipelineConfig";
import { VerifyStatus } from "../../models/common";
import { PipelineTool } from "../../models/pipeline";

const { Option } = Select;
const { Text } = Typography;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/constants/tooltips.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PipelineTool } from "../clients/pipelineApis";
import { PipelineTool } from "../models/pipeline";

export const TOOLTIP_MAPPING = {
[PipelineTool.JENKINS]: {
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/models/pipeline.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum PipelineTool {
BAMBOO = "BAMBOO",
JENKINS = "JENKINS",
}
Empty file removed frontend/src/models/project.ts
Empty file.
2 changes: 1 addition & 1 deletion frontend/src/utils/pipelineConfig/pipelineConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { PipelineTool } from "../../clients/pipelineApis";
import { JENKINS_PIPELINE_CONFIG } from "./jenkinsConfig";
import { BAMBOO_PIPELINE_CONFIG } from "./bambooConfig";
import { PipelineTool } from "../../models/pipeline";

export const PIPELINE_CONFIG = {
[PipelineTool.JENKINS]: JENKINS_PIPELINE_CONFIG,
Expand Down

0 comments on commit b760d5a

Please sign in to comment.