From 1f0b56b96e882e7015227359745a976ad1ef49d6 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Mon, 27 Oct 2025 14:39:49 +0530 Subject: [PATCH] feat: Changelog card components (#12673) # Pull Request Template ## Description This PR introduces a new changelog component that can be used in the sidebar. Fixes https://linear.app/chatwoot/issue/CW-5776/changelog-card-ui-component ## Type of change - [x] New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Screencast https://github.com/user-attachments/assets/42e77e82-388a-4fc9-9b37-f3d0ea1a9d7f ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Muhsin --- app/javascript/dashboard/api/changelog.js | 16 +++ .../GroupedStackedChangelogCard.story.vue | 114 +++++++++++++++++ .../GroupedStackedChangelogCard.vue | 74 +++++++++++ .../StackedChangelogCard.story.vue | 46 +++++++ .../changelog-card/StackedChangelogCard.vue | 119 ++++++++++++++++++ .../components-next/sidebar/Sidebar.vue | 33 +++-- .../sidebar/SidebarChangelogCard.vue | 110 ++++++++++++++++ app/javascript/shared/constants/links.js | 2 + 8 files changed, 505 insertions(+), 9 deletions(-) create mode 100644 app/javascript/dashboard/api/changelog.js create mode 100644 app/javascript/dashboard/components-next/changelog-card/GroupedStackedChangelogCard.story.vue create mode 100644 app/javascript/dashboard/components-next/changelog-card/GroupedStackedChangelogCard.vue create mode 100644 app/javascript/dashboard/components-next/changelog-card/StackedChangelogCard.story.vue create mode 100644 app/javascript/dashboard/components-next/changelog-card/StackedChangelogCard.vue create mode 100644 app/javascript/dashboard/components-next/sidebar/SidebarChangelogCard.vue diff --git a/app/javascript/dashboard/api/changelog.js b/app/javascript/dashboard/api/changelog.js new file mode 100644 index 000000000..8cf0cdea1 --- /dev/null +++ b/app/javascript/dashboard/api/changelog.js @@ -0,0 +1,16 @@ +import axios from 'axios'; +import ApiClient from './ApiClient'; +import { CHANGELOG_API_URL } from 'shared/constants/links'; + +class ChangelogApi extends ApiClient { + constructor() { + super('changelog', { apiVersion: 'v1' }); + } + + // eslint-disable-next-line class-methods-use-this + fetchFromHub() { + return axios.get(CHANGELOG_API_URL); + } +} + +export default new ChangelogApi(); diff --git a/app/javascript/dashboard/components-next/changelog-card/GroupedStackedChangelogCard.story.vue b/app/javascript/dashboard/components-next/changelog-card/GroupedStackedChangelogCard.story.vue new file mode 100644 index 000000000..0f3484e52 --- /dev/null +++ b/app/javascript/dashboard/components-next/changelog-card/GroupedStackedChangelogCard.story.vue @@ -0,0 +1,114 @@ + + + diff --git a/app/javascript/dashboard/components-next/changelog-card/GroupedStackedChangelogCard.vue b/app/javascript/dashboard/components-next/changelog-card/GroupedStackedChangelogCard.vue new file mode 100644 index 000000000..617e5d0f8 --- /dev/null +++ b/app/javascript/dashboard/components-next/changelog-card/GroupedStackedChangelogCard.vue @@ -0,0 +1,74 @@ + + + diff --git a/app/javascript/dashboard/components-next/changelog-card/StackedChangelogCard.story.vue b/app/javascript/dashboard/components-next/changelog-card/StackedChangelogCard.story.vue new file mode 100644 index 000000000..26978b422 --- /dev/null +++ b/app/javascript/dashboard/components-next/changelog-card/StackedChangelogCard.story.vue @@ -0,0 +1,46 @@ + + + diff --git a/app/javascript/dashboard/components-next/changelog-card/StackedChangelogCard.vue b/app/javascript/dashboard/components-next/changelog-card/StackedChangelogCard.vue new file mode 100644 index 000000000..8b2d430a4 --- /dev/null +++ b/app/javascript/dashboard/components-next/changelog-card/StackedChangelogCard.vue @@ -0,0 +1,119 @@ + + + + + diff --git a/app/javascript/dashboard/components-next/sidebar/Sidebar.vue b/app/javascript/dashboard/components-next/sidebar/Sidebar.vue index cef4346e9..edcb4106e 100644 --- a/app/javascript/dashboard/components-next/sidebar/Sidebar.vue +++ b/app/javascript/dashboard/components-next/sidebar/Sidebar.vue @@ -13,6 +13,7 @@ import { vOnClickOutside } from '@vueuse/components'; import Button from 'dashboard/components-next/button/Button.vue'; import SidebarGroup from './SidebarGroup.vue'; import SidebarProfileMenu from './SidebarProfileMenu.vue'; +import SidebarChangelogCard from './SidebarChangelogCard.vue'; import ChannelLeaf from './ChannelLeaf.vue'; import SidebarAccountSwitcher from './SidebarAccountSwitcher.vue'; import Logo from 'next/icon/Logo.vue'; @@ -32,11 +33,15 @@ const emit = defineEmits([ 'closeMobileSidebar', ]); -const { accountScopedRoute } = useAccount(); +const { accountScopedRoute, isOnChatwootCloud } = useAccount(); const store = useStore(); const searchShortcut = useKbd([`$mod`, 'k']); const { t } = useI18n(); +const isACustomBrandedInstance = useMapGetter( + 'globalConfig/isACustomBrandedInstance' +); + const toggleShortcutModalFn = show => { if (show) { emit('openKeyShortcutModal'); @@ -532,20 +537,20 @@ const menuItems = computed(() => { ]" >
-
-
+
+
@@ -570,7 +575,7 @@ const menuItems = computed(() => {
-