Skip to content

Commit

Permalink
AB#1064 Fix links to event series in rich-text and custom fields
Browse files Browse the repository at this point in the history
Fixes commit c00e5fd
  • Loading branch information
gjvoosten committed Jan 15, 2025
1 parent b88de0d commit e471b74
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Icon } from "@blueprintjs/core"
import { IconNames } from "@blueprintjs/icons"
import { SEARCH_OBJECT_LABELS, SEARCH_OBJECT_TYPES } from "actions"
import AdvancedMultiSelect from "components/advancedSelectWidget/AdvancedMultiSelect"
import {
AttachmentOverlayRow,
Expand All @@ -19,6 +18,7 @@ import AppContext from "components/AppContext"
import ButtonToggleGroup from "components/ButtonToggleGroup"
import Model from "components/Model"
import * as Models from "models"
import pluralize from "pluralize"
import React, { useCallback, useContext, useMemo, useState } from "react"
import { Button } from "react-bootstrap"
import AUTHORIZATION_GROUPS_ICON from "resources/authorizationGroups.png"
Expand All @@ -30,6 +30,7 @@ import PEOPLE_ICON from "resources/people.png"
import POSITIONS_ICON from "resources/positions.png"
import REPORTS_ICON from "resources/reports.png"
import TASKS_ICON from "resources/tasks.png"
import Settings from "settings"

const entityFilters = {
allEntities: {
Expand Down Expand Up @@ -194,6 +195,19 @@ export const ENTITY_TYPES = {
EVENT_SERIES: Models.EventSeries.resourceName
}

const ENTITY_LABELS = {
[ENTITY_TYPES.REPORTS]: "Reports",
[ENTITY_TYPES.PEOPLE]: "People",
[ENTITY_TYPES.ORGANIZATIONS]: "Organizations",
[ENTITY_TYPES.POSITIONS]: "Positions",
[ENTITY_TYPES.LOCATIONS]: "Locations",
[ENTITY_TYPES.TASKS]: pluralize(Settings.fields.task.shortLabel),
[ENTITY_TYPES.AUTHORIZATION_GROUPS]: "Authorization Groups",
[ENTITY_TYPES.ATTACHMENTS]: "Attachments",
[ENTITY_TYPES.EVENTS]: "Events",
[ENTITY_TYPES.EVENT_SERIES]: "Event Series"
}

const widgetTypeMapping = {
[ENTITY_TYPES.REPORTS]: widgetPropsReport,
[ENTITY_TYPES.PEOPLE]: widgetPropsPeople,
Expand Down Expand Up @@ -252,7 +266,7 @@ const MultiTypeAdvancedSelectComponent = ({
const [key] = Object.entries(ENTITY_TYPES).find(
([, et]) => et === entityType
)
const entityLabel = SEARCH_OBJECT_LABELS[SEARCH_OBJECT_TYPES[key]]
const entityLabel = ENTITY_LABELS[ENTITY_TYPES[key]]
return "Find " + entityLabel.toLowerCase()
}, [entityType])
const SelectComponent = isMultiSelect
Expand All @@ -276,7 +290,7 @@ const MultiTypeAdvancedSelectComponent = ({
{Object.entries(ENTITY_TYPES)
.filter(([, et]) => entityTypes.includes(et))
.map(([key, entityName]) => {
const entityLabel = SEARCH_OBJECT_LABELS[SEARCH_OBJECT_TYPES[key]]
const entityLabel = ENTITY_LABELS[ENTITY_TYPES[key]]
return (
<Button
key={entityName}
Expand Down

0 comments on commit e471b74

Please sign in to comment.