Skip to content

Commit

Permalink
fix: reorder fields in initiative editor, hide featured content for M…
Browse files Browse the repository at this point in the history
…VP (#1364)
  • Loading branch information
vivzhang authored Dec 17, 2023
1 parent 279cc6b commit dae8911
Show file tree
Hide file tree
Showing 2 changed files with 258 additions and 237 deletions.
157 changes: 82 additions & 75 deletions packages/common/src/initiatives/_internal/InitiativeUiSchemaEdit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,46 +146,6 @@ export const buildUiSchema = async (
},
},
},
getThumbnailUiSchemaElement(
i18nScope,
options.thumbnail,
options.thumbnailUrl
),
{
labelKey: `${i18nScope}.fields.tags.label`,
scope: "/properties/tags",
type: "Control",
options: {
control: "hub-field-input-combobox",
items: await getTagItems(
options.tags,
context.portal.id,
context.hubRequestOptions
),
allowCustomValues: true,
selectionMode: "multiple",
placeholderIcon: "label",
helperText: { labelKey: `${i18nScope}.fields.tags.helperText` },
},
},
{
labelKey: `${i18nScope}.fields.categories.label`,
scope: "/properties/categories",
type: "Control",
options: {
control: "hub-field-input-combobox",
items: await getCategoryItems(
context.portal.id,
context.hubRequestOptions
),
allowCustomValues: false,
selectionMode: "multiple",
placeholderIcon: "select-category",
helperText: {
labelKey: `${i18nScope}.fields.categories.helperText`,
},
},
},
],
},
{
Expand Down Expand Up @@ -219,60 +179,107 @@ export const buildUiSchema = async (
},
{
type: "Section",
labelKey: `${i18nScope}.sections.status.label`,
labelKey: `${i18nScope}.sections.searchDiscoverability.label`,
elements: [
{
scope: "/properties/status",
labelKey: `${i18nScope}.fields.categories.label`,
scope: "/properties/categories",
type: "Control",
labelKey: `${i18nScope}.fields.status.label`,
options: {
control: "hub-field-input-select",
enum: {
i18nScope: `${i18nScope}.fields.status.enum`,
control: "hub-field-input-combobox",
items: await getCategoryItems(
context.portal.id,
context.hubRequestOptions
),
allowCustomValues: false,
selectionMode: "multiple",
placeholderIcon: "select-category",
helperText: {
labelKey: `${i18nScope}.fields.categories.helperText`,
},
},
},
{
labelKey: `${i18nScope}.fields.tags.label`,
scope: "/properties/tags",
type: "Control",
options: {
control: "hub-field-input-combobox",
items: await getTagItems(
options.tags,
context.portal.id,
context.hubRequestOptions
),
allowCustomValues: true,
selectionMode: "multiple",
placeholderIcon: "label",
helperText: { labelKey: `${i18nScope}.fields.tags.helperText` },
},
},
getThumbnailUiSchemaElement(
i18nScope,
options.thumbnail,
options.thumbnailUrl
),
],
},
{
type: "Section",
labelKey: `${i18nScope}.sections.featuredContent.label`,
options: {
helperText: {
labelKey: `${i18nScope}.sections.featuredContent.helperText`,
},
},
labelKey: `${i18nScope}.sections.status.label`,
elements: [
{
scope: "/properties/view/properties/featuredContentIds",
scope: "/properties/status",
type: "Control",
labelKey: `${i18nScope}.fields.status.label`,
options: {
control: "hub-field-input-gallery-picker",
targetEntity: "item",
catalogs: getFeaturedContentCatalogs(context.currentUser),
facets: [
{
label: `{{${i18nScope}.fields.featuredContent.facets.type:translate}}`,
key: "type",
display: "multi-select",
field: "type",
options: [],
operation: "OR",
aggLimit: 100,
},
{
label: `{{${i18nScope}.fields.featuredContent.facets.sharing:translate}}`,
key: "access",
display: "multi-select",
field: "access",
options: [],
operation: "OR",
},
],
control: "hub-field-input-select",
enum: {
i18nScope: `${i18nScope}.fields.status.enum`,
},
},
},
],
},
// Feature Content - hiding for MVP
// {
// type: "Section",
// labelKey: `${i18nScope}.sections.featuredContent.label`,
// options: {
// helperText: {
// labelKey: `${i18nScope}.sections.featuredContent.helperText`,
// },
// },
// elements: [
// {
// scope: "/properties/view/properties/featuredContentIds",
// type: "Control",
// options: {
// control: "hub-field-input-gallery-picker",
// targetEntity: "item",
// catalogs: getFeaturedContentCatalogs(context.currentUser),
// facets: [
// {
// label: `{{${i18nScope}.fields.featuredContent.facets.type:translate}}`,
// key: "type",
// display: "multi-select",
// field: "type",
// options: [],
// operation: "OR",
// aggLimit: 100,
// },
// {
// label: `{{${i18nScope}.fields.featuredContent.facets.sharing:translate}}`,
// key: "access",
// display: "multi-select",
// field: "access",
// options: [],
// operation: "OR",
// },
// ],
// },
// },
// ],
// },
],
};
};
Loading

0 comments on commit dae8911

Please sign in to comment.