From 42b5a4ac9e5c7ddb726fd51195c38feddc0c8335 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 9 Jan 2024 16:49:55 +0100 Subject: [PATCH] Remove obsolete translation strings --- l10n/bundle.l10n.json | 3 - src/commands/Article.ts | 74 ------------------- .../components/Menu/ActionMenuButton.tsx | 2 +- src/helpers/Questions.ts | 4 +- src/localization/localization.enum.ts | 12 --- 5 files changed, 2 insertions(+), 93 deletions(-) diff --git a/l10n/bundle.l10n.json b/l10n/bundle.l10n.json index c3805bb5..ced9308e 100644 --- a/l10n/bundle.l10n.json +++ b/l10n/bundle.l10n.json @@ -465,8 +465,6 @@ "panel.viewPanel.mediaInsert": "Continue in the media dashboard to select the image you want to insert.", - "commands.article.notification.noTaxonomy": "No {0} configured.", - "commands.article.quickPick.placeholder": "Select your {0} to insert.", "commands.article.setDate.error": "Something failed while parsing the date format. Check your \"{0}\" setting.", "commands.article.updateSlug.error": "Failed to rename file: {0}", @@ -638,7 +636,6 @@ "helpers.questions.contentTitle.titleInput.warning": "You did not specify a title for your content.", "helpers.questions.selectContentFolder.quickPick.title": "Select a folder", "helpers.questions.selectContentFolder.quickPick.placeholder": "Select where you want to create your content", - "helpers.questions.selectContentFolder.quickPick.noFolders.warning": "No page folders were configured.", "helpers.questions.selectContentFolder.quickPick.noSelection.warning": "You didn't select a place where you wanted to create your content.", "helpers.questions.selectContentType.noContentType.warning": "No content types found. Please create a content type first.", "helpers.questions.selectContentType.quickPick.title": "Content type", diff --git a/src/commands/Article.ts b/src/commands/Article.ts index f6e36e05..30082426 100644 --- a/src/commands/Article.ts +++ b/src/commands/Article.ts @@ -33,80 +33,6 @@ import * as l10n from '@vscode/l10n'; import { LocalizationKey } from '../localization'; export class Article { - /** - * Insert taxonomy - * - * @param type - */ - public static async insert(type: TaxonomyType) { - const editor = vscode.window.activeTextEditor; - if (!editor) { - return; - } - - const article = ArticleHelper.getCurrent(); - - if (!article) { - return; - } - - let options: vscode.QuickPickItem[] = []; - const matterProp: string = type === TaxonomyType.Tag ? 'tags' : 'categories'; - - // Add the selected options to the options array - if (article.data[matterProp]) { - const propData = article.data[matterProp]; - if (propData && propData.length > 0) { - options = [...propData] - .filter((p) => p) - .map( - (p) => - ({ - label: p, - picked: true - } as vscode.QuickPickItem) - ); - } - } - - // Add all the known options to the selection list - const crntOptions = (await TaxonomyHelper.get(type)) || []; - if (crntOptions && crntOptions.length > 0) { - for (const crntOpt of crntOptions) { - if (!options.find((o) => o.label === crntOpt)) { - options.push({ - label: crntOpt - }); - } - } - } - - if (options.length === 0) { - Notifications.info( - l10n.t( - LocalizationKey.commandsArticleNotificationNoTaxonomy, - type === TaxonomyType.Tag ? 'tags' : 'categories' - ) - ); - return; - } - - const selectedOptions = await vscode.window.showQuickPick(options, { - placeHolder: l10n.t( - LocalizationKey.commandsArticleQuickPickPlaceholder, - type === TaxonomyType.Tag ? 'tags' : 'categories' - ), - canPickMany: true, - ignoreFocusOut: true - }); - - if (selectedOptions) { - article.data[matterProp] = selectedOptions.map((o) => o.label); - } - - ArticleHelper.update(editor, article); - } - /** * Sets the article date */ diff --git a/src/dashboardWebView/components/Menu/ActionMenuButton.tsx b/src/dashboardWebView/components/Menu/ActionMenuButton.tsx index a6429349..495cdcd2 100644 --- a/src/dashboardWebView/components/Menu/ActionMenuButton.tsx +++ b/src/dashboardWebView/components/Menu/ActionMenuButton.tsx @@ -19,7 +19,7 @@ export const ActionMenuButton: React.FunctionComponent = return ( e.stopPropagation()} + onClick={(e: React.MouseEvent) => e.stopPropagation()} disabled={disabled} className={`group inline-flex justify-center text-sm font-medium ${getColors( 'text-vulcan-400 hover:text-vulcan-600 dark:text-gray-400 dark:hover:text-whisper-600', diff --git a/src/helpers/Questions.ts b/src/helpers/Questions.ts index c72c630e..d9111034 100644 --- a/src/helpers/Questions.ts +++ b/src/helpers/Questions.ts @@ -142,9 +142,7 @@ export class Questions { } else if (folders.length === 1) { selectedFolder = folders[0].title; } else { - Notifications.warning( - l10n.t(LocalizationKey.helpersQuestionsSelectContentFolderQuickPickNoFoldersWarning) - ); + // When no page folders are found, the welcome dashboard is shown return; } diff --git a/src/localization/localization.enum.ts b/src/localization/localization.enum.ts index 3b49353f..f6d4d2a6 100644 --- a/src/localization/localization.enum.ts +++ b/src/localization/localization.enum.ts @@ -1480,14 +1480,6 @@ export enum LocalizationKey { * Continue in the media dashboard to select the image you want to insert. */ panelViewPanelMediaInsert = 'panel.viewPanel.mediaInsert', - /** - * No {0} configured. - */ - commandsArticleNotificationNoTaxonomy = 'commands.article.notification.noTaxonomy', - /** - * Select your {0} to insert. - */ - commandsArticleQuickPickPlaceholder = 'commands.article.quickPick.placeholder', /** * Something failed while parsing the date format. Check your "{0}" setting. */ @@ -2092,10 +2084,6 @@ export enum LocalizationKey { * Select where you want to create your content */ helpersQuestionsSelectContentFolderQuickPickPlaceholder = 'helpers.questions.selectContentFolder.quickPick.placeholder', - /** - * No page folders were configured. - */ - helpersQuestionsSelectContentFolderQuickPickNoFoldersWarning = 'helpers.questions.selectContentFolder.quickPick.noFolders.warning', /** * You didn't select a place where you wanted to create your content. */