alamion_obsidian-jira-sync/src/commands/addWorkLogManually.ts
Alamion 67308c0fec
settings update:
- css enchantments
  - template now can be selected instead of raw manual input
  - internationalization implementation
  - work statistics now integrated in settings
2025-08-25 02:48:14 +03:00

26 lines
931 B
TypeScript

import {TFile} from "obsidian";
import JiraPlugin from "../main";
import {IssueWorkLogModal} from "../modals";
import {addWorkLog} from "../api";
import {checkCommandCallback} from "../tools/check_command_callback";
import {useTranslations} from "../localization/translator";
const t = useTranslations("commands.add_worklog.manual").t;
export function registerUpdateWorkLogManuallyCommand(plugin: JiraPlugin): void {
plugin.addCommand({
id: "update-work-log-jira-manually",
name: t("name"),
checkCallback: (checking: boolean) => {
return checkCommandCallback(plugin, checking, processManualWorkLog, ["key"], ["key"]);
},
});
}
async function processManualWorkLog(plugin: JiraPlugin, _: TFile, issueKey: string): Promise<void> {
new IssueWorkLogModal(plugin.app, async (timeSpent: string, startDate: string, comment: string) => {
await addWorkLog(plugin, issueKey, timeSpent, startDate, comment);
}).open();
}