mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-03-28 17:42:40 +01:00
Commit message input
This commit is contained in:
@@ -871,6 +871,14 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"frontMatter.git.requiresCommitMessage": {
|
||||
"type": "array",
|
||||
"markdownDescription": "%setting.frontMatter.git.requiresCommitMessage.markdownDescription%",
|
||||
"default": [],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"frontMatter.git.submodule.pull": {
|
||||
"type": "boolean",
|
||||
"markdownDescription": "%setting.frontMatter.git.submodule.pull.markdownDescription%",
|
||||
|
||||
@@ -4,7 +4,7 @@ export const GeneralCommands = {
|
||||
git: {
|
||||
syncingStart: 'gitSyncingStart',
|
||||
syncingEnd: 'gitSyncingEnd',
|
||||
branchInfo: 'gitBranchInfo'
|
||||
branchName: 'gitBranchName'
|
||||
},
|
||||
setLocalization: 'setLocalization'
|
||||
},
|
||||
@@ -12,6 +12,7 @@ export const GeneralCommands = {
|
||||
openLink: 'openLink',
|
||||
git: {
|
||||
sync: 'gitSync',
|
||||
fetch: 'getFetch',
|
||||
getBranch: 'getBranch',
|
||||
selectBranch: 'gitSelectBranch'
|
||||
},
|
||||
|
||||
@@ -49,5 +49,6 @@ export const TelemetryEvent = {
|
||||
webviewTaxonomyDashboard: 'webviewTaxonomyDashboard',
|
||||
|
||||
// Git
|
||||
gitSync: 'gitSync'
|
||||
gitSync: 'gitSync',
|
||||
gitFetch: 'gitFetch'
|
||||
};
|
||||
|
||||
@@ -99,6 +99,7 @@ export const SETTING_SITE_BASEURL = 'site.baseURL';
|
||||
|
||||
export const SETTING_GIT_ENABLED = 'git.enabled';
|
||||
export const SETTING_GIT_DISABLED_BRANCHES = 'git.disableOnBranches';
|
||||
export const SETTING_GIT_REQUIRES_COMMIT_MSG = 'git.requiresCommitMessage';
|
||||
export const SETTING_GIT_COMMIT_MSG = 'git.commitMessage';
|
||||
export const SETTING_GIT_SUBMODULE_PULL = 'git.submodule.pull';
|
||||
export const SETTING_GIT_SUBMODULE_PUSH = 'git.submodule.push';
|
||||
|
||||
@@ -173,7 +173,7 @@ export const Header: React.FunctionComponent<IHeaderProps> = ({
|
||||
<Searchbox />
|
||||
|
||||
<div className={`flex items-center justify-end space-x-4 flex-1`}>
|
||||
<SyncButton />
|
||||
{/* <SyncButton /> */}
|
||||
|
||||
<ChoiceButton
|
||||
title={l10n.t(LocalizationKey.dashboardHeaderHeaderCreateContent)}
|
||||
|
||||
@@ -31,7 +31,6 @@ import {
|
||||
SETTING_SLUG_UPDATE_FILE_NAME,
|
||||
SETTING_TAXONOMY_CUSTOM,
|
||||
SETTING_TAXONOMY_FIELD_GROUPS,
|
||||
SETTING_GIT_ENABLED,
|
||||
SETTING_SEO_TITLE_FIELD
|
||||
} from '../constants';
|
||||
import { GitListener } from '../listeners/general';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
SETTING_GIT_DISABLED_BRANCHES,
|
||||
SETTING_GIT_REQUIRES_COMMIT_MSG,
|
||||
SETTING_GIT_SUBMODULE_BRANCH,
|
||||
SETTING_GIT_SUBMODULE_FOLDER,
|
||||
SETTING_GIT_SUBMODULE_PULL,
|
||||
@@ -45,6 +46,7 @@ export class GitListener {
|
||||
private static client: SimpleGit | null = null;
|
||||
private static subClient: SimpleGit | null = null;
|
||||
private static repository: GitRepository | null = null;
|
||||
private static branchName: string | null = null;
|
||||
|
||||
public static async getSettings() {
|
||||
const gitActions = Settings.get<boolean>(SETTING_GIT_ENABLED);
|
||||
@@ -54,6 +56,9 @@ export class GitListener {
|
||||
actions: gitActions || false,
|
||||
disabledBranches: gitActions
|
||||
? Settings.get<string[]>(SETTING_GIT_DISABLED_BRANCHES) || []
|
||||
: [],
|
||||
requiresCommitMessage: gitActions
|
||||
? Settings.get<string[]>(SETTING_GIT_REQUIRES_COMMIT_MSG) || []
|
||||
: []
|
||||
};
|
||||
}
|
||||
@@ -91,7 +96,10 @@ export class GitListener {
|
||||
public static process(msg: PostMessageData) {
|
||||
switch (msg.command) {
|
||||
case GeneralCommands.toVSCode.git.sync:
|
||||
this.sync();
|
||||
this.sync(msg.payload);
|
||||
break;
|
||||
case GeneralCommands.toVSCode.git.fetch:
|
||||
this.sync(undefined, false);
|
||||
break;
|
||||
case GeneralCommands.toVSCode.git.getBranch:
|
||||
this.getBranch(msg.command, msg.requestId);
|
||||
@@ -108,16 +116,19 @@ export class GitListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the sync
|
||||
* Run the sync/fetch
|
||||
*/
|
||||
public static async sync() {
|
||||
public static async sync(commitMsg?: string, isSync: boolean = true) {
|
||||
try {
|
||||
this.sendMsg(GeneralCommands.toWebview.git.syncingStart, {});
|
||||
this.sendMsg(GeneralCommands.toWebview.git.syncingStart, isSync ? 'syncing' : 'fetching');
|
||||
|
||||
Telemetry.send(TelemetryEvent.gitSync);
|
||||
Telemetry.send(isSync ? TelemetryEvent.gitSync : TelemetryEvent.gitFetch);
|
||||
|
||||
await this.pull();
|
||||
await this.push();
|
||||
|
||||
if (isSync) {
|
||||
await this.push(commitMsg);
|
||||
}
|
||||
|
||||
this.sendMsg(GeneralCommands.toWebview.git.syncingEnd, {});
|
||||
} catch (e) {
|
||||
@@ -187,8 +198,9 @@ export class GitListener {
|
||||
* Push the changes to the remote
|
||||
* @returns
|
||||
*/
|
||||
private static async push() {
|
||||
let commitMsg = Settings.get<string>(SETTING_GIT_COMMIT_MSG);
|
||||
private static async push(commitMsg?: string) {
|
||||
commitMsg =
|
||||
commitMsg || Settings.get<string>(SETTING_GIT_COMMIT_MSG) || 'Synced by Front Matter';
|
||||
|
||||
if (commitMsg) {
|
||||
const dateFormat = Settings.get(SETTING_DATE_FORMAT) as string;
|
||||
@@ -213,7 +225,7 @@ export class GitListener {
|
||||
// Check if anything changed
|
||||
if (status.files.length > 0) {
|
||||
await subGit.raw(['add', '.', '-A']);
|
||||
await subGit.commit(commitMsg || 'Synced by Front Matter');
|
||||
await subGit.commit(commitMsg);
|
||||
}
|
||||
await subGit.push();
|
||||
} catch (e) {
|
||||
@@ -235,13 +247,7 @@ export class GitListener {
|
||||
// First line is the submodule folder name
|
||||
if (lines.length > 1) {
|
||||
await git.subModule(['foreach', 'git', 'add', '.', '-A']);
|
||||
await git.subModule([
|
||||
'foreach',
|
||||
'git',
|
||||
'commit',
|
||||
'-m',
|
||||
commitMsg || 'Synced by Front Matter'
|
||||
]);
|
||||
await git.subModule(['foreach', 'git', 'commit', '-m', commitMsg]);
|
||||
await git.subModule(['foreach', 'git', 'push']);
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -260,7 +266,7 @@ export class GitListener {
|
||||
|
||||
if (status.files.length > 0) {
|
||||
await git.raw(['add', '.', '-A']);
|
||||
await git.commit(commitMsg || 'Synced by Front Matter');
|
||||
await git.commit(commitMsg);
|
||||
}
|
||||
|
||||
await git.push();
|
||||
@@ -365,20 +371,11 @@ export class GitListener {
|
||||
*/
|
||||
private static async triggerBranchChange(repo: GitRepository | null) {
|
||||
if (repo && repo.state) {
|
||||
if (repo.state.HEAD.name !== GitListener.repository?.state?.HEAD.name) {
|
||||
if (repo.state.HEAD.name !== GitListener.branchName) {
|
||||
GitListener.branchName = repo.state.HEAD.name;
|
||||
GitListener.repository = repo;
|
||||
let branches = [];
|
||||
|
||||
if (repo.repository.getBranches) {
|
||||
const allBranches = await repo.repository.getBranches();
|
||||
if (allBranches && allBranches.length > 0) {
|
||||
branches = allBranches.map((branch: any) => branch.name);
|
||||
}
|
||||
}
|
||||
this.sendMsg(GeneralCommands.toWebview.git.branchInfo, {
|
||||
crntBranch: GitListener.repository?.state?.HEAD.name,
|
||||
branches
|
||||
});
|
||||
this.sendMsg(GeneralCommands.toWebview.git.branchName, GitListener.branchName);
|
||||
|
||||
repo.state.onDidChange(() => {
|
||||
GitListener.triggerBranchChange(repo);
|
||||
|
||||
@@ -2,4 +2,5 @@ export interface GitSettings {
|
||||
isGitRepo: boolean;
|
||||
actions: boolean;
|
||||
disabledBranches: string[];
|
||||
requiresCommitMessage: string[];
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ const ActionButton: React.FunctionComponent<IActionButtonProps> = ({
|
||||
title
|
||||
}: React.PropsWithChildren<IActionButtonProps>) => {
|
||||
return (
|
||||
<div className={`article__action`}>
|
||||
<div className={`article__action w-full`}>
|
||||
<button onClick={onClick} className={className || ''} disabled={disabled}>
|
||||
{title}
|
||||
</button>
|
||||
|
||||
@@ -20,6 +20,7 @@ export interface ITextFieldProps extends BaseFieldProps<string> {
|
||||
limit: number | undefined;
|
||||
rows?: number;
|
||||
name: string;
|
||||
placeholder?: string;
|
||||
settings: PanelSettings;
|
||||
onChange: (txtValue: string) => void;
|
||||
}
|
||||
@@ -27,6 +28,7 @@ export interface ITextFieldProps extends BaseFieldProps<string> {
|
||||
const WysiwygField = React.lazy(() => import('./WysiwygField'));
|
||||
|
||||
export const TextField: React.FunctionComponent<ITextFieldProps> = ({
|
||||
placeholder,
|
||||
singleLine,
|
||||
wysiwyg,
|
||||
limit,
|
||||
@@ -154,6 +156,7 @@ export const TextField: React.FunctionComponent<ITextFieldProps> = ({
|
||||
className={`metadata_field__input`}
|
||||
value={text || ''}
|
||||
onChange={(e) => onTextChange(e.currentTarget.value)}
|
||||
placeholder={placeholder}
|
||||
style={{
|
||||
border
|
||||
}}
|
||||
@@ -164,6 +167,7 @@ export const TextField: React.FunctionComponent<ITextFieldProps> = ({
|
||||
rows={rows || 2}
|
||||
value={text || ''}
|
||||
onChange={(e) => onTextChange(e.currentTarget.value)}
|
||||
placeholder={placeholder}
|
||||
style={{
|
||||
border
|
||||
}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Messenger, messageHandler } from '@estruyf/vscode/dist/client';
|
||||
import { EventData } from '@estruyf/vscode/dist/models';
|
||||
import { ArrowPathIcon } from '@heroicons/react/24/outline';
|
||||
import { ArrowDownTrayIcon, ArrowPathIcon } from '@heroicons/react/24/outline';
|
||||
import * as React from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { GeneralCommands } from '../../../constants';
|
||||
@@ -8,6 +8,7 @@ import { PanelSettings } from '../../../models';
|
||||
import { ActionButton } from '../ActionButton';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
import { BranchIcon } from '../Icons/BranchIcon';
|
||||
|
||||
export interface IGitActionProps {
|
||||
settings: PanelSettings | undefined;
|
||||
@@ -16,12 +17,16 @@ export interface IGitActionProps {
|
||||
export const GitAction: React.FunctionComponent<IGitActionProps> = ({
|
||||
settings
|
||||
}: React.PropsWithChildren<IGitActionProps>) => {
|
||||
const [commitMessage, setCommitMessage] = useState<string | undefined>(undefined);
|
||||
const [crntBanch, setCrntBranch] = useState<string | undefined>(undefined);
|
||||
const [branches, setBranches] = useState<string[] | undefined>(undefined);
|
||||
const [isSyncing, setIsSyncing] = useState(false);
|
||||
const [isSyncing, setIsSyncing] = useState<"syncing" | "fetching" | "idle">("idle");
|
||||
|
||||
const pull = () => {
|
||||
Messenger.send(GeneralCommands.toVSCode.git.sync);
|
||||
const sync = () => {
|
||||
Messenger.send(GeneralCommands.toVSCode.git.sync, commitMessage);
|
||||
};
|
||||
|
||||
const fetch = () => {
|
||||
Messenger.send(GeneralCommands.toVSCode.git.fetch);
|
||||
};
|
||||
|
||||
const selectBranch = () => {
|
||||
@@ -32,26 +37,65 @@ export const GitAction: React.FunctionComponent<IGitActionProps> = ({
|
||||
const { command, payload } = message.data;
|
||||
|
||||
if (command === GeneralCommands.toWebview.git.syncingStart) {
|
||||
setIsSyncing(true);
|
||||
setIsSyncing(payload || "syncing");
|
||||
} else if (command === GeneralCommands.toWebview.git.syncingStart) {
|
||||
setIsSyncing("syncing");
|
||||
} else if (command === GeneralCommands.toWebview.git.syncingEnd) {
|
||||
setIsSyncing(false);
|
||||
} else if (command === GeneralCommands.toWebview.git.branchInfo) {
|
||||
setCrntBranch(payload.crntBranch || undefined);
|
||||
setBranches(payload.branches || undefined);
|
||||
setCommitMessage(undefined);
|
||||
setIsSyncing("idle");
|
||||
} else if (command === GeneralCommands.toWebview.git.branchName) {
|
||||
setCrntBranch(payload || undefined);
|
||||
}
|
||||
};
|
||||
|
||||
const isSyncDisabled = React.useMemo(() => {
|
||||
if (!settings?.git?.disabledBranches || settings.git.disabledBranches.length === 0) {
|
||||
return false;
|
||||
const isCommitRequired = React.useMemo(() => {
|
||||
const requiresCommitMessage = settings?.git?.requiresCommitMessage || [];
|
||||
|
||||
if (!crntBanch) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (requiresCommitMessage && requiresCommitMessage.includes(crntBanch) && !commitMessage) {
|
||||
return {
|
||||
border: '1px solid var(--vscode-inputValidation-errorBorder)'
|
||||
};
|
||||
}
|
||||
|
||||
return {};
|
||||
}, [settings?.git?.requiresCommitMessage, crntBanch, commitMessage])
|
||||
|
||||
const isCommitDisabed = React.useMemo(() => {
|
||||
const disabledBranches = settings?.git?.disabledBranches || [];
|
||||
|
||||
if (!crntBanch) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return settings.git.disabledBranches.includes(crntBanch);
|
||||
}, [settings?.git?.disabledBranches, crntBanch])
|
||||
if (disabledBranches && disabledBranches.includes(crntBanch)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}, [settings?.git?.disabledBranches, crntBanch, commitMessage])
|
||||
|
||||
const isSyncDisabled = React.useMemo(() => {
|
||||
const disabledBranches = settings?.git?.disabledBranches || [];
|
||||
const requiresCommitMessage = settings?.git?.requiresCommitMessage || [];
|
||||
|
||||
if (!crntBanch) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (disabledBranches && disabledBranches.includes(crntBanch)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (requiresCommitMessage && requiresCommitMessage.includes(crntBanch)) {
|
||||
return !commitMessage;
|
||||
}
|
||||
|
||||
return false;
|
||||
}, [settings?.git?.disabledBranches, settings?.git?.requiresCommitMessage, crntBanch, commitMessage])
|
||||
|
||||
useEffect(() => {
|
||||
Messenger.listen(messageListener);
|
||||
@@ -75,32 +119,57 @@ export const GitAction: React.FunctionComponent<IGitActionProps> = ({
|
||||
<div className="git_actions">
|
||||
<h2 className='text-[11px] flex justify-between items-center mb-4'>
|
||||
<span className='uppercase'>
|
||||
Git Actions
|
||||
Changes
|
||||
</span>
|
||||
|
||||
<button
|
||||
className='inline-flex items-center w-auto p-0 bg-inherit text-[var(--vscode-sideBarTitle-foreground)] hover:bg-inherit hover:text-[var(--vscode-sideBarTitle-foreground-hover)]'
|
||||
title='Select Branch'
|
||||
onClick={selectBranch}>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" className='w-4 h-4' fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M21.0067 8.22168C21.0102 7.52792 20.8205 6.84689 20.4589 6.25485C20.0971 5.66281 19.5778 5.18315 18.959 4.86957C18.3401 4.556 17.6461 4.42091 16.9548 4.47941C16.2635 4.53793 15.6022 4.78773 15.0448 5.20085C14.4875 5.61397 14.0561 6.17409 13.7991 6.8185C13.5421 7.4629 13.4695 8.16613 13.5895 8.84944C13.7096 9.53274 14.0174 10.1692 14.4787 10.6874C14.94 11.2056 15.5365 11.5852 16.2012 11.7836C15.9558 12.2824 15.576 12.703 15.1047 12.9979C14.6334 13.2929 14.0892 13.4505 13.5331 13.4532H10.5437C9.43702 13.4571 8.37138 13.8727 7.55427 14.6191V7.39809C8.46159 7.21288 9.26783 6.69737 9.81668 5.95151C10.3655 5.20565 10.6178 4.28256 10.5248 3.36121C10.4317 2.43987 9.99985 1.5859 9.31292 0.964873C8.62599 0.343845 7.73295 0 6.80691 0C5.88087 0 4.98783 0.343845 4.3009 0.964873C3.61397 1.5859 3.18211 2.43987 3.08904 3.36121C2.99596 4.28256 3.24831 5.20565 3.79715 5.95151C4.34599 6.69737 5.15223 7.21288 6.05955 7.39809V16.5159C5.15393 16.6891 4.34299 17.1877 3.77969 17.9176C3.21639 18.6476 2.93968 19.5585 3.00173 20.4785C3.06379 21.3984 3.46033 22.2639 4.11656 22.9115C4.77279 23.5592 5.64335 23.9444 6.56403 23.9944C7.48472 24.0445 8.39187 23.7558 9.1144 23.183C9.83693 22.6102 10.3249 21.7928 10.4862 20.885C10.6475 19.9771 10.4712 19.0417 9.99023 18.255C9.50932 17.4683 8.75717 16.8848 7.87564 16.6145C8.12152 16.1162 8.50142 15.6963 8.97272 15.4019C9.44401 15.1074 9.98803 14.9503 10.5437 14.9479H13.5331C14.4658 14.9436 15.3739 14.6486 16.1311 14.1039C16.8882 13.5592 17.4566 12.792 17.7572 11.9091C18.6531 11.7914 19.476 11.3528 20.0735 10.6748C20.671 9.9968 21.0025 9.12533 21.0067 8.22168ZM4.56483 3.73752C4.56483 3.29408 4.69633 2.8606 4.94269 2.4919C5.18906 2.12319 5.53922 1.83581 5.9489 1.66611C6.3586 1.49642 6.8094 1.45202 7.24432 1.53854C7.67924 1.62504 8.07874 1.83857 8.3923 2.15214C8.70586 2.4657 8.9194 2.8652 9.00591 3.30012C9.09241 3.73504 9.04802 4.18585 8.87832 4.59553C8.70862 5.00521 8.42125 5.35539 8.05254 5.60175C7.68383 5.84811 7.25035 5.9796 6.80691 5.9796C6.21227 5.9796 5.642 5.74339 5.22152 5.32291C4.80105 4.90245 4.56483 4.33216 4.56483 3.73752ZM9.04899 20.1794C9.04899 20.6229 8.91749 21.0563 8.67113 21.425C8.42476 21.7937 8.0746 22.0811 7.66492 22.2508C7.25523 22.4205 6.80442 22.4649 6.36951 22.3784C5.93458 22.292 5.53509 22.0784 5.22152 21.7648C4.90796 21.4512 4.69443 21.0517 4.60791 20.6169C4.52141 20.1819 4.5658 19.7311 4.7355 19.3214C4.9052 18.9117 5.19258 18.5615 5.56128 18.3152C5.92999 18.0689 6.36347 17.9373 6.80691 17.9373C7.40155 17.9373 7.97183 18.1736 8.3923 18.594C8.81277 19.0145 9.04899 19.5848 9.04899 20.1794ZM17.2699 10.4638C16.8265 10.4638 16.393 10.3322 16.0243 10.0859C15.6556 9.83954 15.3683 9.48937 15.1986 9.07969C15.0289 8.67 14.9844 8.2192 15.0709 7.78427C15.1574 7.34935 15.3709 6.94985 15.6845 6.63629C15.9981 6.32273 16.3976 6.10919 16.8325 6.02268C17.2674 5.93617 17.7183 5.98058 18.1279 6.15027C18.5377 6.31997 18.8878 6.60734 19.1341 6.97605C19.3805 7.34476 19.512 7.77823 19.512 8.22168C19.512 8.81632 19.2757 9.3866 18.8553 9.80706C18.4348 10.2275 17.8645 10.4638 17.2699 10.4638Z" fill="currentcolor" />
|
||||
</svg>
|
||||
<BranchIcon className='w-4 h-4' />
|
||||
<span className='ml-1'>{crntBanch}</span>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<ActionButton
|
||||
disabled={isSyncDisabled}
|
||||
onClick={pull}
|
||||
title={
|
||||
<div className="git_actions__sync">
|
||||
<ArrowPathIcon className={isSyncing ? 'animate-spin' : ''} />
|
||||
<span>
|
||||
{l10n.t(LocalizationKey.commonSync)}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
<div className='space-y-4'>
|
||||
<input
|
||||
type='text'
|
||||
className='rounded-md disabled:opacity-50 disabled:cursor-not-allowed'
|
||||
placeholder='Commit message'
|
||||
style={{
|
||||
...isCommitRequired
|
||||
}}
|
||||
value={commitMessage || ''}
|
||||
onChange={(e) => setCommitMessage(e.target.value)}
|
||||
disabled={isCommitDisabed}
|
||||
/>
|
||||
|
||||
<ActionButton
|
||||
disabled={isSyncDisabled || isSyncing !== "idle"}
|
||||
onClick={sync}
|
||||
title={
|
||||
<div className="git_actions__sync">
|
||||
<ArrowPathIcon className={isSyncing === "syncing" ? 'animate-spin' : ''} />
|
||||
<span>
|
||||
{l10n.t(LocalizationKey.commonSync)}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
|
||||
<ActionButton
|
||||
disabled={isSyncing !== "idle"}
|
||||
onClick={fetch}
|
||||
title={
|
||||
<div className="git_actions__fetch">
|
||||
<ArrowDownTrayIcon className={isSyncing === "fetching" ? 'animate-bounce' : ''} />
|
||||
<span>
|
||||
Fetch
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
15
src/panelWebView/components/Icons/BranchIcon.tsx
Normal file
15
src/panelWebView/components/Icons/BranchIcon.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import * as React from 'react';
|
||||
|
||||
export interface IBranchIconProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const BranchIcon: React.FunctionComponent<IBranchIconProps> = ({
|
||||
className
|
||||
}: React.PropsWithChildren<IBranchIconProps>) => {
|
||||
return (
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" className={className || ""} fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M21.0067 8.22168C21.0102 7.52792 20.8205 6.84689 20.4589 6.25485C20.0971 5.66281 19.5778 5.18315 18.959 4.86957C18.3401 4.556 17.6461 4.42091 16.9548 4.47941C16.2635 4.53793 15.6022 4.78773 15.0448 5.20085C14.4875 5.61397 14.0561 6.17409 13.7991 6.8185C13.5421 7.4629 13.4695 8.16613 13.5895 8.84944C13.7096 9.53274 14.0174 10.1692 14.4787 10.6874C14.94 11.2056 15.5365 11.5852 16.2012 11.7836C15.9558 12.2824 15.576 12.703 15.1047 12.9979C14.6334 13.2929 14.0892 13.4505 13.5331 13.4532H10.5437C9.43702 13.4571 8.37138 13.8727 7.55427 14.6191V7.39809C8.46159 7.21288 9.26783 6.69737 9.81668 5.95151C10.3655 5.20565 10.6178 4.28256 10.5248 3.36121C10.4317 2.43987 9.99985 1.5859 9.31292 0.964873C8.62599 0.343845 7.73295 0 6.80691 0C5.88087 0 4.98783 0.343845 4.3009 0.964873C3.61397 1.5859 3.18211 2.43987 3.08904 3.36121C2.99596 4.28256 3.24831 5.20565 3.79715 5.95151C4.34599 6.69737 5.15223 7.21288 6.05955 7.39809V16.5159C5.15393 16.6891 4.34299 17.1877 3.77969 17.9176C3.21639 18.6476 2.93968 19.5585 3.00173 20.4785C3.06379 21.3984 3.46033 22.2639 4.11656 22.9115C4.77279 23.5592 5.64335 23.9444 6.56403 23.9944C7.48472 24.0445 8.39187 23.7558 9.1144 23.183C9.83693 22.6102 10.3249 21.7928 10.4862 20.885C10.6475 19.9771 10.4712 19.0417 9.99023 18.255C9.50932 17.4683 8.75717 16.8848 7.87564 16.6145C8.12152 16.1162 8.50142 15.6963 8.97272 15.4019C9.44401 15.1074 9.98803 14.9503 10.5437 14.9479H13.5331C14.4658 14.9436 15.3739 14.6486 16.1311 14.1039C16.8882 13.5592 17.4566 12.792 17.7572 11.9091C18.6531 11.7914 19.476 11.3528 20.0735 10.6748C20.671 9.9968 21.0025 9.12533 21.0067 8.22168ZM4.56483 3.73752C4.56483 3.29408 4.69633 2.8606 4.94269 2.4919C5.18906 2.12319 5.53922 1.83581 5.9489 1.66611C6.3586 1.49642 6.8094 1.45202 7.24432 1.53854C7.67924 1.62504 8.07874 1.83857 8.3923 2.15214C8.70586 2.4657 8.9194 2.8652 9.00591 3.30012C9.09241 3.73504 9.04802 4.18585 8.87832 4.59553C8.70862 5.00521 8.42125 5.35539 8.05254 5.60175C7.68383 5.84811 7.25035 5.9796 6.80691 5.9796C6.21227 5.9796 5.642 5.74339 5.22152 5.32291C4.80105 4.90245 4.56483 4.33216 4.56483 3.73752ZM9.04899 20.1794C9.04899 20.6229 8.91749 21.0563 8.67113 21.425C8.42476 21.7937 8.0746 22.0811 7.66492 22.2508C7.25523 22.4205 6.80442 22.4649 6.36951 22.3784C5.93458 22.292 5.53509 22.0784 5.22152 21.7648C4.90796 21.4512 4.69443 21.0517 4.60791 20.6169C4.52141 20.1819 4.5658 19.7311 4.7355 19.3214C4.9052 18.9117 5.19258 18.5615 5.56128 18.3152C5.92999 18.0689 6.36347 17.9373 6.80691 17.9373C7.40155 17.9373 7.97183 18.1736 8.3923 18.594C8.81277 19.0145 9.04899 19.5848 9.04899 20.1794ZM17.2699 10.4638C16.8265 10.4638 16.393 10.3322 16.0243 10.0859C15.6556 9.83954 15.3683 9.48937 15.1986 9.07969C15.0289 8.67 14.9844 8.2192 15.0709 7.78427C15.1574 7.34935 15.3709 6.94985 15.6845 6.63629C15.9981 6.32273 16.3976 6.10919 16.8325 6.02268C17.2674 5.93617 17.7183 5.98058 18.1279 6.15027C18.5377 6.31997 18.8878 6.60734 19.1341 6.97605C19.3805 7.34476 19.512 7.77823 19.512 8.22168C19.512 8.81632 19.2757 9.3866 18.8553 9.80706C18.4348 10.2275 17.8645 10.4638 17.2699 10.4638Z" fill="currentcolor" />
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
@@ -976,12 +976,14 @@ vscode-divider {
|
||||
}
|
||||
|
||||
/* Git actions */
|
||||
.git_actions__fetch,
|
||||
.git_actions__sync {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.git_actions__fetch svg,
|
||||
.git_actions__sync svg {
|
||||
height: 1.25rem;
|
||||
width: 1.25rem;
|
||||
|
||||
Reference in New Issue
Block a user