Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(): add call to action to project edit uiSchema #1369

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 39 additions & 40 deletions packages/common/src/projects/_internal/ProjectUiSchemaEdit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,46 +259,45 @@ export const buildUiSchema = async (
},
],
},
// NOTE: temporarily commenting out for release.
// {
// type: "Section",
// labelKey: `${i18nScope}.sections.callToAction.label`,
// options: {
// helperText: {
// labelKey: `${i18nScope}.sections.callToAction.helperText`,
// },
// },
// elements: [
// {
// scope: "/properties/view/properties/heroActions",
// type: "Control",
// options: {
// control: "hub-composite-input-action-links",
// type: "button",
// catalogs: getFeaturedContentCatalogs(context.currentUser), // for now we'll just re-use this util to get the catalogs
// facets: [
// {
// label: `{{${i18nScope}.fields.callToAction.facets.type:translate}}`,
// key: "type",
// display: "multi-select",
// field: "type",
// options: [],
// operation: "OR",
// aggLimit: 100,
// },
// {
// label: `{{${i18nScope}.fields.callToAction.facets.sharing:translate}}`,
// key: "access",
// display: "multi-select",
// field: "access",
// options: [],
// operation: "OR",
// },
// ],
// },
// },
// ],
// },
{
type: "Section",
labelKey: `${i18nScope}.sections.callToAction.label`,
options: {
helperText: {
labelKey: `${i18nScope}.sections.callToAction.helperText`,
},
},
elements: [
{
scope: "/properties/view/properties/heroActions",
type: "Control",
options: {
control: "hub-composite-input-action-links",
type: "button",
catalogs: getFeaturedContentCatalogs(context.currentUser), // for now we'll just re-use this util to get the catalogs
facets: [
{
label: `{{${i18nScope}.fields.callToAction.facets.type:translate}}`,
key: "type",
display: "multi-select",
field: "type",
options: [],
operation: "OR",
aggLimit: 100,
},
{
label: `{{${i18nScope}.fields.callToAction.facets.sharing:translate}}`,
key: "access",
display: "multi-select",
field: "access",
options: [],
operation: "OR",
},
],
},
},
],
},
],
};
};
158 changes: 78 additions & 80 deletions packages/common/test/projects/_internal/ProjectUiSchemaEdit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,46 +274,45 @@ describe("buildUiSchema: project edit", () => {
},
],
},
// TODO: uncomment after release and we add CTA back
// {
// type: "Section",
// labelKey: "some.scope.sections.callToAction.label",
// options: {
// helperText: {
// labelKey: "some.scope.sections.callToAction.helperText",
// },
// },
// elements: [
// {
// scope: "/properties/view/properties/heroActions",
// type: "Control",
// options: {
// control: "hub-composite-input-action-links",
// type: "button",
// catalogs: {},
// facets: [
// {
// label: `{{some.scope.fields.callToAction.facets.type:translate}}`,
// key: "type",
// display: "multi-select",
// field: "type",
// options: [],
// operation: "OR",
// aggLimit: 100,
// },
// {
// label: `{{some.scope.fields.callToAction.facets.sharing:translate}}`,
// key: "access",
// display: "multi-select",
// field: "access",
// options: [],
// operation: "OR",
// },
// ],
// },
// },
// ],
// },
{
type: "Section",
labelKey: "some.scope.sections.callToAction.label",
options: {
helperText: {
labelKey: "some.scope.sections.callToAction.helperText",
},
},
elements: [
{
scope: "/properties/view/properties/heroActions",
type: "Control",
options: {
control: "hub-composite-input-action-links",
type: "button",
catalogs: {},
facets: [
{
label: `{{some.scope.fields.callToAction.facets.type:translate}}`,
key: "type",
display: "multi-select",
field: "type",
options: [],
operation: "OR",
aggLimit: 100,
},
{
label: `{{some.scope.fields.callToAction.facets.sharing:translate}}`,
key: "access",
display: "multi-select",
field: "access",
options: [],
operation: "OR",
},
],
},
},
],
},
],
});
});
Expand Down Expand Up @@ -586,46 +585,45 @@ describe("buildUiSchema: project edit", () => {
},
],
},
// TODO: uncomment after release and we add CTA back
// {
// type: "Section",
// labelKey: "some.scope.sections.callToAction.label",
// options: {
// helperText: {
// labelKey: "some.scope.sections.callToAction.helperText",
// },
// },
// elements: [
// {
// scope: "/properties/view/properties/heroActions",
// type: "Control",
// options: {
// control: "hub-composite-input-action-links",
// type: "button",
// catalogs: {},
// facets: [
// {
// label: `{{some.scope.fields.callToAction.facets.type:translate}}`,
// key: "type",
// display: "multi-select",
// field: "type",
// options: [],
// operation: "OR",
// aggLimit: 100,
// },
// {
// label: `{{some.scope.fields.callToAction.facets.sharing:translate}}`,
// key: "access",
// display: "multi-select",
// field: "access",
// options: [],
// operation: "OR",
// },
// ],
// },
// },
// ],
// },
{
type: "Section",
labelKey: "some.scope.sections.callToAction.label",
options: {
helperText: {
labelKey: "some.scope.sections.callToAction.helperText",
},
},
elements: [
{
scope: "/properties/view/properties/heroActions",
type: "Control",
options: {
control: "hub-composite-input-action-links",
type: "button",
catalogs: {},
facets: [
{
label: `{{some.scope.fields.callToAction.facets.type:translate}}`,
key: "type",
display: "multi-select",
field: "type",
options: [],
operation: "OR",
aggLimit: 100,
},
{
label: `{{some.scope.fields.callToAction.facets.sharing:translate}}`,
key: "access",
display: "multi-select",
field: "access",
options: [],
operation: "OR",
},
],
},
},
],
},
],
});
});
Expand Down