diff --git a/extensions/webviews/ReleaseNotes.ts b/extensions/webviews/ReleaseNotes.ts index f4f6da7..ba650a8 100644 --- a/extensions/webviews/ReleaseNotes.ts +++ b/extensions/webviews/ReleaseNotes.ts @@ -2,9 +2,8 @@ import {WebviewController} from './Webview'; import { ExtensionContext } from 'vscode'; -import {ReleaseNotesBootstrap} from './interfaces'; -export class ReleaseNotesWebview extends WebviewController { +export class ReleaseNotesWebview extends WebviewController<{}> { constructor(context: ExtensionContext) { super(context); } @@ -26,8 +25,6 @@ export class ReleaseNotesWebview extends WebviewController sanityClient({ + projectId: 'v475t82f', + dataset: 'production' +}); + const getReleaseNotes = (): Promise => { - const uri = 'https://raw.githubusercontent.com/equinusocio/vsc-material-theme-releases/master/releases/index.json'; - return fetch(uri).then(res => res.json()); + const query = '*[_type == "release"] | order(_createdAt desc)'; + const client = getClient(); + return client.fetch(query); }; const renderTemplate = (posts: IPost[]) => { @@ -12,13 +20,19 @@ const renderTemplate = (posts: IPost[]) => {

${title}

    - ${fixed.reduce((accc, src) => accc.concat(`
  • ${src}
  • `), '')} - ${newItems.reduce((accc, src) => accc.concat(`
  • ${src}
  • `), '')} - ${breaking.reduce((accc, src) => accc.concat(`
  • ${src}
  • `), '')} + ${fixed.reduce((accc: string, src) => accc.concat(`
  • ${src}
  • `), '')} + ${newItems.reduce((accc: string, src) => accc.concat(`
  • ${src}
  • `), '')} + ${breaking.reduce((accc: string, src) => accc.concat(`
  • ${src}
  • `), '')}
`), '')}`; }; getReleaseNotes().then((res: IPost[]) => { - document.querySelector('.Container').innerHTML = renderTemplate(res); + const normalized = res.reduce((acc, src) => acc.concat({ + ...src, + fixed: src.fixed ? src.fixed.map(item => item.children[0].text) : [], + new: src.new ? src.new.map(item => item.children[0].text) : [], + breaking: src.breaking ? src.breaking.map(item => item.children[0].text) : [] + }), []); + document.querySelector('.Container').innerHTML = renderTemplate(normalized); }); diff --git a/extensions/webviews/ui/release-notes/release-notes.html b/extensions/webviews/ui/release-notes/release-notes.html index 650bbe3..2e29316 100644 --- a/extensions/webviews/ui/release-notes/release-notes.html +++ b/extensions/webviews/ui/release-notes/release-notes.html @@ -11,44 +11,7 @@
-
-
- 2.4.2 -

August 30, 2018

-
-
    -
  • Fix missing commands
  • -
-
- -
-
- 2.4.1 -

August 30, 2018

-
-
    -
  • Fix new settings view colors for Code <= 1.26.0
  • -
-
- -
-
- 2.4.0 -

August 29, 2018

-
-
    -
  • New file icons auto applying and notifications behaviors
  • -
  • Many UI fixes and small improvements
  • -
  • General colors and contrast
  • -
  • Fix color contrast for hovered custom menu items (Win/Lin)
  • -
  • New file icons
  • -
  • Support for custom menus (Windows/Linux)
  • -
  • Support for the editor breadcrumb
  • -
  • Support for editor new settings view
  • -
  • Add new Release Notes command
  • -
  • Add icons to root folders
  • -
-
+
Loading...