The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import { ViewType, ViewKey } from 'twenty-shared/types';
import { INDEX_VIEW_NAME } from 'src/engine/metadata-modules/view/constants/index-view-name.constant';
import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type';
import {
createStandardViewFlatMetadata,
type CreateStandardViewArgs,
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util';
export const computeStandardMessageViews = (
args: Omit<CreateStandardViewArgs<'message'>, 'context'>,
): Record<string, FlatView> => {
return {
allMessages: createStandardViewFlatMetadata({
...args,
objectName: 'message',
context: {
viewName: 'allMessages',
name: INDEX_VIEW_NAME,
type: ViewType.TABLE,
key: ViewKey.INDEX,
position: 0,
icon: 'IconTable',
},
}),
messageRecordPageFields: createStandardViewFlatMetadata({
...args,
objectName: 'message',
context: {
viewName: 'messageRecordPageFields',
name: 'Message Record Page Fields',
type: ViewType.FIELDS_WIDGET,
key: null,
position: 0,
icon: 'IconListDetails',
},
}),
};
};