diff --git a/CHANGELOG.md b/CHANGELOG.md index 80d8ddb7..6d1bf27b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## [1.13.0] - 2020-02-26 + +- Implemented links to quickly open the extension settings + issue from the FrontMatter view panel +- Added button to update the modified time in the FrontMatter view panel + ## [1.12.1] - 2020-02-13 - Fix Front Matter SVG diff --git a/assets/media/styles.css b/assets/media/styles.css index 973a3ea9..90e9e57f 100644 --- a/assets/media/styles.css +++ b/assets/media/styles.css @@ -197,4 +197,20 @@ border-right: 1px solid var(--vscode-inputValidation-infoBorder); filter: contrast(60%); +} + +.ext_link_block { + margin-bottom: .5rem; + text-align: right; +} + +.ext_link_block a { + color: var(--vscode-textLink-foreground); +} + +.ext_link_block a:hover, +.ext_link_block a:active, +.ext_link_block a:focus, +.ext_link_block a:visited { + color: var(--vscode-textLink-activeForeground); } \ No newline at end of file diff --git a/src/viewpanel/CommandToCode.ts b/src/viewpanel/CommandToCode.ts index b3e02fcf..7437e578 100644 --- a/src/viewpanel/CommandToCode.ts +++ b/src/viewpanel/CommandToCode.ts @@ -2,9 +2,11 @@ export enum CommandToCode { getData = "get-data", updateSlug = 'update-slug', updateDate = 'update-date', + updateLastMod = 'update-lastmod', publish = 'publish', updateTags = "update-tags", updateCategories = "update-categories", addTagToSettings = "add-tag", - addCategoryToSettings = "add-category" + addCategoryToSettings = "add-category", + openSettings = "open-settings" } \ No newline at end of file diff --git a/src/viewpanel/ViewPanel.tsx b/src/viewpanel/ViewPanel.tsx index 716b780c..db0cb9c7 100644 --- a/src/viewpanel/ViewPanel.tsx +++ b/src/viewpanel/ViewPanel.tsx @@ -1,8 +1,10 @@ import * as React from 'react'; +import { CommandToCode } from './CommandToCode'; import { Actions } from './components/Actions'; import { SeoStatus } from './components/SeoStatus'; import { Spinner } from './components/Spinner'; import { TagPicker } from './components/TagPicker'; +import { MessageHelper } from './helper/MessageHelper'; import useMessages from './hooks/useMessages'; import { TagType } from './TagType'; @@ -26,6 +28,10 @@ export const ViewPanel: React.FunctionComponent = (props: React ); } + const openSettings = () => { + MessageHelper.sendMessage(CommandToCode.openSettings); + }; + return (
{ @@ -54,6 +60,14 @@ export const ViewPanel: React.FunctionComponent = (props: React unsetFocus={unsetFocus} /> ) } + +
+ Open settings +
+ +
+ Report an issue +
); }; \ No newline at end of file diff --git a/src/viewpanel/components/DateAction.tsx b/src/viewpanel/components/DateAction.tsx index d18a94d0..27c49aeb 100644 --- a/src/viewpanel/components/DateAction.tsx +++ b/src/viewpanel/components/DateAction.tsx @@ -1,5 +1,3 @@ - - import * as React from 'react'; import { CommandToCode } from '../CommandToCode'; import { MessageHelper } from '../helper/MessageHelper'; @@ -11,10 +9,19 @@ export const DateAction: React.FunctionComponent = (props: Rea const setDate = () => { MessageHelper.sendMessage(CommandToCode.updateDate); }; + + const setLastMod = () => { + MessageHelper.sendMessage(CommandToCode.updateLastMod); + }; return ( -
- -
+ <> +
+ +
+
+ +
+ ); }; \ No newline at end of file diff --git a/src/webview/ExplorerView.ts b/src/webview/ExplorerView.ts index fec3ed65..c5871b91 100644 --- a/src/webview/ExplorerView.ts +++ b/src/webview/ExplorerView.ts @@ -1,5 +1,5 @@ import { PanelSettings } from './../models/PanelSettings'; -import { CancellationToken, Disposable, Uri, Webview, WebviewView, WebviewViewProvider, WebviewViewResolveContext, window, workspace } from "vscode"; +import { CancellationToken, Disposable, Uri, Webview, WebviewView, WebviewViewProvider, WebviewViewResolveContext, window, workspace, commands } from "vscode"; import { CONFIG_KEY, SETTING_PANEL_FREEFORM, SETTING_SEO_DESCRIPTION_LENGTH, SETTING_SEO_TITLE_LENGTH, SETTING_SLUG_PREFIX, SETTING_SLUG_SUFFIX, SETTING_TAXONOMY_CATEGORIES, SETTING_TAXONOMY_TAGS } from "../constants"; import { ArticleHelper, SettingsHelper } from "../helpers"; import { Command } from "../viewpanel/Command"; @@ -82,6 +82,9 @@ export class ExplorerView implements WebviewViewProvider, Disposable { case CommandToCode.updateDate: Article.setDate(); break; + case CommandToCode.updateLastMod: + Article.setLastModifiedDate(); + break; case CommandToCode.publish: Article.toggleDraft(); break; @@ -97,6 +100,9 @@ export class ExplorerView implements WebviewViewProvider, Disposable { case CommandToCode.addCategoryToSettings: this.addTags(TagType.categories, msg.data); break; + case CommandToCode.openSettings: + commands.executeCommand('workbench.action.openSettings', '@ext:eliostruyf.vscode-front-matter'); + break; } });