Skip to content

Commit

Permalink
Force typescript for org enrich config (#1467)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspergrom authored Sep 12, 2023
1 parent 1ce4db6 commit fe5b3f0
Show file tree
Hide file tree
Showing 27 changed files with 187 additions and 95 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesArrayRenderer from '@/modules/organization/components/organization-attributes-array-renderer.vue';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const affiliatedProfiles: OrganizationEnrichmentConfig = {
name: 'affiliatedProfiles',
label: 'Affilliated Profiles',
type: attributesTypes.array,
type: AttributeType.ARRAY,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesArrayRenderer,
};

export default affiliatedProfiles;
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesArrayRenderer from '@/modules/organization/components/organization-attributes-array-renderer.vue';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const allSubsidiaries: OrganizationEnrichmentConfig = {
name: 'allSubsidiaries',
label: 'All subsidiaries',
type: attributesTypes.array,
type: AttributeType.ARRAY,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesArrayRenderer,
};

export default allSubsidiaries;
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesArrayRenderer from '@/modules/organization/components/organization-attributes-array-renderer.vue';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const alternativeDomains: OrganizationEnrichmentConfig = {
name: 'alternativeDomains',
label: 'Alternative Domains',
type: attributesTypes.array,
type: AttributeType.ARRAY,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesArrayRenderer,
isLink: true,
};

export default alternativeDomains;
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesArrayRenderer from '@/modules/organization/components/organization-attributes-array-renderer.vue';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const alternativeNames: OrganizationEnrichmentConfig = {
name: 'alternativeNames',
label: 'Alternative Names',
type: attributesTypes.array,
type: AttributeType.ARRAY,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesArrayRenderer,
};

export default alternativeNames;
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import { formatFloatToYears } from '@/utils/number';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const averageEmployeeTenure: OrganizationEnrichmentConfig = {
name: 'averageEmployeeTenure',
label: 'Average Employee Tenure',
type: attributesTypes.number,
type: AttributeType.NUMBER,
showInForm: true,
showInAttributes: true,
displayValue: (value) => formatFloatToYears(value),
};

export default averageEmployeeTenure;
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesJSONRenderer from '@/modules/organization/components/organization-attributes-json-renderer.vue';
import { formatFloatToYears } from '@/utils/number';
import { snakeToSentenceCase } from '@/utils/string';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

const AverageTenureByLevel = {
const AverageTenureByLevel: Record<string, string> = {
vp: 'VP',
cxo: 'CXO',
};

export default {
const averageTenureByLevel: OrganizationEnrichmentConfig = {
name: 'averageTenureByLevel',
label: 'Average Tenure by Level',
type: attributesTypes.json,
type: AttributeType.JSON,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesJSONRenderer,
keyParser: (key) => AverageTenureByLevel[key] || snakeToSentenceCase(key),
valueParser: (value) => formatFloatToYears(value),
};

export default averageTenureByLevel;
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesJSONRenderer from '@/modules/organization/components/organization-attributes-json-renderer.vue';
import { formatFloatToYears } from '@/utils/number';
import { snakeToSentenceCase } from '@/utils/string';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const averageTenureByRole: OrganizationEnrichmentConfig = {
name: 'averageTenureByRole',
label: 'Average Tenure by Role',
type: attributesTypes.json,
type: AttributeType.JSON,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesJSONRenderer,
keyParser: (key) => snakeToSentenceCase(key),
valueParser: (value) => formatFloatToYears(value),
};

export default averageTenureByRole;
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesArrayRenderer from '@/modules/organization/components/organization-attributes-array-renderer.vue';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const directSubsidiaries: OrganizationEnrichmentConfig = {
name: 'directSubsidiaries',
label: 'Direct Subsidiaries',
type: attributesTypes.array,
type: AttributeType.ARRAY,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesArrayRenderer,
};

export default directSubsidiaries;
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesJSONRenderer from '@/modules/organization/components/organization-attributes-json-renderer.vue';
import { formatFloatToPercentage } from '@/utils/number';
import { snakeToSentenceCase } from '@/utils/string';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const employeeChurnRate: OrganizationEnrichmentConfig = {
name: 'employeeChurnRate',
label: 'Employee Churn Rate',
type: attributesTypes.json,
type: AttributeType.JSON,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesJSONRenderer,
valueParser: formatFloatToPercentage,
keyParser: (key) => `${snakeToSentenceCase(key)}s`,
filterValue: (value) => ({ '12_month': value['12_month'] }),
};

export default employeeChurnRate;
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const employeeCount: OrganizationEnrichmentConfig = {
name: 'employeeCount',
label: 'Employee Count',
type: attributesTypes.number,
type: AttributeType.NUMBER,
showInForm: true,
showInAttributes: true,
displayValue: (value) => value,
};

export default employeeCount;
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesJSONRenderer from '@/modules/organization/components/organization-attributes-json-renderer.vue';
import { toSentenceCase } from '@/utils/string';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const employeeCountByCountry: OrganizationEnrichmentConfig = {
name: 'employeeCountByCountry',
label: 'Employee Count by Country',
type: attributesTypes.json,
type: AttributeType.JSON,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesJSONRenderer,
keyParser: (key) => toSentenceCase(key),
};

export default employeeCountByCountry;
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesJSONRenderer from '@/modules/organization/components/organization-attributes-json-renderer.vue';
import { formatDate } from '@/utils/date';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const employeeCountByMonth: OrganizationEnrichmentConfig = {
name: 'employeeCountByMonth',
label: 'Employee Count by Month',
type: attributesTypes.json,
type: AttributeType.JSON,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesJSONRenderer,
keyParser: (key) => formatDate({
timestamp: key,
format: 'MMMM YYYY',
}),
} as any),
};

export default employeeCountByMonth;
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesJSONRenderer from '@/modules/organization/components/organization-attributes-json-renderer.vue';
import { formatFloatToPercentage } from '@/utils/number';
import { snakeToSentenceCase } from '@/utils/string';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const employeeGrowthRate: OrganizationEnrichmentConfig = {
name: 'employeeGrowthRate',
label: 'Employee Growth Rate',
type: attributesTypes.json,
type: AttributeType.JSON,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesJSONRenderer,
valueParser: formatFloatToPercentage,
keyParser: (key) => `${snakeToSentenceCase(key)}s`,
filterValue: (value) => ({ '12_month': value['12_month'] }),
};

export default employeeGrowthRate;
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const founded: OrganizationEnrichmentConfig = {
name: 'founded',
label: 'Founded',
type: attributesTypes.number,
type: AttributeType.NUMBER,
showInForm: true,
showInAttributes: true,
displayValue: (value) => value,
};

export default founded;
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import { toSentenceCase } from '@/utils/string';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const gicsSector: OrganizationEnrichmentConfig = {
name: 'gicsSector',
label: 'GICS Sector',
type: attributesTypes.string,
type: AttributeType.STRING,
showInForm: true,
showInAttributes: true,
displayValue: (value) => toSentenceCase(value),
};

export default gicsSector;
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesJSONRenderer from '@/modules/organization/components/organization-attributes-json-renderer.vue';
import { formatDate } from '@/utils/date';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const grossAdditionsByMonth: OrganizationEnrichmentConfig = {
name: 'grossAdditionsByMonth',
label: 'Gross Additions by Month',
type: attributesTypes.json,
type: AttributeType.JSON,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesJSONRenderer,
keyParser: (key) => formatDate({
timestamp: key,
format: 'MMMM YYYY',
}),
} as any),
};

export default grossAdditionsByMonth;
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import OrganizationAttributesJSONRenderer from '@/modules/organization/components/organization-attributes-json-renderer.vue';
import { formatDate } from '@/utils/date';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const grossDeparturesByMonth: OrganizationEnrichmentConfig = {
name: 'grossDeparturesByMonth',
label: 'Gross Departures by Month',
type: attributesTypes.json,
type: AttributeType.JSON,
showInForm: true,
showInAttributes: true,
component: OrganizationAttributesJSONRenderer,
keyParser: (key) => formatDate({
timestamp: key,
format: 'MMMM YYYY',
}),
} as any),
};

export default grossDeparturesByMonth;
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import { toSentenceCase } from '@/utils/string';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const size: OrganizationEnrichmentConfig = {
name: 'size',
label: 'Headcount',
type: attributesTypes.string,
type: AttributeType.STRING,
showInForm: true,
showInAttributes: false,
displayValue: (value) => toSentenceCase(value),
};

export default size;
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { attributesTypes } from '@/modules/organization/types/Attributes';
import { AttributeType } from '@/modules/organization/types/Attributes';
import { OrganizationEnrichmentConfig } from '@/modules/organization/config/enrichment/index';

export default {
const immediateParent: OrganizationEnrichmentConfig = {
name: 'immediateParent',
label: 'Immediate Parent',
type: attributesTypes.string,
type: AttributeType.STRING,
showInForm: true,
showInAttributes: true,
displayValue: (value) => value,
};

export default immediateParent;
Loading

0 comments on commit fe5b3f0

Please sign in to comment.