From 9a4c629f3b7bda3229baa7d018415d108902c3c9 Mon Sep 17 00:00:00 2001 From: imolorhe Date: Sat, 13 Jan 2018 05:50:24 +0100 Subject: [PATCH] Added update page in docs. Added script to load the update page after updating chrome extension. Updated reducers to work with AOT. --- chrome-ext-files/js/background.js | 9 + docs/Gemfile.lock | 225 ++++++++++-------- docs/README.md | 1 + docs/_layouts/meta.html | 1 + docs/_layouts/updated.html | 16 ++ docs/_sass/_helpers.scss | 3 + docs/_sass/_layout.scss | 49 ++++ docs/assets/img/altair.svg | 28 +++ docs/css/main.scss | 2 +- docs/meta.md | 3 + docs/updated.md | 3 + package.json | 2 +- src/app/app.module.ts | 7 +- .../settings-dialog.component.ts | 4 +- .../containers/window/window.component.html | 8 +- src/app/reducers/dialogs/dialogs.ts | 2 +- src/app/reducers/docs/docs.ts | 2 +- src/app/reducers/gql-schema/gql-schema.ts | 2 +- src/app/reducers/headers/headers.ts | 2 +- src/app/reducers/history/history.ts | 2 +- src/app/reducers/index.ts | 27 ++- src/app/reducers/layout/layout.ts | 2 +- src/app/reducers/query/query.ts | 2 +- src/app/reducers/variables/variables.ts | 2 +- yarn.lock | 10 + 25 files changed, 294 insertions(+), 120 deletions(-) create mode 100644 docs/README.md create mode 100644 docs/_layouts/meta.html create mode 100644 docs/_layouts/updated.html create mode 100644 docs/_sass/_helpers.scss create mode 100644 docs/assets/img/altair.svg create mode 100644 docs/meta.md create mode 100644 docs/updated.md diff --git a/chrome-ext-files/js/background.js b/chrome-ext-files/js/background.js index 4a3f406a07..74b89eece2 100644 --- a/chrome-ext-files/js/background.js +++ b/chrome-ext-files/js/background.js @@ -35,4 +35,13 @@ curTabId = null; } }); + + // Open the update page after every new update + chrome.runtime.onInstalled.addListener(function (details) { + if (details.reason === 'update') { + chrome.tabs.create({ url: "https://altair.sirmuel.design/updated" }, function (tab) { + console.log("New tab launched with https://altair.sirmuel.design/updated"); + }); + } + }); })(); diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index d28f3ad354..0a226f80df 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,67 +1,72 @@ GEM remote: https://rubygems.org/ specs: - activesupport (4.2.8) + activesupport (4.2.9) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.5.1) - public_suffix (~> 2.0, >= 2.0.2) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.12.2) + coffee-script-source (1.11.1) colorator (1.1.0) - ethon (0.10.1) + commonmarker (0.17.7.1) + ruby-enum (~> 0.5) + concurrent-ruby (1.0.5) + ethon (0.11.0) ffi (>= 1.3.0) execjs (2.7.0) - faraday (0.12.2) + faraday (0.13.1) multipart-post (>= 1.2, < 3) ffi (1.9.18) forwardable-extended (2.6.0) gemoji (3.0.0) - github-pages (146) - activesupport (= 4.2.8) + github-pages (172) + activesupport (= 4.2.9) github-pages-health-check (= 1.3.5) - jekyll (= 3.4.5) - jekyll-avatar (= 0.4.2) - jekyll-coffeescript (= 1.0.1) + jekyll (= 3.6.2) + jekyll-avatar (= 0.5.0) + jekyll-coffeescript (= 1.0.2) + jekyll-commonmark-ghpages (= 0.1.3) jekyll-default-layout (= 0.1.4) jekyll-feed (= 0.9.2) - jekyll-gist (= 1.4.0) - jekyll-github-metadata (= 2.5.1) + jekyll-gist (= 1.4.1) + jekyll-github-metadata (= 2.9.3) jekyll-mentions (= 1.2.0) - jekyll-optional-front-matter (= 0.2.0) + jekyll-optional-front-matter (= 0.3.0) jekyll-paginate (= 1.1.0) - jekyll-readme-index (= 0.1.0) + jekyll-readme-index (= 0.2.0) jekyll-redirect-from (= 0.12.1) - jekyll-relative-links (= 0.4.1) + jekyll-relative-links (= 0.5.2) + jekyll-remote-theme (= 0.2.3) jekyll-sass-converter (= 1.5.0) - jekyll-seo-tag (= 2.2.3) - jekyll-sitemap (= 1.0.0) + jekyll-seo-tag (= 2.3.0) + jekyll-sitemap (= 1.1.1) jekyll-swiss (= 0.4.0) - jekyll-theme-architect (= 0.0.4) - jekyll-theme-cayman (= 0.0.4) - jekyll-theme-dinky (= 0.0.4) - jekyll-theme-hacker (= 0.0.4) - jekyll-theme-leap-day (= 0.0.4) - jekyll-theme-merlot (= 0.0.4) - jekyll-theme-midnight (= 0.0.4) - jekyll-theme-minimal (= 0.0.4) - jekyll-theme-modernist (= 0.0.4) - jekyll-theme-primer (= 0.3.1) - jekyll-theme-slate (= 0.0.4) - jekyll-theme-tactile (= 0.0.4) - jekyll-theme-time-machine (= 0.0.4) - jekyll-titles-from-headings (= 0.2.0) - jemoji (= 0.8.0) - kramdown (= 1.13.2) - liquid (= 3.0.6) + jekyll-theme-architect (= 0.1.0) + jekyll-theme-cayman (= 0.1.0) + jekyll-theme-dinky (= 0.1.0) + jekyll-theme-hacker (= 0.1.0) + jekyll-theme-leap-day (= 0.1.0) + jekyll-theme-merlot (= 0.1.0) + jekyll-theme-midnight (= 0.1.0) + jekyll-theme-minimal (= 0.1.0) + jekyll-theme-modernist (= 0.1.0) + jekyll-theme-primer (= 0.5.2) + jekyll-theme-slate (= 0.1.0) + jekyll-theme-tactile (= 0.1.0) + jekyll-theme-time-machine (= 0.1.0) + jekyll-titles-from-headings (= 0.5.0) + jemoji (= 0.8.1) + kramdown (= 1.14.0) + liquid (= 4.0.0) listen (= 3.0.6) mercenary (~> 0.3) minima (= 2.1.1) - rouge (= 1.11.1) + rouge (= 2.2.1) terminal-table (~> 1.4) github-pages-health-check (1.3.5) addressable (~> 2.3) @@ -69,114 +74,144 @@ GEM octokit (~> 4.0) public_suffix (~> 2.0) typhoeus (~> 0.7) - html-pipeline (2.6.0) + html-pipeline (2.7.1) activesupport (>= 2) nokogiri (>= 1.4) - i18n (0.8.6) - jekyll (3.4.5) + i18n (0.9.1) + concurrent-ruby (~> 1.0) + jekyll (3.6.2) addressable (~> 2.4) colorator (~> 1.0) jekyll-sass-converter (~> 1.0) jekyll-watch (~> 1.1) - kramdown (~> 1.3) - liquid (~> 3.0) + kramdown (~> 1.14) + liquid (~> 4.0) mercenary (~> 0.3.3) pathutil (~> 0.9) - rouge (~> 1.7) + rouge (>= 1.7, < 3) safe_yaml (~> 1.0) - jekyll-avatar (0.4.2) + jekyll-avatar (0.5.0) jekyll (~> 3.0) - jekyll-coffeescript (1.0.1) + jekyll-coffeescript (1.0.2) coffee-script (~> 2.2) + coffee-script-source (~> 1.11.1) + jekyll-commonmark (1.1.0) + commonmarker (~> 0.14) + jekyll (>= 3.0, < 4.0) + jekyll-commonmark-ghpages (0.1.3) + commonmarker (~> 0.17.6) + jekyll-commonmark (~> 1) + rouge (~> 2) jekyll-default-layout (0.1.4) jekyll (~> 3.0) jekyll-feed (0.9.2) jekyll (~> 3.3) - jekyll-gist (1.4.0) + jekyll-gist (1.4.1) octokit (~> 4.2) - jekyll-github-metadata (2.5.1) + jekyll-github-metadata (2.9.3) jekyll (~> 3.1) octokit (~> 4.0, != 4.4.0) jekyll-mentions (1.2.0) activesupport (~> 4.0) html-pipeline (~> 2.3) jekyll (~> 3.0) - jekyll-optional-front-matter (0.2.0) + jekyll-optional-front-matter (0.3.0) jekyll (~> 3.0) jekyll-paginate (1.1.0) - jekyll-readme-index (0.1.0) + jekyll-readme-index (0.2.0) jekyll (~> 3.0) jekyll-redirect-from (0.12.1) jekyll (~> 3.3) - jekyll-relative-links (0.4.1) + jekyll-relative-links (0.5.2) jekyll (~> 3.3) + jekyll-remote-theme (0.2.3) + jekyll (~> 3.5) + rubyzip (>= 1.2.1, < 3.0) + typhoeus (>= 0.7, < 2.0) jekyll-sass-converter (1.5.0) sass (~> 3.4) - jekyll-seo-tag (2.2.3) + jekyll-seo-tag (2.3.0) jekyll (~> 3.3) - jekyll-sitemap (1.0.0) + jekyll-sitemap (1.1.1) jekyll (~> 3.3) jekyll-swiss (0.4.0) - jekyll-theme-architect (0.0.4) - jekyll (~> 3.3) - jekyll-theme-cayman (0.0.4) - jekyll (~> 3.3) - jekyll-theme-dinky (0.0.4) - jekyll (~> 3.3) - jekyll-theme-hacker (0.0.4) - jekyll (~> 3.3) - jekyll-theme-leap-day (0.0.4) - jekyll (~> 3.3) - jekyll-theme-merlot (0.0.4) - jekyll (~> 3.3) - jekyll-theme-midnight (0.0.4) - jekyll (~> 3.3) - jekyll-theme-minimal (0.0.4) - jekyll (~> 3.3) - jekyll-theme-modernist (0.0.4) - jekyll (~> 3.3) - jekyll-theme-primer (0.3.1) - jekyll (~> 3.3) - jekyll-theme-slate (0.0.4) - jekyll (~> 3.3) - jekyll-theme-tactile (0.0.4) - jekyll (~> 3.3) - jekyll-theme-time-machine (0.0.4) - jekyll (~> 3.3) - jekyll-titles-from-headings (0.2.0) - jekyll (~> 3.3) - jekyll-watch (1.5.0) - listen (~> 3.0, < 3.1) - jemoji (0.8.0) - activesupport (~> 4.0) + jekyll-theme-architect (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-cayman (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-dinky (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-hacker (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-leap-day (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-merlot (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-midnight (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-minimal (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-modernist (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-primer (0.5.2) + jekyll (~> 3.5) + jekyll-github-metadata (~> 2.9) + jekyll-seo-tag (~> 2.2) + jekyll-theme-slate (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-tactile (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-time-machine (0.1.0) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-titles-from-headings (0.5.0) + jekyll (~> 3.3) + jekyll-watch (1.5.1) + listen (~> 3.0) + jemoji (0.8.1) + activesupport (~> 4.0, >= 4.2.9) gemoji (~> 3.0) html-pipeline (~> 2.2) jekyll (>= 3.0) - kramdown (1.13.2) - liquid (3.0.6) + kramdown (1.14.0) + liquid (4.0.0) listen (3.0.6) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9.7) mercenary (0.3.6) - mini_portile2 (2.2.0) + mini_portile2 (2.3.0) minima (2.1.1) jekyll (~> 3.3) - minitest (5.10.3) + minitest (5.11.1) multipart-post (2.0.0) net-dns (0.8.0) - nokogiri (~> 1.8.1) - mini_portile2 (~> 2.2.0) - octokit (4.7.0) + nokogiri (1.8.1) + mini_portile2 (~> 2.3.0) + octokit (4.8.0) sawyer (~> 0.8.0, >= 0.5.3) - pathutil (0.14.0) + pathutil (0.16.1) forwardable-extended (~> 2.6) public_suffix (2.0.5) rb-fsevent (0.10.2) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) - rouge (1.11.1) + rouge (2.2.1) + ruby-enum (0.7.1) + i18n + rubyzip (1.2.1) safe_yaml (1.0.4) - sass (3.5.1) + sass (3.5.5) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) @@ -189,7 +224,7 @@ GEM thread_safe (0.3.6) typhoeus (0.8.0) ethon (>= 0.8.0) - tzinfo (1.2.3) + tzinfo (1.2.4) thread_safe (~> 0.1) unicode-display_width (1.3.0) @@ -201,4 +236,4 @@ DEPENDENCIES tzinfo-data BUNDLED WITH - 1.15.3 + 1.16.0 diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000000..a77f2f39d4 --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +`bundle exec jekyll serve --incremental` diff --git a/docs/_layouts/meta.html b/docs/_layouts/meta.html new file mode 100644 index 0000000000..c4668f8074 --- /dev/null +++ b/docs/_layouts/meta.html @@ -0,0 +1 @@ +{{ site.github }} diff --git a/docs/_layouts/updated.html b/docs/_layouts/updated.html new file mode 100644 index 0000000000..bff108a14a --- /dev/null +++ b/docs/_layouts/updated.html @@ -0,0 +1,16 @@ +--- +layout: default +--- + +
+
+ +
+
+
{{ site.github.latest_release.tag_name }}
+
Altair has been updated.
+
Changelog:
+
{{ site.github.latest_release.body | markdownify }}
+ +
+
diff --git a/docs/_sass/_helpers.scss b/docs/_sass/_helpers.scss new file mode 100644 index 0000000000..ecf3da6016 --- /dev/null +++ b/docs/_sass/_helpers.scss @@ -0,0 +1,3 @@ +.text-center { + text-align: center; +} diff --git a/docs/_sass/_layout.scss b/docs/_sass/_layout.scss index 9e7d10d54a..e754eef7c6 100644 --- a/docs/_sass/_layout.scss +++ b/docs/_sass/_layout.scss @@ -130,3 +130,52 @@ $hero-height: 700px; } } } + +.ns-updated { + min-height: 100vh; + background-image: url('../assets/img/hero_bg.png'); + .logo-container { + text-align: center; + padding: 30px; + margin-bottom: 20px; + } + .logo { + max-width: 150px; + } + .inner-container { + margin: 0 auto; + max-width: 700px; + text-align: center; + ul { + margin-left: 30px; + } + li { + list-style-type: square; + } + } + .version { + font-size: 32px; + margin-bottom: 10px;; + } + .heading { + font-weight: bold; + font-size: 24px; + margin-bottom: 10px; + } + .subheading { + font-size: 18px; + margin-bottom: 10px; + } + .changelog { + padding: 20px; + margin-bottom: 20px; + text-align: left; + background: rgba($dark, .1); + border-radius: 5px; + } + .changelog-btn { + @extend %button; + color: $light; + background: $dark; + } +} diff --git a/docs/assets/img/altair.svg b/docs/assets/img/altair.svg new file mode 100644 index 0000000000..8b32a0c0a2 --- /dev/null +++ b/docs/assets/img/altair.svg @@ -0,0 +1,28 @@ + + + + Pubsicle logo + Created with Sketch. + + + + + \ No newline at end of file diff --git a/docs/css/main.scss b/docs/css/main.scss index 9ae90ed143..bf172e8562 100644 --- a/docs/css/main.scss +++ b/docs/css/main.scss @@ -1,3 +1,3 @@ --- --- -@import "grid", "layout" +@import "grid", "layout", "helpers" diff --git a/docs/meta.md b/docs/meta.md new file mode 100644 index 0000000000..0c07c0bd4b --- /dev/null +++ b/docs/meta.md @@ -0,0 +1,3 @@ +--- +layout: meta +--- diff --git a/docs/updated.md b/docs/updated.md new file mode 100644 index 0000000000..4a03105fa7 --- /dev/null +++ b/docs/updated.md @@ -0,0 +1,3 @@ +--- +layout: updated +--- diff --git a/package.json b/package.json index 0d7f7b0694..b042e12126 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "electron-squirrel-startup": "^1.0.0", "electron-updater": "^2.16.1", "express": "^4.16.2", - "graphql": "^0.12.3", + "graphql": "0.9.3", "graphql-query-compress": "^0.9.6", "marked": "^0.3.12", "ng2-codemirror": "^1.1.3", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6c510c1429..2a77bc4852 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -19,7 +19,7 @@ import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { ClarityModule } from 'clarity-angular'; import { SharedModule } from './shared/shared.module'; -import { reducer, metaReducers } from './reducers'; +import { reducer, metaReducers, reducerToken, reducerProvider } from './reducers'; import { QueryEffects } from './effects/query'; @@ -54,7 +54,8 @@ const providers = [ services.QueryService, services.WindowService, services.NotifyService, - { provide: ToastOptions, useClass: CustomOption } + { provide: ToastOptions, useClass: CustomOption }, + reducerProvider ]; @NgModule({ @@ -71,7 +72,7 @@ const providers = [ ClarityModule.forRoot(), ComponentModule, DocViewerModule, - StoreModule.forRoot(reducer, { metaReducers }), + StoreModule.forRoot(reducerToken, { metaReducers }), EffectsModule.forRoot([ QueryEffects ]), StoreDevtoolsModule.instrument(), ToastModule.forRoot(), diff --git a/src/app/components/settings-dialog/settings-dialog.component.ts b/src/app/components/settings-dialog/settings-dialog.component.ts index 9b3950f32a..b2764295e8 100644 --- a/src/app/components/settings-dialog/settings-dialog.component.ts +++ b/src/app/components/settings-dialog/settings-dialog.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import * as fromSettings from '../../reducers/settings/settings'; + import config from '../../config'; @Component({ @@ -9,7 +11,7 @@ import config from '../../config'; }) export class SettingsDialogComponent implements OnInit { - @Input() settings = {}; + @Input() settings: fromSettings.State; @Output() toggleDialogChange = new EventEmitter(); @Output() themeChange = new EventEmitter(); @Output() languageChange = new EventEmitter(); diff --git a/src/app/containers/window/window.component.html b/src/app/containers/window/window.component.html index 26adcbc522..0aa22cfc7e 100644 --- a/src/app/containers/window/window.component.html +++ b/src/app/containers/window/window.component.html @@ -132,19 +132,19 @@