Browse Source

fix: loading state for link

pull/6423/head
DarkPhoenix2704 1 year ago
parent
commit
003bbcff0e
  1. 2
      packages/nc-gui/components/virtual-cell/components/ListItem.vue
  2. 5
      packages/nc-gui/composables/useLTARStore.ts

2
packages/nc-gui/components/virtual-cell/components/ListItem.vue

@ -72,7 +72,7 @@ const attachments: Attachment[] = computed(() => {
<div class="flex flex-col m-[.75rem] gap-1 flex-grow justify-center"> <div class="flex flex-col m-[.75rem] gap-1 flex-grow justify-center">
<div class="flex justify-between"> <div class="flex justify-between">
<span class="font-semibold text-gray-800 nc-display-value"> {{ row[relatedTableDisplayValueProp] }} </span> <span class="font-semibold text-gray-800 nc-display-value"> {{ row[relatedTableDisplayValueProp] }} </span>
<div v-if="isLinked" class="text-brand-500 text-0.875"> <div v-if="isLinked && !isLoading" class="text-brand-500 text-0.875">
<LinkIcon <LinkIcon
:class="{ :class="{
'!group-hover:mr-8': fields.length === 0, '!group-hover:mr-8': fields.length === 0,

5
packages/nc-gui/composables/useLTARStore.ts

@ -218,6 +218,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
} catch (e: any) { } catch (e: any) {
message.error(`${t('msg.error.failedToLoadList')}: ${await extractSdkResponseErrorMsg(e)}`) message.error(`${t('msg.error.failedToLoadList')}: ${await extractSdkResponseErrorMsg(e)}`)
} finally { } finally {
// To Keep the Loading State for Minimum 600ms
setTimeout(() => { setTimeout(() => {
isChildrenExcludedLoading.value = false isChildrenExcludedLoading.value = false
}, 600) }, 600)
@ -273,6 +274,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
} catch (e: any) { } catch (e: any) {
message.error(`${t('msg.error.failedToLoadChildrenList')}: ${await extractSdkResponseErrorMsg(e)}`) message.error(`${t('msg.error.failedToLoadChildrenList')}: ${await extractSdkResponseErrorMsg(e)}`)
} finally { } finally {
// To Keep the Loading State for Minimum 600ms
setTimeout(() => { setTimeout(() => {
isChildrenLoading.value = false isChildrenLoading.value = false
}, 600) }, 600)
@ -371,6 +373,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
} catch (e: any) { } catch (e: any) {
message.error(`${t('msg.error.unlinkFailed')}: ${await extractSdkResponseErrorMsg(e)}`) message.error(`${t('msg.error.unlinkFailed')}: ${await extractSdkResponseErrorMsg(e)}`)
} finally { } finally {
// To Keep the Loading State for Minimum 600ms
setTimeout(() => { setTimeout(() => {
isChildrenExcludedListLoading.value[index] = false isChildrenExcludedListLoading.value[index] = false
isChildrenListLoading.value[index] = false isChildrenListLoading.value[index] = false
@ -438,6 +441,8 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
} catch (e: any) { } catch (e: any) {
message.error(`Linking failed: ${await extractSdkResponseErrorMsg(e)}`) message.error(`Linking failed: ${await extractSdkResponseErrorMsg(e)}`)
} finally { } finally {
// To Keep the Loading State for Minimum 600ms
setTimeout(() => { setTimeout(() => {
isChildrenExcludedListLoading.value[index] = false isChildrenExcludedListLoading.value[index] = false
isChildrenListLoading.value[index] = false isChildrenListLoading.value[index] = false

Loading…
Cancel
Save