Use .vscode folder for settings and such
This commit is contained in:
parent
a122e5e47e
commit
420303bffa
12
README.md
12
README.md
@ -4,7 +4,13 @@ Issuetracker for Gitea
|
||||
|
||||
## Getting Started
|
||||
|
||||
To setup a gitea issue tracked project you need to first select the issues tab at the activitiy bar. After that open the command palette in order to type in the command `Initialize Gitea-Issue Tracker` and enter your crendentials:
|
||||
Go to your settings, and find the `Gitea` section, and fill out the details.
|
||||
|
||||
Please make sure to not to make your authtoken public, as it can be used to act on your behalf.
|
||||
You can store it in the user settings, whilst leaving the rest in the workspace settings.
|
||||
|
||||
### The following details are needed
|
||||
|
||||
- Authtoken
|
||||
- Domain in format: "example.com"
|
||||
- Repository Owner (may be an organisation): "TestOrganisation"
|
||||
@ -16,8 +22,10 @@ When you've finished you can press the refresh button in the open issues section
|
||||
|
||||
![Issues with multiple colors](./media/gitea-issues.png)
|
||||
|
||||
In order to get nice looking issue icons in multiple colors (of your choice) you just need to assign a label to your issue. The color is being fetched automatically. If you change the color of the label however, you need to delete the `.gitea/{issuename}.svg` file in the given folder. If you skip this step, the file is not going to get updated. In most cases you need to restart visual studio code to apply the icons in the issues tab.
|
||||
In order to get nice looking issue icons in multiple colors (of your choice) you just need to assign a label to your issue. The color is being fetched automatically. In most cases you need to restart visual studio code to apply the icons in the issues tab if you've changed them though.
|
||||
|
||||
## Future
|
||||
|
||||
- Implement a `Close Issue` Button
|
||||
- Create Issues via Webview
|
||||
- `Comment` Issues
|
12
package-lock.json
generated
12
package-lock.json
generated
@ -251,14 +251,6 @@
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"configparser": {
|
||||
"version": "0.3.6",
|
||||
"resolved": "https://registry.npmjs.org/configparser/-/configparser-0.3.6.tgz",
|
||||
"integrity": "sha512-qCYjKDEK69qRtm3n+RYM55b8XiH2uKfnI6qOKg+ZLrKSG5vY59RBcZhLxxVd18+B5C5Zc7Jy8KpFsB5YOAD+hw==",
|
||||
"requires": {
|
||||
"mkdirp": "^0.5.1"
|
||||
}
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||
@ -606,12 +598,14 @@
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
|
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
||||
"dev": true
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
|
41
package.json
41
package.json
@ -3,7 +3,7 @@
|
||||
"displayName": "Gitea-VSCode",
|
||||
"description": "Gitea Issue Tracker for vs-code",
|
||||
"publisher": "IJustDev",
|
||||
"version": "0.0.6",
|
||||
"version": "0.0.7",
|
||||
"engines": {
|
||||
"vscode": "^1.32.0"
|
||||
},
|
||||
@ -64,6 +64,41 @@
|
||||
"when": "view == open-issues"
|
||||
}
|
||||
]
|
||||
},
|
||||
"configuration": {
|
||||
"title": "Gitea",
|
||||
"properties": {
|
||||
"gitea.token": {
|
||||
"scope": "application",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "The token for the gitea server."
|
||||
},
|
||||
"gitea.domain": {
|
||||
"scope": "resource",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "The remote gitea instance's domain."
|
||||
},
|
||||
"gitea.owner": {
|
||||
"scope": "resource",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "The username for the repository."
|
||||
},
|
||||
"gitea.repo": {
|
||||
"scope": "resource",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "The repository name."
|
||||
},
|
||||
"gitea.ssl": {
|
||||
"scope": "resource",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "If https should be used or not."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
@ -83,11 +118,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.18.1",
|
||||
"configparser": "^0.3.6",
|
||||
"marked": "^0.6.2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/IJustdev/Gitea-VSCode.git"
|
||||
}
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
82
src/Config.ts
Normal file
82
src/Config.ts
Normal file
@ -0,0 +1,82 @@
|
||||
import { workspace, window } from 'vscode';
|
||||
|
||||
interface ConfigStorage {
|
||||
token: string;
|
||||
domain: string;
|
||||
owner: string;
|
||||
repo: string;
|
||||
ssl: boolean;
|
||||
}
|
||||
|
||||
export interface ConfigTypes extends ConfigStorage {
|
||||
readonly repoApiUrl: string;
|
||||
}
|
||||
|
||||
export class Config implements ConfigTypes {
|
||||
private get storage() {
|
||||
return workspace.getConfiguration('gitea', null);
|
||||
}
|
||||
|
||||
private loadConfigValue<T extends keyof ConfigStorage>(configKey: T, type: 'string' | 'boolean' | 'number', acceptDetault = false): ConfigStorage[T] {
|
||||
if (!acceptDetault && !this.storage.has(configKey)) {
|
||||
window.showErrorMessage("Gitea-VSCode didn't find a required configuration value: " + configKey);
|
||||
throw new Error(`Failed to load configuration: "${configKey}"`);
|
||||
}
|
||||
|
||||
const value = this.storage.has(configKey)
|
||||
? (this.storage.get(configKey) as ConfigStorage[T])
|
||||
: (this.storage.inspect(configKey) as { defaultValue: ConfigStorage[T]; key: string }).defaultValue;
|
||||
|
||||
if (typeof value === type && (type !== 'string' || (value as string).length > 0)) {
|
||||
return value as ConfigStorage[T];
|
||||
}
|
||||
|
||||
window.showErrorMessage('Gitea-VSCode failed to load a configuration value that is needed: ' + configKey);
|
||||
throw new Error(`Failed to load configuration: "gitea.${configKey}"`);
|
||||
}
|
||||
|
||||
public get token() {
|
||||
return this.loadConfigValue('token', 'string');
|
||||
}
|
||||
|
||||
public set token(value) {
|
||||
this.storage.update('token', value);
|
||||
}
|
||||
|
||||
public get domain() {
|
||||
return this.loadConfigValue('domain', 'string');
|
||||
}
|
||||
|
||||
public set domain(value) {
|
||||
this.storage.update('domain', value);
|
||||
}
|
||||
|
||||
public get owner() {
|
||||
return this.loadConfigValue('owner', 'string');
|
||||
}
|
||||
|
||||
public set owner(value) {
|
||||
this.storage.update('owner', value);
|
||||
}
|
||||
|
||||
public get repo() {
|
||||
return this.loadConfigValue('repo', 'string');
|
||||
}
|
||||
|
||||
public set repo(value) {
|
||||
this.storage.update('repo', value);
|
||||
}
|
||||
|
||||
public get ssl() {
|
||||
return this.loadConfigValue('ssl', 'boolean', true);
|
||||
}
|
||||
|
||||
public set ssl(value) {
|
||||
this.storage.update('ssl', value);
|
||||
}
|
||||
|
||||
public get repoApiUrl() {
|
||||
const prefix = this.ssl ? 'https' : 'http';
|
||||
return prefix + '://' + this.domain + '/api/v1/repos/' + this.owner + '/' + this.repo + '/issues';
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
const ConfigParser = require("configparser");
|
||||
const path = require("path");
|
||||
|
||||
export class RepositoryInformationManager {
|
||||
public token(rootPath: string | undefined) {
|
||||
const config = new ConfigParser();
|
||||
config.read(path.join(rootPath as string, "/.gitea/config.ini"));
|
||||
return config.get("PRIVATE", "token");
|
||||
}
|
||||
public repoApiUrl(rootPath: string | undefined) {
|
||||
const config = new ConfigParser();
|
||||
config.read(rootPath + "/.gitea/config.ini");
|
||||
const domain = config.get("REPO", "domain");
|
||||
const repo_owner = config.get("REPO", "repo_owner");
|
||||
const repo_name = config.get("REPO", "repo_name");
|
||||
const ssl = config.get("REPO", "ssl");
|
||||
const prefix = ssl ? "https" : "http";
|
||||
return prefix + "://" + domain + "/api/v1/repos/" + repo_owner + "/" + repo_name + "/issues";
|
||||
}
|
||||
public saveRepoInformation(rootPath: string | undefined, repoInformations: any) {
|
||||
const file_path = path.join(rootPath as string, ".gitea/config.ini");
|
||||
const config = new ConfigParser();
|
||||
config.addSection("PRIVATE");
|
||||
config.addSection("REPO");
|
||||
config.set("PRIVATE", "token", repoInformations.token);
|
||||
config.set("REPO", "domain", repoInformations.domain);
|
||||
config.set("REPO", "repo_owner", repoInformations.repo_owner);
|
||||
config.set("REPO", "repo_name", repoInformations.repo_name);
|
||||
config.set("REPO", "ssl", true);
|
||||
config.write(file_path, true);
|
||||
}
|
||||
}
|
@ -1,15 +1,10 @@
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
import { showIssueHTML } from './template.html';
|
||||
import { Issue } from "./issue";
|
||||
import { RepositoryInformationManager } from './configurationProvider';
|
||||
import { Issue } from './issue';
|
||||
import { OpenIssuesProvider, ClosedIssuesProvider } from './issueProvider';
|
||||
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
let disposable = vscode.commands.registerCommand('giteaIssues.initRepo', () => {
|
||||
initializeIssueTracker();
|
||||
});
|
||||
context.subscriptions.push(disposable);
|
||||
let openIssues: Array<Issue> = [];
|
||||
const openIssuesProvider = new OpenIssuesProvider();
|
||||
const closedIssuesProvider = new ClosedIssuesProvider();
|
||||
@ -30,12 +25,10 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
const panel = vscode.window.createWebviewPanel('issue', issue.label,
|
||||
vscode.ViewColumn.Active,
|
||||
{});
|
||||
const panel = vscode.window.createWebviewPanel('issue', issue.label, vscode.ViewColumn.Active, {});
|
||||
panel.webview.html = showIssueHTML(issue);
|
||||
openIssues.push(issue);
|
||||
panel.onDidDispose(event => {
|
||||
panel.onDidDispose((event) => {
|
||||
for (let i = 0; i !== openIssues.length; i++) {
|
||||
let openIssue = openIssues[i];
|
||||
if (openIssue.issueId === issue.issueId) {
|
||||
@ -49,42 +42,6 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
openIssuesProvider.refresh();
|
||||
closedIssuesProvider.refresh();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
export function deactivate() {}
|
||||
|
||||
export async function initializeIssueTracker() {
|
||||
if (vscode.workspace.rootPath === undefined) {
|
||||
return vscode.window.showErrorMessage("No project opened!");
|
||||
}
|
||||
let Token, Domain, Owner, Name;
|
||||
await vscode.window.showInputBox({
|
||||
placeHolder: "Enter your gitea token here",
|
||||
}).then(token => {
|
||||
Token = token === undefined ? "" : token;
|
||||
});
|
||||
await vscode.window.showInputBox({
|
||||
placeHolder: "Domain from your gitea server without 'https://'",
|
||||
}).then(domain => {
|
||||
Domain = domain === undefined ? "" : domain;
|
||||
});
|
||||
await vscode.window.showInputBox({
|
||||
placeHolder: "Repository Owner",
|
||||
}).then(owner => {
|
||||
Owner = owner === undefined ? "" : owner;
|
||||
});
|
||||
await vscode.window.showInputBox({
|
||||
placeHolder: "Repository Name",
|
||||
}).then(name => {
|
||||
Name = name === undefined ? "" : name;
|
||||
});
|
||||
const repoInfo = {
|
||||
token: Token,
|
||||
domain: Domain,
|
||||
repo_owner: Owner,
|
||||
repo_name: Name,
|
||||
};
|
||||
const rpim = new RepositoryInformationManager();
|
||||
rpim.saveRepoInformation(vscode.workspace.rootPath, repoInfo);
|
||||
}
|
53
src/issue.ts
53
src/issue.ts
@ -1,59 +1,54 @@
|
||||
import * as vscode from "vscode";
|
||||
import * as path from "path";
|
||||
import * as fs from "fs";
|
||||
import { Uri, TreeItem, TreeItemCollapsibleState, Command } from 'vscode';
|
||||
|
||||
export class Issue extends vscode.TreeItem {
|
||||
interface Label {
|
||||
color: string;
|
||||
id: number;
|
||||
name: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
constructor(public readonly label: string,
|
||||
export class Issue extends TreeItem {
|
||||
constructor(
|
||||
public readonly label: string,
|
||||
public issueId: number,
|
||||
public body: string,
|
||||
public issueState: string,
|
||||
public assignee: string,
|
||||
public creator: string,
|
||||
public labels: any[],
|
||||
public collapsibleState: vscode.TreeItemCollapsibleState,
|
||||
public readonly command?: vscode.Command) {
|
||||
public labels: Label[],
|
||||
public collapsibleState: TreeItemCollapsibleState,
|
||||
public readonly command?: Command
|
||||
) {
|
||||
super(label, collapsibleState);
|
||||
try {
|
||||
for (const issueLabel of labels) {
|
||||
const folderPath = path.join(vscode.workspace.rootPath as string, '.gitea', 'label_pictures');
|
||||
if (!fs.existsSync(path.join(folderPath, issueLabel.name + ".svg"))) {
|
||||
if (!fs.existsSync(folderPath)) {
|
||||
fs.mkdirSync(folderPath);
|
||||
}
|
||||
fs.writeFileSync(path.join(folderPath, issueLabel.name + ".svg"), createIconWithColor(issueLabel.color));
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
get tooltip() {
|
||||
return this.label + " - " + this.assignee;
|
||||
return this.label + ' - ' + this.assignee;
|
||||
}
|
||||
|
||||
labelDependentIcon(dark: boolean = false): string {
|
||||
labelDependentIcon(dark: boolean = false): Uri {
|
||||
if (this.labels.length === 0) {
|
||||
return path.join(__filename, '..', '..', 'media', 'issue.svg');
|
||||
return createIconWithColor('#868686');
|
||||
} else {
|
||||
return path.join(vscode.workspace.rootPath as string, '.gitea', 'label_pictures', this.labels[0].name + ".svg");
|
||||
return createIconWithColor(this.labels[0].color);
|
||||
}
|
||||
}
|
||||
|
||||
iconPath = {
|
||||
light: this.labelDependentIcon(),
|
||||
dark: this.labelDependentIcon(true)
|
||||
dark: this.labelDependentIcon(true),
|
||||
};
|
||||
|
||||
contextValue = 'issue';
|
||||
}
|
||||
|
||||
export function createIconWithColor(color: string) {
|
||||
return `<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
export function createIconWithColor(color: string): Uri {
|
||||
const icon = `<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="{{color}}"/>
|
||||
<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="{{color}}"/>
|
||||
<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="{{color}}"/>
|
||||
</svg>
|
||||
`.replace(new RegExp("{{color}}", 'g'), "#" + color);
|
||||
`.replace(new RegExp('{{color}}', 'g'), '#' + color);
|
||||
|
||||
return Uri.parse('data:image/svg+xml;base64,' + Buffer.from(icon).toString('base64'));
|
||||
}
|
@ -1,12 +1,11 @@
|
||||
import axios from "axios";
|
||||
import * as vscode from "vscode";
|
||||
import axios from 'axios';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
const marked = require("marked");
|
||||
import { Issue } from "./issue";
|
||||
import { RepositoryInformationManager } from "./configurationProvider";
|
||||
const marked = require('marked');
|
||||
import { Issue } from './issue';
|
||||
import { Config } from './Config';
|
||||
|
||||
export class OpenIssuesProvider implements vscode.TreeDataProvider<Issue> {
|
||||
|
||||
private _onDidChangeTreeData: vscode.EventEmitter<Issue | undefined> = new vscode.EventEmitter<Issue | undefined>();
|
||||
readonly onDidChangeTreeData: vscode.Event<Issue | undefined> = this._onDidChangeTreeData.event;
|
||||
|
||||
@ -33,19 +32,22 @@ export class OpenIssuesProvider implements vscode.TreeDataProvider<Issue> {
|
||||
*/
|
||||
async getChildrenAsync() {
|
||||
this.issueList = [];
|
||||
const repoMng = new RepositoryInformationManager();
|
||||
const repoUri = repoMng.repoApiUrl(vscode.workspace.rootPath);
|
||||
const token = repoMng.token(vscode.workspace.rootPath);
|
||||
const config = new Config();
|
||||
const repoUri = config.repoApiUrl;
|
||||
const token = config.token;
|
||||
let stop = false;
|
||||
for (let i = 0; i !== 10; i++) {
|
||||
await axios.get(repoUri + "?page=" + i, { headers: { Authorization: "token " + token } }).then(res => {
|
||||
await axios
|
||||
.get(repoUri + '?page=' + i, { headers: { Authorization: 'token ' + token } })
|
||||
.then((res) => {
|
||||
console.log(res.data);
|
||||
if (res.data.length === 0) {
|
||||
stop = true;
|
||||
return;
|
||||
}
|
||||
parseToIssues(res, this.issueList);
|
||||
}).catch((err) => {
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
stop = true;
|
||||
vscode.window.showErrorMessage("Can't fetch issues; HTTP Error!");
|
||||
@ -59,12 +61,9 @@ export class OpenIssuesProvider implements vscode.TreeDataProvider<Issue> {
|
||||
getChildren(element?: Issue): vscode.ProviderResult<any[]> {
|
||||
return getChildren(element, this.issueList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export class ClosedIssuesProvider implements vscode.TreeDataProvider<Issue> {
|
||||
|
||||
private _onDidChangeTreeData: vscode.EventEmitter<Issue | undefined> = new vscode.EventEmitter<Issue | undefined>();
|
||||
readonly onDidChangeTreeData: vscode.Event<Issue | undefined> = this._onDidChangeTreeData.event;
|
||||
|
||||
@ -87,20 +86,24 @@ export class ClosedIssuesProvider implements vscode.TreeDataProvider<Issue> {
|
||||
|
||||
async getChildrenAsync() {
|
||||
this.issueList = [];
|
||||
const repoMng = new RepositoryInformationManager();
|
||||
const repoUri = repoMng.repoApiUrl(vscode.workspace.rootPath);
|
||||
const token = repoMng.token(vscode.workspace.rootPath);
|
||||
const config = new Config();
|
||||
const repoUri = config.repoApiUrl;
|
||||
const token = config.token;
|
||||
let stop = false;
|
||||
for (let i = 0; i !== 10; i++) {
|
||||
await axios.get(repoUri + "?state=closed&page=" + i, { headers: { Authorization: "token " + token } }).then(res => {
|
||||
await axios
|
||||
.get(repoUri + '?state=closed&page=' + i, { headers: { Authorization: 'token ' + token } })
|
||||
.then((res) => {
|
||||
console.log(res.data);
|
||||
if (res.data.length === 0) {
|
||||
stop = true;
|
||||
return;
|
||||
}
|
||||
parseToIssues(res, this.issueList);
|
||||
}).catch(() => {
|
||||
stop = true; vscode.window.showErrorMessage("Can't fetch issues; HTTP Error!");
|
||||
})
|
||||
.catch(() => {
|
||||
stop = true;
|
||||
vscode.window.showErrorMessage("Can't fetch issues; HTTP Error!");
|
||||
return;
|
||||
});
|
||||
if (stop) {
|
||||
@ -117,21 +120,20 @@ export function getChildren(element: Issue | undefined, issueList: Issue[]) {
|
||||
for (const issue of issueList) {
|
||||
if (element === issue) {
|
||||
let childItems: vscode.TreeItem[] = [
|
||||
new vscode.TreeItem("Assignee - " + element.assignee, vscode.TreeItemCollapsibleState.None),
|
||||
new vscode.TreeItem("State - " + element.issueState, vscode.TreeItemCollapsibleState.None),
|
||||
new vscode.TreeItem("ID - " + element.issueId, vscode.TreeItemCollapsibleState.None),
|
||||
new vscode.TreeItem("From - " + element.creator, vscode.TreeItemCollapsibleState.None)
|
||||
new vscode.TreeItem('Assignee - ' + element.assignee, vscode.TreeItemCollapsibleState.None),
|
||||
new vscode.TreeItem('State - ' + element.issueState, vscode.TreeItemCollapsibleState.None),
|
||||
new vscode.TreeItem('ID - ' + element.issueId, vscode.TreeItemCollapsibleState.None),
|
||||
new vscode.TreeItem('From - ' + element.creator, vscode.TreeItemCollapsibleState.None),
|
||||
];
|
||||
return Promise.resolve(childItems);
|
||||
|
||||
}
|
||||
}
|
||||
return issueList;
|
||||
}
|
||||
|
||||
export function parseToIssues(res: any, issueList: any[], collapsibleState: vscode.TreeItemCollapsibleState = vscode.TreeItemCollapsibleState.Collapsed) {
|
||||
export function parseToIssues(res: any, issueList: Issue[], collapsibleState: vscode.TreeItemCollapsibleState = vscode.TreeItemCollapsibleState.Collapsed) {
|
||||
for (const issue of res.data) {
|
||||
const id = issue["number"];
|
||||
const id = issue['number'];
|
||||
let isAlreadyInList = false;
|
||||
issueList.forEach((issueOfList) => {
|
||||
if (id === issueOfList.issueId) {
|
||||
@ -141,19 +143,28 @@ export function parseToIssues(res: any, issueList: any[], collapsibleState: vsco
|
||||
if (isAlreadyInList) {
|
||||
continue;
|
||||
}
|
||||
const title = issue["title"];
|
||||
const body = marked(issue["body"]);
|
||||
const state = issue["state"];
|
||||
const assignee = issue["assignee"] === null ? "None" : issue["assignee"]["username"];
|
||||
const labels = issue["labels"];
|
||||
const creator = issue["user"]["username"];
|
||||
const tmpIssue = new Issue("#" + id + " - " + title, id, body, state, assignee, creator, labels, collapsibleState);
|
||||
const issueForList = new Issue(tmpIssue.label, tmpIssue.issueId, tmpIssue.body, tmpIssue.issueState,
|
||||
tmpIssue.assignee, tmpIssue.creator, tmpIssue.labels, tmpIssue.collapsibleState, {
|
||||
const title = issue['title'];
|
||||
const body = marked(issue['body']);
|
||||
const state = issue['state'];
|
||||
const assignee = issue['assignee'] === null ? 'None' : issue['assignee']['username'];
|
||||
const labels = issue['labels'];
|
||||
const creator = issue['user']['username'];
|
||||
const tmpIssue = new Issue('#' + id + ' - ' + title, id, body, state, assignee, creator, labels, collapsibleState);
|
||||
const issueForList = new Issue(
|
||||
tmpIssue.label,
|
||||
tmpIssue.issueId,
|
||||
tmpIssue.body,
|
||||
tmpIssue.issueState,
|
||||
tmpIssue.assignee,
|
||||
tmpIssue.creator,
|
||||
tmpIssue.labels,
|
||||
tmpIssue.collapsibleState,
|
||||
{
|
||||
command: 'giteaIssues.openIssue',
|
||||
title: '',
|
||||
arguments: [tmpIssue],
|
||||
});
|
||||
}
|
||||
);
|
||||
issueList.push(issueForList);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user