Browse Source

Nc include cloud release (#9647)

* fix: include cloud release in recents

* fix: handle url clicks
pull/9491/merge
Anbarasu 1 month ago committed by GitHub
parent
commit
5632936f83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 15
      packages/nc-gui/components/feed/Recents/Card.vue
  2. 4
      packages/nc-gui/components/feed/Recents/index.vue
  3. 2
      packages/nc-gui/lib/types.ts

15
packages/nc-gui/components/feed/Recents/Card.vue

@ -22,6 +22,7 @@ const feedIcon = {
Twitter: iconMap.twitter, Twitter: iconMap.twitter,
Youtube: iconMap.youtube, Youtube: iconMap.youtube,
Github: iconMap.githubSolid, Github: iconMap.githubSolid,
Cloud: iconMap.ncCloud,
} }
const truncate = ref(true) const truncate = ref(true)
@ -32,7 +33,7 @@ const expand = () => {
truncate.value = false truncate.value = false
$e('c:nocodb:feed:recents:expand', { $e('c:nocodb:feed:recents:expand', {
title: Title, title: Title,
type: 'github', type: source,
}) })
} }
@ -61,14 +62,20 @@ const renderedText = computedAsync(async () => {
}) })
const { width } = useWindowSize() const { width } = useWindowSize()
const handleOpenUrl = (url: string) => {
if (source === 'Cloud') return
openLink(url)
}
</script> </script>
<template> <template>
<div class="bg-white recent-card border-gray-200 border-1 rounded-2xl max-w-[540px] xl:max-w-[640px]"> <div class="bg-white recent-card border-gray-200 border-1 rounded-2xl max-w-[540px] xl:max-w-[640px]">
<div class="flex items-center justify-between px-5 py-4"> <div class="flex items-center justify-between px-5 py-4">
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<component :is="feedIcon[source as any]" class="w-4 h-4 stroke-transparent" /> <component :is="feedIcon[source]" class="w-4 h-4 stroke-transparent" />
<span class="font-weight-medium text-nc-content-gray leading-5 cursor-pointer" @click="openLink(Url)"> <span class="font-weight-medium text-nc-content-gray leading-5 cursor-pointer" @click="handleOpenUrl">
{{ source }} {{ source }}
</span> </span>
</div> </div>
@ -76,7 +83,7 @@ const { width } = useWindowSize()
{{ timeAgo(CreatedAt) }} {{ timeAgo(CreatedAt) }}
</div> </div>
</div> </div>
<template v-if="source === 'Github'"> <template v-if="['Github', 'Cloud'].includes(source)">
<div class="pb-5"> <div class="pb-5">
<LazyCellAttachmentPreviewImage <LazyCellAttachmentPreviewImage
v-if="Images?.length" v-if="Images?.length"

4
packages/nc-gui/components/feed/Recents/index.vue

@ -37,7 +37,9 @@ onMounted(() => {
<GeneralLoader size="xlarge" /> <GeneralLoader size="xlarge" />
</div> </div>
<div v-else class="flex flex-col my-6 items-center gap-6"> <div v-else class="flex flex-col my-6 items-center gap-6">
<FeedRecentsCard v-for="feed in socialFeed" :key="feed.Id" :item="feed" /> <template v-for="feed in socialFeed" :key="feed.Id">
<FeedRecentsCard v-if="['Github', 'Cloud', 'Youtube'].includes(feed['Feed Source'])" :item="feed" />
</template>
</div> </div>
</div> </div>
</template> </template>

2
packages/nc-gui/lib/types.ts

@ -281,7 +281,7 @@ interface ProductFeedItem {
Id: string Id: string
Title: string Title: string
Description: string Description: string
['Feed Source']: 'Youtube' | 'Github' | 'All' ['Feed Source']: 'Youtube' | 'Github' | 'Cloud' | 'Twitter'
Url: string Url: string
Tags?: string Tags?: string
['Published Time']: string ['Published Time']: string

Loading…
Cancel
Save