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,
Youtube: iconMap.youtube,
Github: iconMap.githubSolid,
Cloud: iconMap.ncCloud,
}
const truncate = ref(true)
@ -32,7 +33,7 @@ const expand = () => {
truncate.value = false
$e('c:nocodb:feed:recents:expand', {
title: Title,
type: 'github',
type: source,
})
}
@ -61,14 +62,20 @@ const renderedText = computedAsync(async () => {
})
const { width } = useWindowSize()
const handleOpenUrl = (url: string) => {
if (source === 'Cloud') return
openLink(url)
}
</script>
<template>
<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 gap-3">
<component :is="feedIcon[source as any]" class="w-4 h-4 stroke-transparent" />
<span class="font-weight-medium text-nc-content-gray leading-5 cursor-pointer" @click="openLink(Url)">
<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="handleOpenUrl">
{{ source }}
</span>
</div>
@ -76,7 +83,7 @@ const { width } = useWindowSize()
{{ timeAgo(CreatedAt) }}
</div>
</div>
<template v-if="source === 'Github'">
<template v-if="['Github', 'Cloud'].includes(source)">
<div class="pb-5">
<LazyCellAttachmentPreviewImage
v-if="Images?.length"

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

@ -37,7 +37,9 @@ onMounted(() => {
<GeneralLoader size="xlarge" />
</div>
<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>
</template>

2
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' | 'Cloud' | 'Twitter'
Url: string
Tags?: string
['Published Time']: string

Loading…
Cancel
Save