Skip to content

Commit

Permalink
refactor: revert some schema enums
Browse files Browse the repository at this point in the history
affects: @esri/hub-common
  • Loading branch information
vivzhang committed Dec 2, 2024
1 parent 09a7eb3 commit f953c2c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 46 deletions.
11 changes: 3 additions & 8 deletions packages/common/src/core/schemas/shared/CatalogSchema.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { EntityType, targetEntities } from "../../../search/types/IHubCatalog";
import { IConfigurationSchema } from "../types";
import {
CARD_TITLE_TAGS,
CORNERS,
DROP_SHADOWS,
SHOW_THUMBNAIL,
} from "./enums";
import { CARD_TITLE_TAGS, CORNERS, DROP_SHADOWS } from "./enums";

/** JSON schema for an IPredicate */
export const PredicateSchema: IConfigurationSchema = {
Expand Down Expand Up @@ -100,8 +95,8 @@ export const GalleryDisplayConfigSchema: IConfigurationSchema = {
},
showThumbnail: {
type: "string",
enum: Object.keys(SHOW_THUMBNAIL),
default: SHOW_THUMBNAIL.show,
enum: ["show", "hide", "grid"],
default: "show",
},
corners: {
type: "string",
Expand Down
32 changes: 0 additions & 32 deletions packages/common/src/core/schemas/shared/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,3 @@ export enum CARD_TITLE_TAGS {
h5 = "h5",
h6 = "h6",
}

/**
* Show thumbnail options,
* show | hide | only show in grid layout
*/
export enum SHOW_THUMBNAIL {
show = "show",
hide = "hide",
grid = "grid",
}

/**
* Layouts for gallery
*/
export enum LAYOUTS {
list = "list",
grid = "grid",
table = "table",
map = "map",
compact = "compact",
calendar = "calendar",
}

/**
* Button styles
*/
export enum BUTTON_STYLES {
outline = "outline",
solid = "solid",
outlineFilled = "outline-filled",
transparent = "transparent",
}
9 changes: 3 additions & 6 deletions packages/common/src/search/types/IHubCatalog.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { LAYOUTS } from "../../core/schemas/internal/metrics/interfaces";
import {
BUTTON_STYLES,
CARD_TITLE_TAGS,
CORNERS,
DROP_SHADOWS,
SHOW_THUMBNAIL,
} from "../../core/schemas/shared/enums";
import { WellKnownCollection } from "../wellKnownCatalog";

Expand Down Expand Up @@ -198,12 +195,12 @@ export interface IGalleryDisplayConfig {
* If this is true on a collection's display config, that collection will not be shown in the gallery.
*/
hidden?: boolean;
layout?: LAYOUTS;
layout?: "list" | "grid" | "map" | "table" | "calendar" | "compact";
cardTitleTag?: CARD_TITLE_TAGS;
showThumbnail?: SHOW_THUMBNAIL;
showThumbnail?: "show" | "hide" | "grid";
corners?: CORNERS;
shadow?: DROP_SHADOWS;
showLinkButton?: boolean;
linkButtonStyle?: BUTTON_STYLES;
linkButtonStyle?: "solid" | "outline" | "outline-fill" | "transparent";
linkButtonText?: string;
}

0 comments on commit f953c2c

Please sign in to comment.