From d45dae62142128c38fa5b16923bac6eb97c5631c Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Thu, 10 Oct 2024 04:59:43 +0000 Subject: [PATCH] feat: cloud changelogs --- .../components/feed/Changelog/index.vue | 23 ++++++++++++++----- packages/nc-gui/components/feed/Error.vue | 6 +++-- packages/nc-gui/components/feed/View.vue | 14 +++++++---- packages/nc-gui/composables/useProductFeed.ts | 15 +++++++++++- packages/nc-gui/lib/types.ts | 2 +- packages/nocodb/src/schema/swagger.json | 3 ++- 6 files changed, 48 insertions(+), 15 deletions(-) diff --git a/packages/nc-gui/components/feed/Changelog/index.vue b/packages/nc-gui/components/feed/Changelog/index.vue index 8ee3811e67..59754a89f4 100644 --- a/packages/nc-gui/components/feed/Changelog/index.vue +++ b/packages/nc-gui/components/feed/Changelog/index.vue @@ -1,5 +1,9 @@ diff --git a/packages/nc-gui/components/feed/Error.vue b/packages/nc-gui/components/feed/Error.vue index 5bbdcfaa97..ed86a2ad19 100644 --- a/packages/nc-gui/components/feed/Error.vue +++ b/packages/nc-gui/components/feed/Error.vue @@ -1,11 +1,11 @@ diff --git a/packages/nc-gui/components/feed/View.vue b/packages/nc-gui/components/feed/View.vue index b2b554ee67..19c205ef4b 100644 --- a/packages/nc-gui/components/feed/View.vue +++ b/packages/nc-gui/components/feed/View.vue @@ -21,7 +21,13 @@ const tabs: Array<{ container: FeedRecents, }, { - key: 'changelog', + key: 'cloud', + icon: 'ncCloud', + title: 'Cloud Changelog', + container: FeedChangelog, + }, + { + key: 'github', icon: 'ncList', title: 'Changelog', container: FeedChangelog, @@ -89,13 +95,13 @@ onMounted(() => {
diff --git a/packages/nc-gui/composables/useProductFeed.ts b/packages/nc-gui/composables/useProductFeed.ts index 1da30ba2f2..b02650bd6f 100644 --- a/packages/nc-gui/composables/useProductFeed.ts +++ b/packages/nc-gui/composables/useProductFeed.ts @@ -14,13 +14,16 @@ export const useProductFeed = createSharedComposable(() => { const socialFeed = ref([]) + const cloudFeed = ref([]) + const isErrorOccurred = reactive({ youtube: false, github: false, social: false, + cloud: false, }) - const loadFeed = async ({ loadMore, type }: { loadMore: boolean; type: 'youtube' | 'github' | 'all' }) => { + const loadFeed = async ({ loadMore, type }: { loadMore: boolean; type: 'youtube' | 'github' | 'all' | 'cloud' }) => { try { let page = 1 @@ -35,6 +38,9 @@ export const useProductFeed = createSharedComposable(() => { case 'all': page = Math.ceil(socialFeed.value.length / 10) + 1 break + case 'cloud': + page = Math.ceil(cloudFeed.value.length / 10) + 1 + break } } @@ -50,6 +56,9 @@ export const useProductFeed = createSharedComposable(() => { case 'all': socialFeed.value = [...socialFeed.value, ...response] as ProductFeedItem[] break + case 'cloud': + cloudFeed.value = [...cloudFeed.value, ...response] as ProductFeedItem[] + break } } catch (error) { switch (type) { @@ -62,6 +71,9 @@ export const useProductFeed = createSharedComposable(() => { case 'all': isErrorOccurred.social = true break + case 'cloud': + isErrorOccurred.cloud = true + break } console.error(error) return [] @@ -113,6 +125,7 @@ export const useProductFeed = createSharedComposable(() => { youtubeFeed, githubFeed, socialFeed, + cloudFeed, loadFeed, isNewFeedAvailable, } diff --git a/packages/nc-gui/lib/types.ts b/packages/nc-gui/lib/types.ts index 8e18b79a34..baaab219ef 100644 --- a/packages/nc-gui/lib/types.ts +++ b/packages/nc-gui/lib/types.ts @@ -281,7 +281,7 @@ interface ProductFeedItem { Id: string Title: string Description: string - ['Feed Source']: 'Youtube' | 'Github' | 'All' + ['Feed Source']: 'Youtube' | 'Github' | 'All' | 'Cloud' Url: string Tags?: string ['Published Time']: string diff --git a/packages/nocodb/src/schema/swagger.json b/packages/nocodb/src/schema/swagger.json index 9d4c20e376..4b68b1d215 100644 --- a/packages/nocodb/src/schema/swagger.json +++ b/packages/nocodb/src/schema/swagger.json @@ -16046,7 +16046,8 @@ "enum": [ "all", "github", - "youtube" + "youtube", + "cloud" ] }, "name": "type",