Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mceck committed Aug 26, 2024
1 parent 86242fb commit 55d26f6
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to the "clickup-kanbans" extension will be documented in thi

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [1.5.2]

### Fixed

- minor ui fixes

## [1.5.1]

### Fixed
Expand Down
38 changes: 20 additions & 18 deletions src/services/task-service.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import * as vscode from "vscode";
import { exec } from "../utils/cmd";
import { SelectOption } from "../utils/interfaces";
import * as vscode from 'vscode';
import { exec } from '../utils/cmd';
import { SelectOption } from '../utils/interfaces';

class TaskService {
private get cmd() {
return {
gitStatus: "git status --porcelain",
gitStatus: 'git status --porcelain',
gitBranches: "git for-each-ref --format '%(refname:short)' refs/heads/",
gitCurrent: "git branch --show-current",
gitStash: "git stash push --include-untracked --quiet",
gitUnstash: "git stash apply --quiet",
gitCurrent: 'git branch --show-current',
gitStash: 'git stash push --include-untracked --quiet',
gitUnstash: 'git stash apply --quiet',
gitCheckout: (name: string, isNew: boolean = false) =>
`git checkout ${isNew ? "-b " : ""}${name} --quiet`,
`git checkout ${isNew ? '-b ' : ''}${name} --quiet`,
gitDevAndPull: (dev: string) =>
`git checkout ${dev} --quiet && git pull --quiet`,
};
Expand All @@ -26,7 +26,7 @@ class TaskService {
const stashed = await this.fixGitStatus();

try {
const branchList = (await exec(this.cmd.gitBranches)).split("\n");
const branchList = (await exec(this.cmd.gitBranches)).split('\n');
const existingBranch = branchList.find((b) => b.includes(customId));
if (existingBranch) {
// checkout existing branch
Expand All @@ -40,7 +40,9 @@ class TaskService {
if (branchType) {
// search develop branch in local branches to checkout from there
const defaults =
branchType.id === "hotfix" ? ["master", "main"] : ["develop"];
branchType.id === 'hotfix'
? ['master', 'main']
: ['develop', 'master', 'main'];
const devBranch = await this.getDefaultBranch(branchList, defaults);
if (devBranch) {
// checkout and pull develop
Expand Down Expand Up @@ -79,7 +81,7 @@ class TaskService {
}
}

private async getDefaultBranch(branchList: string[], defaults = ["develop"]) {
private async getDefaultBranch(branchList: string[], defaults = ['develop']) {
const branch = defaults.find((b) => branchList.includes(b));
if (!branch) {
// not found, manually select
Expand All @@ -106,12 +108,12 @@ class TaskService {
private async fixGitStatus() {
let res = await exec(this.cmd.gitStatus);
if (res) {
if (res.includes("fatal")) {
throw new Error("Git is not initialized in the current project");
if (res.includes('fatal')) {
throw new Error('Git is not initialized in the current project');
}
res = await exec(this.cmd.gitStash);
if (res) {
throw new Error("Cannot stash changes, checkout branch manually");
throw new Error('Cannot stash changes, checkout branch manually');
}
return true;
}
Expand All @@ -121,22 +123,22 @@ class TaskService {
private gitflowOptions(customId: string): SelectOption[] {
return [
{
id: "feature",
id: 'feature',
label: `feature/${customId}`,
description: `Create new feature branch`,
},
{
id: "bugfix",
id: 'bugfix',
label: `bugfix/${customId}`,
description: `Create new bugfix branch`,
},
{
id: "hotfix",
id: 'hotfix',
label: `hotfix/${customId}`,
description: `Create new hotfix branch`,
},
{
id: "release",
id: 'release',
label: `release/${customId}`,
description: `Create new release branch`,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
{:else}
<div
class="flex justify-center items-center w-full h-full text-white"
class:text-xs={small}
style={`background-color: ${user.color}`}
class:text-[7px]={small}
style={`background-color: ${user.color || '#6932bc'}`}
>
<span>{user.initials}</span>
</div>
Expand Down
38 changes: 15 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -769,12 +769,12 @@ brace-expansion@^2.0.1:
dependencies:
balanced-match "^1.0.0"

braces@^3.0.1, braces@^3.0.2, braces@~3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
braces@^3.0.3, braces@~3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
dependencies:
fill-range "^7.0.1"
fill-range "^7.1.1"

browser-stdout@1.3.1:
version "1.3.1"
Expand Down Expand Up @@ -1563,10 +1563,10 @@ file-entry-cache@^6.0.1:
dependencies:
flat-cache "^3.0.4"

fill-range@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
fill-range@^7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
dependencies:
to-regex-range "^5.0.1"

Expand Down Expand Up @@ -2158,20 +2158,12 @@ merge2@^1.3.0, merge2@^1.4.1:
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==

micromatch@^4.0.0:
version "4.0.2"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"
integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==
dependencies:
braces "^3.0.1"
picomatch "^2.0.5"

micromatch@^4.0.4, micromatch@^4.0.5:
version "4.0.5"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6"
integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==
micromatch@^4.0.0, micromatch@^4.0.4, micromatch@^4.0.5:
version "4.0.8"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202"
integrity "sha1-1m+hjzpHB2eJMgubGvMr2G2fogI= sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="
dependencies:
braces "^3.0.2"
braces "^3.0.3"
picomatch "^2.3.1"

mime-db@1.44.0:
Expand Down Expand Up @@ -2508,7 +2500,7 @@ picocolors@^1.0.0:
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==

picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1, picomatch@^2.2.2:
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
Expand Down

0 comments on commit 55d26f6

Please sign in to comment.