diff --git a/common/__generated__/graphql.ts b/common/__generated__/graphql.ts index 33f4f3553..18e6be654 100644 --- a/common/__generated__/graphql.ts +++ b/common/__generated__/graphql.ts @@ -442,6 +442,7 @@ export type ActionIndicator = { indicator: Indicator; }; +/** An enumeration. */ export enum ActionIndicatorEffectType { /** decreases */ Decreases = 'DECREASES', @@ -678,6 +679,7 @@ export type ActionResponsiblePartyReporteportValue = ReportValueInterface & { responsibleParty?: Maybe; }; +/** An enumeration. */ export enum ActionResponsiblePartyRole { /** Collaborator */ Collaborator = 'COLLABORATOR', @@ -759,6 +761,7 @@ export type ActionStatusSummary = { sentiment: Sentiment; }; +/** An enumeration. */ export enum ActionStatusSummaryIdentifier { Cancelled = 'CANCELLED', Completed = 'COMPLETED', @@ -827,6 +830,7 @@ export type ActionTask = { state: ActionTaskState; }; +/** An enumeration. */ export enum ActionTaskState { /** cancelled */ Cancelled = 'CANCELLED', @@ -857,6 +861,7 @@ export type ActionTimeliness = { sentiment: Sentiment; }; +/** An enumeration. */ export enum ActionTimelinessIdentifier { Acceptable = 'ACCEPTABLE', Late = 'LATE', @@ -1071,6 +1076,7 @@ export type AttributeTypeChoiceOption = { name: Scalars['String']; }; +/** An enumeration. */ export enum AttributeTypeFormat { /** Category */ CategoryChoice = 'CATEGORY_CHOICE', @@ -1140,6 +1146,7 @@ export type CartographyProviderCredentials = { publicAccessToken: Scalars['String']; }; +/** An enumeration. */ export enum CartographyProviderCredentialsProvider { /** MapBox */ Mapbox = 'MAPBOX' @@ -1484,6 +1491,7 @@ export type CategoryTypePageSiblingsArgs = { searchQuery?: InputMaybe; }; +/** An enumeration. */ export enum CategoryTypeSelectWidget { /** Multiple */ Multiple = 'MULTIPLE', @@ -1587,6 +1595,7 @@ export type CommonIndicatorNormalization = { unit?: Maybe; }; +/** An enumeration. */ export enum Comparison { Gt = 'GT', Lte = 'LTE' @@ -2138,6 +2147,7 @@ export type IndicatorLevel = { plan: Plan; }; +/** An enumeration. */ export enum IndicatorLevelLevel { /** operational */ Operational = 'OPERATIONAL', @@ -2258,6 +2268,7 @@ export type IndicatorShowcaseBlock = StreamFieldInterface & { title?: Maybe; }; +/** An enumeration. */ export enum IndicatorTimeResolution { /** day */ Day = 'DAY', @@ -2941,6 +2952,7 @@ export type PlanFeatures = { showAdminLink: Scalars['Boolean']; }; +/** An enumeration. */ export enum PlanFeaturesContactPersonsPublicData { /** Show all information */ All = 'ALL', @@ -3184,6 +3196,7 @@ export type PrivacyPolicyPageSiblingsArgs = { searchQuery?: InputMaybe; }; +/** An enumeration. */ export enum PublicationStatus { Published = 'PUBLISHED', Scheduled = 'SCHEDULED', @@ -3363,6 +3376,7 @@ export type RelatedCommonIndicator = { id: Scalars['ID']; }; +/** An enumeration. */ export enum RelatedCommonIndicatorEffectType { /** decreases */ Decreases = 'DECREASES', @@ -3384,6 +3398,7 @@ export type RelatedIndicator = { id: Scalars['ID']; }; +/** An enumeration. */ export enum RelatedIndicatorConfidenceLevel { /** high */ High = 'HIGH', @@ -3393,6 +3408,7 @@ export enum RelatedIndicatorConfidenceLevel { Medium = 'MEDIUM' } +/** An enumeration. */ export enum RelatedIndicatorEffectType { /** decreases */ Decreases = 'DECREASES', @@ -3541,6 +3557,7 @@ export type SearchResults = { hits?: Maybe>>; }; +/** An enumeration. */ export enum Sentiment { Negative = 'NEGATIVE', Neutral = 'NEUTRAL', @@ -3564,6 +3581,7 @@ export type SiteGeneralContent = { siteTitle: Scalars['String']; }; +/** An enumeration. */ export enum SiteGeneralContentActionTerm { /** Action */ Action = 'ACTION', @@ -3904,6 +3922,7 @@ export type UserFeedbackNode = { url: Scalars['String']; }; +/** An enumeration. */ export enum UserFeedbackType { /** Accessibility */ Accessibility = 'ACCESSIBILITY', @@ -4042,7 +4061,52 @@ export type GetActionDetailsQuery = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -4057,12 +4121,6 @@ export type GetActionDetailsQuery = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -4301,7 +4359,52 @@ export type GetActionDetailsQuery = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -4316,12 +4419,6 @@ export type GetActionDetailsQuery = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -4480,7 +4577,52 @@ export type GetActionDetailsQuery = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -4495,12 +4637,6 @@ export type GetActionDetailsQuery = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -4605,7 +4741,52 @@ export type GetActionDetailsQuery = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -4620,12 +4801,6 @@ export type GetActionDetailsQuery = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -4786,7 +4961,52 @@ export type GetActionDetailsQuery = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -4801,12 +5021,6 @@ export type GetActionDetailsQuery = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -4911,7 +5125,52 @@ export type GetActionDetailsQuery = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -4926,12 +5185,6 @@ export type GetActionDetailsQuery = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -5179,7 +5432,52 @@ type ActionMainContentBlocksFragment_ActionContentSectionBlock_Fragment = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -5194,12 +5492,6 @@ type ActionMainContentBlocksFragment_ActionContentSectionBlock_Fragment = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -5308,7 +5600,52 @@ type ActionMainContentBlocksFragment_ReportComparisonBlock_Fragment = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -5323,12 +5660,6 @@ type ActionMainContentBlocksFragment_ReportComparisonBlock_Fragment = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -5432,7 +5763,52 @@ export type ReportComparisonBlockActionContentFragment = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -5447,12 +5823,6 @@ export type ReportComparisonBlockActionContentFragment = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -5709,43 +6079,149 @@ export type GetActionListQuery = ( ) | null } & { __typename?: 'Image' } ) | null } - & { __typename?: 'Plan' } - ) } - & { __typename?: 'Action' } - )> | null } - & { __typename?: 'Query' } -); - -export type GetActionStatusesQueryVariables = Exact<{ - plan: Scalars['ID']; - actionCategory?: InputMaybe; -}>; - - -export type GetActionStatusesQuery = ( - { planActions?: Array<( - { id: string, identifier: string, color?: string | null, plan: ( - { id: string } - & { __typename?: 'Plan' } - ), status?: ( - { id: string, identifier: string, name: string } - & { __typename?: 'ActionStatus' } - ) | null, statusSummary: ( - { identifier: ActionStatusSummaryIdentifier } - & { __typename?: 'ActionStatusSummary' } - ), implementationPhase?: ( - { id: string, identifier: string, name: string } - & { __typename?: 'ActionImplementationPhase' } - ) | null, mergedWith?: ( - { id: string, identifier: string, plan: ( - { id: string, shortName?: string | null, viewUrl?: string | null } - & { __typename?: 'Plan' } - ) } - & { __typename?: 'Action' } + & { __typename?: 'Plan' } + ) } + & { __typename?: 'Action' } + )> | null } + & { __typename?: 'Query' } +); + +export type GetActionStatusesQueryVariables = Exact<{ + plan: Scalars['ID']; + actionCategory?: InputMaybe; +}>; + + +export type GetActionStatusesQuery = ( + { planActions?: Array<( + { id: string, identifier: string, color?: string | null, plan: ( + { id: string } + & { __typename?: 'Plan' } + ), status?: ( + { id: string, identifier: string, name: string } + & { __typename?: 'ActionStatus' } + ) | null, statusSummary: ( + { identifier: ActionStatusSummaryIdentifier } + & { __typename?: 'ActionStatusSummary' } + ), implementationPhase?: ( + { id: string, identifier: string, name: string } + & { __typename?: 'ActionImplementationPhase' } + ) | null, mergedWith?: ( + { id: string, identifier: string, plan: ( + { id: string, shortName?: string | null, viewUrl?: string | null } + & { __typename?: 'Plan' } + ) } + & { __typename?: 'Action' } + ) | null } + & { __typename?: 'Action' } + )> | null } + & { __typename?: 'Query' } +); + +export type CategoryFieldsFragmentFragment = ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } +); + +export type CategoriesRecursiveFragmentFragment = ( + { parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } ) | null } - & { __typename?: 'Action' } - )> | null } - & { __typename?: 'Query' } + & { __typename?: 'Category' } + ) | null } + & { __typename?: 'Category' } ); export type CategoryTagsCategoryFragment = ( @@ -5780,7 +6256,52 @@ export type CategoryTagsCategoryFragment = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -5795,12 +6316,6 @@ export type CategoryTagsCategoryFragment = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -5873,7 +6388,52 @@ type AttributesBlockAttribute_AttributeCategoryChoice_Fragment = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -5888,12 +6448,6 @@ type AttributesBlockAttribute_AttributeCategoryChoice_Fragment = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -6002,7 +6556,52 @@ type AttributesBlockAttributeWithNestedType_AttributeCategoryChoice_Fragment = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -6017,12 +6616,6 @@ type AttributesBlockAttributeWithNestedType_AttributeCategoryChoice_Fragment = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } @@ -8771,7 +9364,52 @@ export type GetPlanPageGeneralQuery = ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } ) | null, parent?: ( - { id: string, identifier: string, name: string, color?: string | null, iconSvgUrl?: string | null, image?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, parent?: ( + { id: string, identifier: string, name: string, leadParagraph: string, color?: string | null, iconSvgUrl?: string | null, helpText: string, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( + { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, small?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, social?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null, rendition?: ( + { id: string, width: number, height: number, src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, categoryPage?: ( + { title: string, urlPath: string } + & { __typename?: 'CategoryPage' } + ) | null } + & { __typename?: 'Category' } + ) | null, iconImage?: ( + { rendition?: ( + { src: string } + & { __typename?: 'ImageRendition' } + ) | null } + & { __typename?: 'Image' } + ) | null, type: ( + { id: string, identifier: string, hideCategoryIdentifiers: boolean } + & { __typename?: 'CategoryType' } + ), level?: ( + { id: string, name: string, namePlural?: string | null } + & { __typename?: 'CategoryLevel' } + ) | null, image?: ( { title: string, altText: string, imageCredit: string, width: number, height: number, focalPointX?: number | null, focalPointY?: number | null, large?: ( { id: string, width: number, height: number, src: string } & { __typename?: 'ImageRendition' } @@ -8786,12 +9424,6 @@ export type GetPlanPageGeneralQuery = ( & { __typename?: 'ImageRendition' } ) | null } & { __typename?: 'Image' } - ) | null, iconImage?: ( - { rendition?: ( - { src: string } - & { __typename?: 'ImageRendition' } - ) | null } - & { __typename?: 'Image' } ) | null, categoryPage?: ( { title: string, urlPath: string } & { __typename?: 'CategoryPage' } diff --git a/components/actions/ActionHero.tsx b/components/actions/ActionHero.tsx index f6f1242cc..21d24f538 100644 --- a/components/actions/ActionHero.tsx +++ b/components/actions/ActionHero.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { Container, Row, Col, UncontrolledTooltip } from 'reactstrap'; +import flatMapDeep from 'lodash/flatMapDeep'; import styled from 'styled-components'; import { useTheme } from 'common/theme'; import { getActionTermContext, useTranslation } from 'common/i18n'; @@ -173,9 +174,26 @@ const getCategoryUrl = (category: Category, primaryCategory) => { return undefined; }; +/** + * Check whether multiple categories at different levels of a single category type hierarchy + * have been added to an action. Required to filter duplicate categories from the breadcrumb. + */ +const isCategoryInSiblingsParentTree = ( + category: Category, + siblingParentCategory: Category +) => + category.id === siblingParentCategory.id || + (siblingParentCategory.parent && + isCategoryInSiblingsParentTree(category, siblingParentCategory.parent)); + +// Convert a category parent hierarchy to a flat array +const getDeepParents = (category: Category): Category[] => + !category.parent + ? [category] + : [...getDeepParents(category.parent), category]; + type PartialCategory = Pick & { url?: string; - parent?: PartialCategory; }; function Crumb({ category }: { category: PartialCategory }) { @@ -222,28 +240,31 @@ function ActionCategories({ categories }: { categories: Category[] }) { const primaryCatId = primaryCT?.id; const displayCategories: PartialCategory[] = categories - .filter((cat) => cat.type.id === primaryCatId) - .map((cat) => ({ - id: cat.id, - name: getCategoryName(cat, showIdentifiers), - url: getCategoryUrl(cat, primaryCT), - parent: cat.parent - ? { - id: cat.parent.id, - name: getCategoryName(cat.parent, showIdentifiers), - url: getCategoryUrl(cat.parent, primaryCT), - } - : undefined, + .filter( + (category) => + category.type.id === primaryCatId && + // Check whether this category is included in a sibling's parent + !categories.some( + (otherCategory) => + otherCategory.id !== category.id && + otherCategory.parent && + isCategoryInSiblingsParentTree(category, otherCategory.parent) + ) + ) + .reduce( + (categories, category) => [...getDeepParents(category), ...categories], + [] + ) + .map((category) => ({ + id: category.id, + name: getCategoryName(category, showIdentifiers), + url: getCategoryUrl(category, primaryCT), })); return ( {displayCategories.map((category) => ( -
- {category.parent && } - - -
+ ))}
); diff --git a/components/actions/CategoryTags.tsx b/components/actions/CategoryTags.tsx index d99dfda80..f6ca4d0e8 100644 --- a/components/actions/CategoryTags.tsx +++ b/components/actions/CategoryTags.tsx @@ -164,7 +164,7 @@ function CategoryTags(props: CategoryTagsProps) { } export const categoryFragment = gql` - fragment CategoryTagsCategory on Category { + fragment CategoryFieldsFragment on Category { id identifier name @@ -194,26 +194,25 @@ export const categoryFragment = gql` title urlPath } + } + + # Support parent categories up to two levels deep + fragment CategoriesRecursiveFragment on Category { parent { - id - identifier - name - image { - ...MultiUseImageFragment - } - color - iconSvgUrl - iconImage { - rendition(size: "400x400", crop: false) { - src + ...CategoryFieldsFragment + parent { + ...CategoryFieldsFragment + parent { + ...CategoryFieldsFragment } } - categoryPage { - title - urlPath - } } } + + fragment CategoryTagsCategory on Category { + ...CategoryFieldsFragment + ...CategoriesRecursiveFragment + } `; export const categoryTypeFragment = gql`