ADDED: 0.0.5 - Colored icons with description in README.md

This commit is contained in:
IJustDev 2019-04-12 08:35:29 +02:00
parent fcfe39add4
commit 086a3cc636
11 changed files with 53 additions and 2 deletions

View File

@ -33,6 +33,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
## [0.0.5] - 2019-04-12 ## [0.0.5] - 2019-04-12
### Added: ### Added:
- Child items to root items. Collapsable item now shows assignee, state, id and list all labels from the issue - Child items to root items. Collapsable item now shows assignee, state, id and list all labels from the issue
- Label dependent icons
### Refactored: ### Refactored:
- Created two methods that are used in both classes (the closed and the open issues provider) - Created two methods that are used in both classes (the closed and the open issues provider)

View File

@ -12,6 +12,9 @@ To setup a gitea issue tracked project you need to first select the issues tab a
When you've finished you can press the refresh button in the open issues section and you'll see the issues of the first 10 pages (only open issues). When you've finished you can press the refresh button in the open issues section and you'll see the issues of the first 10 pages (only open issues).
## Issue colors
In order to get nice looking issueicons in multiple colors you need to assigne any issue a label called either "feature" or "bug". A bug is going to be represented as an red issue, while a feature will have a green icon. If the issue does not have got a label it will receive a grey icon. If the label is not know (so neither "feature" nor "bug" not case sensitive) it will also get a grey icon.
## Future ## Future
- Implement a `Close Issue` Button - Implement a `Close Issue` Button
- Create Issues via Webview - Create Issues via Webview

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "gitea-vscode", "name": "gitea-vscode",
"version": "0.0.4", "version": "0.0.5",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -90,4 +90,4 @@
"type": "github", "type": "github",
"url": "https://github.com/IJustdev/Gitea-VSCode.git" "url": "https://github.com/IJustdev/Gitea-VSCode.git"
} }
} }

5
resources/dark/bug.svg Normal file
View File

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16 31.5C24.5604 31.5 31.5 24.5604 31.5 16C31.5 7.43959 24.5604 0.5 16 0.5C7.43959 0.5 0.5 7.43959 0.5 16C0.5 24.5604 7.43959 31.5 16 31.5Z" stroke="#FF0000"/>
<path d="M19 6C19 4.34315 17.6569 3 16 3C14.3431 3 13 4.34315 13 6V20C13 21.6569 14.3431 23 16 23C17.6569 23 19 21.6569 19 20V6Z" fill="#FF0000"/>
<path d="M16.5 24H15.5C14.1193 24 13 25.1193 13 26.5C13 27.8807 14.1193 29 15.5 29H16.5C17.8807 29 19 27.8807 19 26.5C19 25.1193 17.8807 24 16.5 24Z" fill="#FF0000"/>
</svg>

After

Width:  |  Height:  |  Size: 586 B

View File

@ -0,0 +1,5 @@
<svg width="33" height="33" viewBox="0 0 33 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.5 32C25.0604 32 32 25.0604 32 16.5C32 7.93959 25.0604 1 16.5 1C7.93959 1 1 7.93959 1 16.5C1 25.0604 7.93959 32 16.5 32Z" stroke="#31CE09"/>
<path d="M19.5 6.5C19.5 4.84315 18.1569 3.5 16.5 3.5C14.8431 3.5 13.5 4.84315 13.5 6.5V20.5C13.5 22.1569 14.8431 23.5 16.5 23.5C18.1569 23.5 19.5 22.1569 19.5 20.5V6.5Z" fill="#31CE09"/>
<path d="M17 24.5H16C14.6193 24.5 13.5 25.6193 13.5 27C13.5 28.3807 14.6193 29.5 16 29.5H17C18.3807 29.5 19.5 28.3807 19.5 27C19.5 25.6193 18.3807 24.5 17 24.5Z" fill="#31CE09"/>
</svg>

After

Width:  |  Height:  |  Size: 622 B

5
resources/dark/issue.svg Normal file
View File

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="16" cy="16" r="15.5" stroke="#636363"/>
<rect x="13" y="3" width="6" height="20" rx="3" fill="#868686"/>
<rect x="13" y="24" width="6" height="5" rx="2.5" fill="#868686"/>
</svg>

After

Width:  |  Height:  |  Size: 287 B

5
resources/light/bug.svg Normal file
View File

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16 31.5C24.5604 31.5 31.5 24.5604 31.5 16C31.5 7.43959 24.5604 0.5 16 0.5C7.43959 0.5 0.5 7.43959 0.5 16C0.5 24.5604 7.43959 31.5 16 31.5Z" stroke="#FF0000"/>
<path d="M19 6C19 4.34315 17.6569 3 16 3C14.3431 3 13 4.34315 13 6V20C13 21.6569 14.3431 23 16 23C17.6569 23 19 21.6569 19 20V6Z" fill="#FF0000"/>
<path d="M16.5 24H15.5C14.1193 24 13 25.1193 13 26.5C13 27.8807 14.1193 29 15.5 29H16.5C17.8807 29 19 27.8807 19 26.5C19 25.1193 17.8807 24 16.5 24Z" fill="#FF0000"/>
</svg>

After

Width:  |  Height:  |  Size: 586 B

View File

@ -0,0 +1,5 @@
<svg width="33" height="33" viewBox="0 0 33 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.5 32C25.0604 32 32 25.0604 32 16.5C32 7.93959 25.0604 1 16.5 1C7.93959 1 1 7.93959 1 16.5C1 25.0604 7.93959 32 16.5 32Z" stroke="#31CE09"/>
<path d="M19.5 6.5C19.5 4.84315 18.1569 3.5 16.5 3.5C14.8431 3.5 13.5 4.84315 13.5 6.5V20.5C13.5 22.1569 14.8431 23.5 16.5 23.5C18.1569 23.5 19.5 22.1569 19.5 20.5V6.5Z" fill="#31CE09"/>
<path d="M17 24.5H16C14.6193 24.5 13.5 25.6193 13.5 27C13.5 28.3807 14.6193 29.5 16 29.5H17C18.3807 29.5 19.5 28.3807 19.5 27C19.5 25.6193 18.3807 24.5 17 24.5Z" fill="#31CE09"/>
</svg>

After

Width:  |  Height:  |  Size: 622 B

View File

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="16" cy="16" r="15.5" stroke="#636363"/>
<rect x="13" y="3" width="6" height="20" rx="3" fill="#868686"/>
<rect x="13" y="24" width="6" height="5" rx="2.5" fill="#868686"/>
</svg>

After

Width:  |  Height:  |  Size: 287 B

View File

@ -1,4 +1,5 @@
import * as vscode from "vscode"; import * as vscode from "vscode";
import * as path from "path";
export class Issue extends vscode.TreeItem { export class Issue extends vscode.TreeItem {
@ -16,5 +17,21 @@ export class Issue extends vscode.TreeItem {
get tooltip() { get tooltip() {
return this.label + " - " + this.assignee; return this.label + " - " + this.assignee;
} }
labelDependentIcon(dark: boolean = false): string {
let filename = "";
if (this.labels.length === 0) {
filename = "issue";
} else {
this.labels[0].name.toLowerCase() === "feature" ? filename = "feature" : filename = this.labels[0].name.toLowerCase() === "bug" ? "bug" : "issue";
}
return path.join(__filename, '..', '..', 'resources', dark ? 'dark' : 'light', filename + '.svg');
}
iconPath = {
light: this.labelDependentIcon(),
dark: this.labelDependentIcon(true)
};
contextValue = 'issue'; contextValue = 'issue';
} }