mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-19 16:52:29 +00:00
572279916e
Summary: - Adding new icon for calendar view (the old one by just bigger) - When there are no columns to map the select box is grayed out - Optional mappings can be cleared now Test Plan: Added Reviewers: JakubSerafin Reviewed By: JakubSerafin Subscribers: JakubSerafin Differential Revision: https://phab.getgrist.com/D4066
24 lines
927 B
TypeScript
24 lines
927 B
TypeScript
// the list of widget types with their labels and icons
|
|
import {IWidgetType} from "app/common/widgetTypes";
|
|
import {IconName} from "app/client/ui2018/IconList";
|
|
|
|
export const widgetTypesMap = new Map<IWidgetType, IWidgetTypeInfo>([
|
|
['record', {label: 'Table', icon: 'TypeTable'}],
|
|
['single', {label: 'Card', icon: 'TypeCard'}],
|
|
['detail', {label: 'Card List', icon: 'TypeCardList'}],
|
|
['chart', {label: 'Chart', icon: 'TypeChart'}],
|
|
['custom', {label: 'Custom', icon: 'TypeCustom'}],
|
|
['custom.calendar', {label: 'Calendar', icon: 'TypeCalendar'}],
|
|
]);
|
|
|
|
// Widget type info.
|
|
export interface IWidgetTypeInfo {
|
|
label: string;
|
|
icon: IconName;
|
|
}
|
|
|
|
// Returns the widget type info for sectionType, or the one for 'record' if sectionType is null.
|
|
export function getWidgetTypes(sectionType: IWidgetType | null): IWidgetTypeInfo {
|
|
return widgetTypesMap.get(sectionType || 'record') || widgetTypesMap.get('record')!;
|
|
}
|