feat(companies): add company detail page (#14054)
This commit is contained in:
@@ -30,6 +30,11 @@ export const getters = {
|
||||
.filter(record => record.attribute_model === 'contact_attribute')
|
||||
.map(camelcaseKeys);
|
||||
},
|
||||
getCompanyAttributes: _state => {
|
||||
return _state.records
|
||||
.filter(record => record.attribute_model === 'company_attribute')
|
||||
.map(camelcaseKeys);
|
||||
},
|
||||
getAttributesByModel: _state => attributeModel => {
|
||||
return _state.records.filter(
|
||||
record => record.attribute_model === attributeModel
|
||||
|
||||
@@ -35,6 +35,36 @@ describe('#getters', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('getCompanyAttributes', () => {
|
||||
const state = {
|
||||
records: [
|
||||
{
|
||||
attribute_display_name: 'Industry',
|
||||
attribute_display_type: 0,
|
||||
attribute_description: 'Company industry',
|
||||
attribute_key: 'industry',
|
||||
attribute_model: 'company_attribute',
|
||||
},
|
||||
{
|
||||
attribute_display_name: 'Language',
|
||||
attribute_display_type: 1,
|
||||
attribute_description: 'Conversation language',
|
||||
attribute_key: 'language',
|
||||
attribute_model: 'conversation_attribute',
|
||||
},
|
||||
],
|
||||
};
|
||||
expect(getters.getCompanyAttributes(state)).toEqual([
|
||||
{
|
||||
attributeDisplayName: 'Industry',
|
||||
attributeDisplayType: 0,
|
||||
attributeDescription: 'Company industry',
|
||||
attributeKey: 'industry',
|
||||
attributeModel: 'company_attribute',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('getUIFlags', () => {
|
||||
const state = {
|
||||
uiFlags: {
|
||||
|
||||
Reference in New Issue
Block a user