Skip to content

Commit

Permalink
Added missing properties for event manager select mode (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
mroloux authored Apr 4, 2024
1 parent f592f1f commit f7eacb7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
22 changes: 15 additions & 7 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChartDesignerConfigOptions, ChartRendererConfigOptions, EventManagerConfigOptions, EventManagerFilterSectionsModeConfigOptions, EventManagerManageCategoriesModeConfigOptions, EventManagerManageChannelsModeConfigOptions, EventManagerManageObjectStatusesModeConfigOptions, EventManagerSelectModeConfigOptions, EventManagerStaticModeConfigOptions } from './index'

// Set up a fully popuplated Chart Renderer config
// Set up a complete Chart Renderer config
const fullChartRendererConfig: Required<ChartRendererConfigOptions> = {
activeFloor: '1',
container: document.body,
Expand Down Expand Up @@ -161,7 +161,7 @@ const fullChartRendererConfig: Required<ChartRendererConfigOptions> = {
tooltipStyle: 'someStyle'
}

// Set up a fully popuplated Event Manager config
// Set up a complete Event Manager config
const fullEventManagerConfig: Required<EventManagerConfigOptions> = {
divId: 'chartContainer',
container: document.body,
Expand All @@ -188,8 +188,8 @@ const fullEventManagerConfig: Required<EventManagerConfigOptions> = {
},
mode: 'manageObjectStatuses',
objectTooltip: {
showOrderId: false,
showTechnicalLabel: true
showOrderId: true,
showTechnicalLabel: false
},
secretKey: 'mySecretKey',
viewSettingsDefaults: {
Expand Down Expand Up @@ -271,11 +271,19 @@ const eventManagerSelectModeConfig: Required<EventManagerSelectModeConfigOptions
tooltipContents: (object: object) => '',
unavailableObjectsSelectable: false,
selectableObjects: ['A'],
events: ['eventA', 'eventB']
events: ['eventA', 'eventB'],
objectIcon: (_object, _defaultIcon, _extraConfig) => 'circle',
objectTooltip: {
showOrderId: true,
showTechnicalLabel: true,
showLabel: true,
showCategory: true,
showChannel: true,
showActionHint: true
}
}


// Set up a fully popuplated Chart Designer config
// Set up a complete Chart Designer config
const chartDesignerConfig: Required<ChartDesignerConfigOptions> = {
secretKey: 'mySecretKey',
divId: 'chartContainer',
Expand Down
18 changes: 17 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ export interface EventManagerFilterSectionsModeConfigOptions extends BaseEventMa
onFilteredSectionChange: (sectionLabels: string[]) => {}
}


export interface EventManagerSelectModeConfigOptions extends BaseEventManagerConfigOptions, WithEvents {
mode: 'select'
maxSelectedObjects?: SelectionLimiter
Expand All @@ -391,6 +390,22 @@ export interface EventManagerSelectModeConfigOptions extends BaseEventManagerCon
tooltipContents?: (object: object) => string
unavailableObjectsSelectable?: boolean
selectableObjects?: string[]
/**
* @param object
* @param defaultIcon
* @param extraConfig
* @returns A string with the name of a FontAwesome v4.7.0 icon. {@link https://fontawesome.com/v4.7.0/icons/ See the full list of available icons}.
* For more details, {@link https://docs.seats.io/docs/event-manager/modes/select#objecticon see the documentation}.
*/
objectIcon?: (object: SelectableObjectProps, defaultIcon: string | null, extraConfig?: ExtraConfig) => string
objectTooltip?: {
showOrderId?: boolean
showTechnicalLabel?: boolean
showLabel?: boolean
showCategory?: boolean
showChannel?: boolean
showActionHint?: boolean
}
}

export interface EventManagerStaticModeConfigOptions extends BaseEventManagerConfigOptions, WithEvents {
Expand Down Expand Up @@ -1254,6 +1269,7 @@ export interface EventManager extends Pick<SeatingChart,
| 'findObject'
| 'listCategories'
| 'listSelectedObjects'
| 'selectedObjects'
| 'render'
| 'rerender'
| 'resetView'
Expand Down

0 comments on commit f7eacb7

Please sign in to comment.