Skip to content

Commit

Permalink
Fix displaying of sources
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspergrom committed Sep 20, 2024
1 parent 35015d8 commit 9e0aac0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
6 changes: 2 additions & 4 deletions frontend/src/integrations/integrations-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,8 @@ class IntegrationsConfig {
return platforms
.filter((platform) => !['integration_or_enrichment', 'email', 'integration', 'unknown', 'delete'].includes(platform))
.map((platform) => {
if (platform === 'lfid') {
return 'LFID';
}
if (['enrichment', 'peopledatalabs'].includes(platform)) {
return '<span class="ri-sparkling-line mr-0.5" />Enrichment';
return '<span class="ri-sparkling-line mr-0.5"></span> Enrichment';
}
if (platform === 'custom') {
return 'Manually added';
Expand All @@ -124,6 +121,7 @@ class IntegrationsConfig {
return {
cvent,
lfx,
lfid: lfx,
tnc,
training_cert: tnc,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,20 @@
>
{{ props.identity.value }}
</a>
<p v-if="!platform(props.identity.platform) && !props.identity.platforms" class="text-medium text-gray-400 ml-1">
{{ props.identity.platform }}
<p
v-if="!platform(props.identity.platform) && !props.identity.platforms
&& CrowdIntegrations.getPlatformsLabel([props.identity.platform]).length > 0"
class="text-medium text-gray-400 ml-1"
>
<span v-html="$sanitize(CrowdIntegrations.getPlatformsLabel([props.identity.platform]))" />
</p>
</div>
<lf-verified-identity-badge v-if="props.identity.verified" />
</div>
<p v-if="props.identity.platforms && CrowdIntegrations.getPlatformsLabel(props.identity.platforms)" class="text-tiny text-gray-400 pt-1.5">
<p
v-if="props.identity.platforms && CrowdIntegrations.getPlatformsLabel(props.identity.platforms).length > 0"
class="text-tiny text-gray-400 pt-1.5"
>
Source: <span v-html="$sanitize(CrowdIntegrations.getPlatformsLabel(props.identity.platforms))" />
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</lf-dropdown>
</div>

<div class="pl-7">
<div v-if="platformLabel(props.domain.platforms).length" class="pl-7">
<p class="text-tiny text-gray-400">
Source: <span v-html="$sanitize(platformLabel(props.domain.platforms))" />
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</lf-tooltip>
</div>

<p v-if="platformLabel(props.email.platforms)" class="mt-1.5 text-tiny text-gray-400">
<p v-if="platformLabel(props.email.platforms).length > 0" class="mt-1.5 text-tiny text-gray-400">
Source: <span v-html="$sanitize(platformLabel(props.email.platforms))" />
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="flex items-center">
<div class=" flex items-center">
<p v-if="!props.identity.url" class="text-medium max-w-48 truncate">
{{ props.identity.handle ?? props.identity.value }}
{{ props.identity.handle || props.identity.value }}
</p>
<a
v-else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const source = computed(() => {
}
const defaultValue: string | undefined = props.values.default;
let sources = Object.keys(props.values)
.filter((key) => !['default', 'custom'].includes(key) && props.values[key].some((value: any) => isEqual(value, defaultValue)));
.filter((key) => !['default'].includes(key) && props.values[key].some((value: any) => isEqual(value, defaultValue)));
if (!props.values.default) {
sources = Object.keys(props.values);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/shared/helpers/attribute.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { isEqual } from 'lodash';

export const getAttributeSources = (attribute: Record<string, string>): string[] => {
const defaultValue: string | undefined = attribute.default;
return Object.keys(attribute).filter((key) => !['default', 'custom'].includes(key) && isEqual(attribute[key], defaultValue));
return Object.keys(attribute).filter((key) => !['default'].includes(key) && isEqual(attribute[key], defaultValue));
};

export const getAttributeSourceName = (attribute: Record<string, string>): string | null => {
Expand Down

0 comments on commit 9e0aac0

Please sign in to comment.