-
Notifications
You must be signed in to change notification settings - Fork 749
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force typescript for org enrich config (#1467)
- Loading branch information
1 parent
1ce4db6
commit fe5b3f0
Showing
27 changed files
with
187 additions
and
95 deletions.
There are no files selected for viewing
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/affiliatedProfiles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/allSubsidiaries.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/alternativeDomains.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/alternativeNames.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/averageEmployeeTenure.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
11 changes: 7 additions & 4 deletions
11
frontend/src/modules/organization/config/enrichment/averageTenureByLevel.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/averageTenureByRole.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/directSubsidiaries.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/employeeChurnRate.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/employeeCount.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/employeeCountByCountry.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
11 changes: 7 additions & 4 deletions
11
frontend/src/modules/organization/config/enrichment/employeeCountByMonth.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/employeeGrowthRate.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/founded.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/gicsSector.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
11 changes: 7 additions & 4 deletions
11
frontend/src/modules/organization/config/enrichment/grossAdditionsByMonth.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
11 changes: 7 additions & 4 deletions
11
frontend/src/modules/organization/config/enrichment/grossDeparturesByMonth.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/headcount.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
9 changes: 6 additions & 3 deletions
9
frontend/src/modules/organization/config/enrichment/immediateParent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.