From b851d3003caa425b29f1e960d239c6b1aa743278 Mon Sep 17 00:00:00 2001 From: Anwarul Islam Date: Thu, 27 Jun 2024 22:03:33 +0600 Subject: [PATCH] feat: added change log prompt for PWA updates (#4098) Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com> Co-authored-by: nivedin Co-authored-by: Andrew Bastin --- package.json | 2 +- packages/hoppscotch-common/locales/en.json | 2 + packages/hoppscotch-common/package.json | 2 +- packages/hoppscotch-common/src/App.vue | 2 + .../hoppscotch-common/src/components.d.ts | 2 + .../src/components/app/WhatsNewDialog.vue | 46 +++++ .../src/components/http/Codegen.vue | 2 +- .../src/components/http/Sidebar.vue | 2 +- .../hoppscotch-common/src/composables/pwa.ts | 45 +++-- .../src/composables/whats-new.ts | 61 ++++++ .../src/modules/whats-new.ts | 8 + pnpm-lock.yaml | 185 +++++++++++------- 12 files changed, 261 insertions(+), 98 deletions(-) create mode 100644 packages/hoppscotch-common/src/components/app/WhatsNewDialog.vue create mode 100644 packages/hoppscotch-common/src/composables/whats-new.ts create mode 100644 packages/hoppscotch-common/src/modules/whats-new.ts diff --git a/package.json b/package.json index f4286102b..0889b23b0 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "devDependencies": { "@commitlint/cli": "16.3.0", "@commitlint/config-conventional": "16.2.4", - "@hoppscotch/ui": "0.1.0", + "@hoppscotch/ui": "0.2.0", "@types/node": "17.0.27", "cross-env": "7.0.3", "http-server": "14.1.1", diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json index 25fd77a60..47553adc0 100644 --- a/packages/hoppscotch-common/locales/en.json +++ b/packages/hoppscotch-common/locales/en.json @@ -98,7 +98,9 @@ "twitter": "Twitter", "type_a_command_search": "Type a command or search…", "we_use_cookies": "We use cookies", + "updated_text": "Hoppscotch has been updated to the version {version} 🎉", "whats_new": "What's new?", + "see_whats_new": "See what’s new", "wiki": "Wiki" }, "auth": { diff --git a/packages/hoppscotch-common/package.json b/packages/hoppscotch-common/package.json index 2f9d47af8..da8fe681b 100644 --- a/packages/hoppscotch-common/package.json +++ b/packages/hoppscotch-common/package.json @@ -36,7 +36,7 @@ "@hoppscotch/codemirror-lang-graphql": "workspace:^", "@hoppscotch/data": "workspace:^", "@hoppscotch/js-sandbox": "workspace:^", - "@hoppscotch/ui": "0.1.0", + "@hoppscotch/ui": "0.2.0", "@hoppscotch/vue-toasted": "0.1.0", "@lezer/highlight": "1.2.0", "@unhead/vue": "1.8.8", diff --git a/packages/hoppscotch-common/src/App.vue b/packages/hoppscotch-common/src/App.vue index 47a086935..8d9d7e4d1 100644 --- a/packages/hoppscotch-common/src/App.vue +++ b/packages/hoppscotch-common/src/App.vue @@ -8,6 +8,7 @@ + @@ -19,6 +20,7 @@ import { isLoadingInitialRoute } from "@modules/router" import { useI18n } from "@composables/i18n" import { APP_IS_IN_DEV_MODE } from "@helpers/dev" import { platform } from "./platform" +import { Toaster } from "@hoppscotch/ui" const t = useI18n() diff --git a/packages/hoppscotch-common/src/components.d.ts b/packages/hoppscotch-common/src/components.d.ts index 95a157787..f46a2f99c 100644 --- a/packages/hoppscotch-common/src/components.d.ts +++ b/packages/hoppscotch-common/src/components.d.ts @@ -23,6 +23,7 @@ declare module 'vue' { AppLogo: typeof import('./components/app/Logo.vue')['default'] AppOptions: typeof import('./components/app/Options.vue')['default'] AppPaneLayout: typeof import('./components/app/PaneLayout.vue')['default'] + AppPWAPrompt: typeof import('./components/app/PWAPrompt.vue')['default'] AppShare: typeof import('./components/app/Share.vue')['default'] AppShortcuts: typeof import('./components/app/Shortcuts.vue')['default'] AppShortcutsEntry: typeof import('./components/app/ShortcutsEntry.vue')['default'] @@ -38,6 +39,7 @@ declare module 'vue' { AppSpotlightEntryRESTTeamRequestEntry: typeof import('./components/app/spotlight/entry/RESTTeamRequestEntry.vue')['default'] AppSpotlightSearch: typeof import('./components/app/SpotlightSearch.vue')['default'] AppSupport: typeof import('./components/app/Support.vue')['default'] + AppWhatsNewDialog: typeof import('./components/app/WhatsNewDialog.vue')['default'] Collections: typeof import('./components/collections/index.vue')['default'] CollectionsAdd: typeof import('./components/collections/Add.vue')['default'] CollectionsAddFolder: typeof import('./components/collections/AddFolder.vue')['default'] diff --git a/packages/hoppscotch-common/src/components/app/WhatsNewDialog.vue b/packages/hoppscotch-common/src/components/app/WhatsNewDialog.vue new file mode 100644 index 000000000..39345cee5 --- /dev/null +++ b/packages/hoppscotch-common/src/components/app/WhatsNewDialog.vue @@ -0,0 +1,46 @@ + + + diff --git a/packages/hoppscotch-common/src/components/http/Codegen.vue b/packages/hoppscotch-common/src/components/http/Codegen.vue index f848c086b..2fcc7960c 100644 --- a/packages/hoppscotch-common/src/components/http/Codegen.vue +++ b/packages/hoppscotch-common/src/components/http/Codegen.vue @@ -1,6 +1,6 @@