Skip to content

Commit

Permalink
Show condition run as child for taskrun (#292)
Browse files Browse the repository at this point in the history
* #277 show condition run as child for taskrun

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* Fix all issues related to start and refreash tree

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* remove unused variables

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* add more descriptive message in case taskrun load error

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* Use new state icons for some tree items

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
  • Loading branch information
evidolob committed May 25, 2020
1 parent a6382f6 commit cd33f57
Show file tree
Hide file tree
Showing 28 changed files with 1,261 additions and 2,924 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ node_modules
*.vsix
coverage/
preview/

.DS_Store
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,13 @@ To generate new snippet json, run:
$ npm run snippets-build
```
npm script from extension root.
## Generate new icons
If you want to change icons for PipelieRun, TaskRun or Condition, you may want to generate new state icons for failed and pending state.
To do that run:
```bash
$ npm run icon-build
```
npm script from extension root.
New icons will be placed in [images/generated](./images/generated).
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A Visual Studio Code extension for interacting with Tekton Pipelines.
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/new/pipeline_preview_0.0.6.gif" width="710" height="499" /></div>

### New icons and Tekton resources
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/new/new_items_and_icons.png" width="710" height="499" /></div>
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/new/new_items_and_icons.png" width="271" height="327" /></div>

### Provides editing support for Pipeline yaml
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/editing-demo.gif" width="710" height="499" /></div>
Expand Down Expand Up @@ -92,8 +92,12 @@ Development of the Tekton Pipelines Extension is largely following development o
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/CT.png" width="15" height="15" /><span style="margin: 20px">ClusterTask Node</span></div>
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/PLR.png" width="15" height="15" /><span style="margin: 20px">PipelineResource Node</span></div>
<div><img src="https://raw.githubusercontent.com/redhat-developer/vscode-tekton/master/images/running.gif" width="15" height="15" /><span style="margin: 20px">PipelineRun/TaskRun Running</span></div>
<div><img src="https://raw.githubusercontent.com/redhat-developer/vscode-tekton/master/images/success.png" width="15" height="15" /><span style="margin: 20px">PipelineRun/TaskRun Successful Run</span></div>
<div><img src="https://raw.githubusercontent.com/redhat-developer/vscode-tekton/master/images/failed.png" width="15" height="15" /><span style="margin: 20px">PipelineRun/TaskRun Failed Run</span></div>
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/tree/error/PLR.png" width="15" height="15" /><span style="margin: 20px">PipelineRun Failed</span></div>
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/tree/error/TR.png" width="15" height="15" /><span style="margin: 20px">TaskRun Failed</span></div>
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/tree/error/C.png" width="15" height="15" /><span style="margin: 20px">Condition Failed</span></div>
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/tree/pending/PLR.png" width="15" height="15" /><span style="margin: 20px">PipelineRun Pending</span></div>
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/tree/pending/TR.png" width="15" height="15" /><span style="margin: 20px">TaskRun Pending</span></div>
<div><img src="https://raw.githubusercontent.com/wiki/redhat-developer/vscode-tekton/images/readme/tree/pending/C.png" width="15" height="15" /><span style="margin: 20px">Condition Pending</span></div>


### Extension Configuration Settings
Expand Down
41 changes: 41 additions & 0 deletions build/build-svg-icons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*-----------------------------------------------------------------------------------------------
* Copyright (c) Red Hat, Inc. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*-----------------------------------------------------------------------------------------------*/
import * as path from 'path';
import * as fs from 'fs-extra';
import * as svgTools from 'simple-svg-tools';
import { exit } from 'shelljs';

const icons = ['C.svg', 'TR.svg', 'PLR.svg'];
const stateToColor = {
error: 'red',
pending: 'grey'
};

const imagesPath = path.join(__dirname, '..', '..', 'images');
const destinationPath = path.join(__dirname, '..', '..', 'images', 'generated');
fs.ensureDirSync(destinationPath);


async function generateIcons(): Promise<void> {
for (const icon of icons) {
const iconPath = path.join(imagesPath, icon);
if (fs.existsSync(iconPath)) {

for (const state in stateToColor) {
const color = stateToColor[state];
fs.ensureDirSync(path.join(destinationPath, state));
let svg = await svgTools.ImportSVG(iconPath);
svg = await svgTools.SVGO(svg);
svg = await svgTools.ChangePalette(svg, {
'#38812f': color,
});

await svgTools.ExportSVG(svg, path.join(destinationPath, state, icon));
}
}
}
}

generateIcons().then(() => exit(0));
Binary file removed images/failed.png
Binary file not shown.
1 change: 1 addition & 0 deletions images/generated/error/C.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/generated/error/PLR.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/generated/error/TR.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/generated/pending/C.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/generated/pending/PLR.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/generated/pending/TR.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions images/pending.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/success.png
Binary file not shown.
Loading

0 comments on commit cd33f57

Please sign in to comment.