Browse Source

fix(gui): show virtual columns

re #557

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/559/head
Pranav C 3 years ago
parent
commit
0dff25dfc5
  1. 19
      packages/nc-gui/components/project/spreadsheet/mixins/spreadsheet.js
  2. 30
      packages/nc-gui/components/share-icons.vue

19
packages/nc-gui/components/project/spreadsheet/mixins/spreadsheet.js

@ -124,6 +124,25 @@ export default {
columns = (this.meta && this.meta.columns && this.meta.columns.filter(c => !(c.pk && c.ai) && !hideCols.includes(c.cn))) || []
}
if (this.meta && this.meta.v) {
columns = [...columns, ...this.meta.v.map(v => ({ ...v, virtual: 1 }))]
}
{
const _ref = {}
columns.forEach((c) => {
if (c.virtual && c.lk) {
c.alias = `${c.lk._lcn} (from ${c.lk._ltn})`
} else {
c.alias = c._cn
}
if (c.alias in _ref) {
c.alias += _ref[c.alias]++
} else {
_ref[c.alias] = 1
}
})
}
if (this.fieldsOrder.length) {
return [...columns].sort((c1, c2) => {
const i1 = this.fieldsOrder.indexOf(c1.alias)

30
packages/nc-gui/components/share-icons.vue

@ -9,7 +9,7 @@
@click.prevent="openUrl(`https://twitter.com/intent/tweet?url=${shareUrl}&text=${encodedSummary}&hashtags=${hashTags}`)"
>
<img
src="/social/twitter.png"
src="social/twitter.png"
class="img-responsive"
alt="Twitter"
:width="width"
@ -27,7 +27,7 @@
@click.prevent="openUrl(`https://www.linkedin.com/shareArticle?mini=true&url=${shareUrl}&title=${encodedTitle}&summary=${encodedSummary}`)"
>
<img
src="/social/linkedin.png"
src="social/linkedin.png"
class="img-responsive"
alt="Linkedin"
:width="width"
@ -45,7 +45,7 @@
@click.prevent="openUrl(`https://www.facebook.com/sharer/sharer.php?u=${shareUrl}&title=${encodedTitle}&summary=${encodedSummary}&quote=${encodedTitle}&hashtag=${fbHashTags}`)"
>
<img
src="/social/facebook.png"
src="social/facebook.png"
class="img-responsive"
alt="Facebook"
:width="width"
@ -63,7 +63,7 @@
@click.prevent="openUrl(`https://www.reddit.com/submit?url=${shareUrl}&title=${encodedSummary}`)"
>
<img
src="/social/reddit.png"
src="social/reddit.png"
class="img-responsive"
alt="Reddit"
:width="width"
@ -81,7 +81,7 @@
@click.prevent="openUrl(`https://pinterest.com/pin/create/button/?url=${shareUrl}&description==${encodedSummary}`)"
>
<img
src="/social/pinterest.png"
src="social/pinterest.png"
class="img-responsive"
alt="Printrest"
:width="width"
@ -99,7 +99,7 @@
@click.prevent="openUrl(`https://api.whatsapp.com/send?text=${encodedSummary}%0D%0A${shareUrl}`)"
>
<img
src="/social/whatsapp.png"
src="social/whatsapp.png"
class="img-responsive"
alt="Whatsapp"
:width="width"
@ -116,7 +116,7 @@
@click.prevent="openUrl(`https://telegram.me/share/url?url=${shareUrl}&text=${encodedSummary}`)"
>
<img
src="/social/png/telegram.png"
src="social/png/telegram.png"
class="img-responsive"
alt="Telegram"
:width="width"
@ -132,7 +132,7 @@
@click.prevent="openUrl(`https://www.addtoany.com/add_to/wechat?linkurl=${shareUrl}&linkname=${encodedTitle}`)"
>
<img
src="/social/png/wechat.png"
src="social/png/wechat.png"
class="img-responsive"
alt="Wechat"
:width="width"
@ -148,7 +148,7 @@
class="px-2"
>
<img
src="/social/png/line.png"
src="social/png/line.png"
class="img-responsive"
alt="Line"
:width="width"
@ -165,7 +165,7 @@
class="px-2"
>
<img
src="/social/png/odnoklassniki.png"
src="social/png/odnoklassniki.png"
class="img-responsive"
alt="Odnoklassniki"
:width="width"
@ -183,7 +183,7 @@
@click.prevent="openUrl(`http://service.weibo.com/share/share.php?url=${shareUrl})&title=${encodedTitle}`)"
>
<img
src="/social/png/weibo.png"
src="social/png/weibo.png"
class="img-responsive"
alt="Weibo"
:width="width"
@ -199,7 +199,7 @@
@click.prevent="openUrl(`http://widget.renren.com/dialog/share?resourceUrl=${shareUrl}&srcUrl=${shareUrl}&title=${encodedTitle}&description=${encodedSummary}`)"
>
<img
src="/social/png/renren.png"
src="social/png/renren.png"
class="img-responsive"
alt="Renren"
:width="width"
@ -215,7 +215,7 @@
@click.prevent="openUrl(`http://www.douban.com/recommend/?url=${shareUrl}&title=${encodedTitle}`)"
>
<img
src="/social/png/douban.png"
src="social/png/douban.png"
class="img-responsive"
alt="Douban"
:width="width"
@ -232,7 +232,7 @@
@click.prevent="openUrl(`https://vk.com/share.php?url=${shareUrl})&title=${encodedTitle}&description=${encodedSummary}&noparse=true`)"
>
<img
src="/social/png/vk.png"
src="social/png/vk.png"
class="img-responsive"
alt="VK"
:width="width"
@ -248,7 +248,7 @@
@click.prevent="openUrl(`https://www.addtoany.com/add_to/wykop?linkurl=${shareUrl}&linkname=${encodedTitle}`)"
>
<img
src="/social/png/wykop.jpg"
src="social/png/wykop.jpg"
class="img-responsive"
alt="Wykop"
:width="width"

Loading…
Cancel
Save