Skip to content

Commit

Permalink
[UI] Scheduled workflow catchup=false option (#3131)
Browse files Browse the repository at this point in the history
* Update codegen instruction

* Regenerate api

* [UI] scheduled workflow catchup option

* Show catchup in recurring run details page

* Add help button to introduce swf catchup=false

* Update snapshots and fix tests
  • Loading branch information
Bobgy authored Feb 21, 2020
1 parent 5c54904 commit 6c0dcc6
Show file tree
Hide file tree
Showing 14 changed files with 424 additions and 161 deletions.
5 changes: 3 additions & 2 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

## Develop

You need `npm`, install dependencies using `npm install`.
You need `npm`, install dependencies using `npm ci` (`npm ci` makes sure your
installed dependencies have the exact same version as others).

If you made any changes to protos (see backend/README), you'll need to
regenerate the Typescript client library from swagger. We use
swagger-codegen-cli@2.4.7, which you can get
[here](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.7/swagger-codegen-cli-2.4.7.jar).
[here](https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.7/).
Make sure the jar file is somewhere on your path with the name
swagger-codegen-cli.jar, then run `npm run apis`.

Expand Down
22 changes: 14 additions & 8 deletions frontend/src/apis/job/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ export interface ApiJob {
* @memberof ApiJob
*/
enabled?: boolean;
/**
* Optional input field. Whether the job should catch up if behind schedule. If true, the job will only schedule the latest interval if behind schedule. If false, the job will catch up on each past interval.
* @type {boolean}
* @memberof ApiJob
*/
no_catchup?: boolean;
}

/**
Expand Down Expand Up @@ -558,7 +564,7 @@ export const JobServiceApiFetchParamCreator = function(configuration?: Configura
},
/**
*
* @summary Disable a job.
* @summary Stops a job and all its associated runs. The job is not deleted.
* @param {string} id The ID of the job to be disabled
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand Down Expand Up @@ -606,7 +612,7 @@ export const JobServiceApiFetchParamCreator = function(configuration?: Configura
},
/**
*
* @summary Enable a job.
* @summary Restarts a job that was previously stopped. All runs associated with the job will continue.
* @param {string} id The ID of the job to be enabled
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand Down Expand Up @@ -839,7 +845,7 @@ export const JobServiceApiFp = function(configuration?: Configuration) {
},
/**
*
* @summary Disable a job.
* @summary Stops a job and all its associated runs. The job is not deleted.
* @param {string} id The ID of the job to be disabled
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand All @@ -861,7 +867,7 @@ export const JobServiceApiFp = function(configuration?: Configuration) {
},
/**
*
* @summary Enable a job.
* @summary Restarts a job that was previously stopped. All runs associated with the job will continue.
* @param {string} id The ID of the job to be enabled
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand Down Expand Up @@ -981,7 +987,7 @@ export const JobServiceApiFactory = function(
},
/**
*
* @summary Disable a job.
* @summary Stops a job and all its associated runs. The job is not deleted.
* @param {string} id The ID of the job to be disabled
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand All @@ -991,7 +997,7 @@ export const JobServiceApiFactory = function(
},
/**
*
* @summary Enable a job.
* @summary Restarts a job that was previously stopped. All runs associated with the job will continue.
* @param {string} id The ID of the job to be enabled
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand Down Expand Up @@ -1082,7 +1088,7 @@ export class JobServiceApi extends BaseAPI {

/**
*
* @summary Disable a job.
* @summary Stops a job and all its associated runs. The job is not deleted.
* @param {string} id The ID of the job to be disabled
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand All @@ -1094,7 +1100,7 @@ export class JobServiceApi extends BaseAPI {

/**
*
* @summary Enable a job.
* @summary Restarts a job that was previously stopped. All runs associated with the job will continue.
* @param {string} id The ID of the job to be enabled
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand Down
40 changes: 40 additions & 0 deletions frontend/src/atoms/HelpButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import IconButton from '@material-ui/core/IconButton';
import { withStyles } from '@material-ui/core/styles';
import Tooltip from '@material-ui/core/Tooltip';
import HelpIcon from '@material-ui/icons/Help';
import React, { ReactNode } from 'react';
import { color, fontsize } from '../Css';

const NostyleTooltip = withStyles({
tooltip: {
backgroundColor: 'transparent',
border: '0 none',
color: color.secondaryText,
fontSize: fontsize.base,
maxWidth: 220,
},
})(Tooltip);

interface HelpButtonProps {
helpText?: ReactNode;
}
export const HelpButton: React.FC<HelpButtonProps> = ({ helpText }) => {
return (
<NostyleTooltip
title={
<Card>
<CardContent>{helpText}</CardContent>
</Card>
}
interactive={true}
leaveDelay={400}
placement='top'
>
<IconButton>
<HelpIcon />
</IconButton>
</NostyleTooltip>
);
};
Loading

0 comments on commit 6c0dcc6

Please sign in to comment.