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

feat: Icon picker component (WIP) #3487

Open
wants to merge 10 commits into
base: next
Choose a base branch
from
30 changes: 25 additions & 5 deletions apps/api/graphql/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ const createTestGroup = () => {
name: "Homepage",
description: "Homepage content model group",
slug: "homepage",
icon: "fas/house"
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
}
});
};
const createTestModel = () => {
Expand Down Expand Up @@ -49,7 +53,11 @@ const createTestModel = () => {
templates: [
{
description: "List of customer reviews",
icon: "far/face-smile",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
id: "homepage_customer_reviews",
name: "CustomerReviews",
fields: [
Expand Down Expand Up @@ -148,7 +156,11 @@ const createTestModel = () => {
},
{
description: "Hero component",
icon: "fas/bolt-lightning",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
id: "homepage_hero",
name: "Hero",
fields: [
Expand Down Expand Up @@ -200,7 +212,11 @@ const createTestModel = () => {
},
{
description: "Compare the good and bad",
icon: "fas/table",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
id: "homepage_compare_table",
name: "CompareTable",
fields: [
Expand Down Expand Up @@ -309,7 +325,11 @@ const createTestModel = () => {
},
{
description: "List of teachers on the homepage",
icon: "fas/chalkboard-teacher",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
id: "homepage_teachers",
name: "Teachers",
fields: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ describe("Headless CMS - Content Entries", () => {
before(() => {
return cy
.cmsCreateContentModelGroup({
data: { name: uniqid("Group-"), icon: "fas/star" }
data: {
name: uniqid("Group-"),
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
}
}
})
.then(data => {
group = data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ context("Search, Sort and Filter Content Entries", () => {
// Runs once before all tests in the block
before(() => {
cy.cmsCreateContentModelGroup({
data: { name: uniqid("Group-"), icon: "fas/star" }
data: {
name: uniqid("Group-"),
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
}
}
}).then(group => {
createdGroup = group;
cy.cmsCreateContentModel({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ context("Headless CMS - Search and Sort Content Models", () => {
before(() => {
// Create content model group
cy.cmsCreateContentModelGroup({
data: { name: uniqid("Testing-"), icon: "fas/star" }
data: {
name: uniqid("Testing-"),
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
}
}
}).then(data => {
contentModelGroup = data;
// Create first content model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,44 @@ context("Page Builder - Blocks", () => {
const blockCategoryData1 = {
name: nanoid(10).toLowerCase(),
slug: nanoid(10).toLowerCase(),
icon: "icon-name",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: nanoid(10).toLowerCase()
};

const blockCategoryData2 = {
name: nanoid(10).toLowerCase(),
slug: nanoid(10).toLowerCase(),
icon: "icon-name",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: nanoid(10).toLowerCase()
};

const blockCategoryData3 = {
name: nanoid(10).toLowerCase(),
slug: nanoid(10).toLowerCase(),
icon: "icon-name",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: nanoid(10).toLowerCase()
};

const blockCategoryData4 = {
name: nanoid(10).toLowerCase(),
slug: nanoid(10).toLowerCase(),
icon: "icon-name",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: nanoid(10).toLowerCase()
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,33 @@ context("Page Builder - Blocks Export/Import", () => {
const blockCategoryData1 = {
name: nanoid(10).toLowerCase(),
slug: nanoid(10).toLowerCase(),
icon: "icon-name",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: nanoid(10).toLowerCase()
};

const blockCategoryData2 = {
name: nanoid(10).toLowerCase(),
slug: nanoid(10).toLowerCase(),
icon: "icon-name",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: nanoid(10).toLowerCase()
};

const blockCategoryData3 = {
name: nanoid(10).toLowerCase(),
slug: nanoid(10).toLowerCase(),
icon: "icon-name",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: nanoid(10).toLowerCase()
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,33 @@ context("Page Builder - Blocks Export/Import", () => {
const blockCategoryData1 = {
name: nanoid(10).toLowerCase(),
slug: nanoid(10).toLowerCase(),
icon: "icon-name",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: nanoid(10).toLowerCase()
};

const blockCategoryData2 = {
name: nanoid(10).toLowerCase(),
slug: nanoid(10).toLowerCase(),
icon: "icon-name",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: nanoid(10).toLowerCase()
};

const blockCategoryData3 = {
name: nanoid(10).toLowerCase(),
slug: nanoid(10).toLowerCase(),
icon: "icon-name",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: nanoid(10).toLowerCase()
};

Expand Down
6 changes: 5 additions & 1 deletion packages/api-aco/__tests__/utils/useGraphQlHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ export const useGraphQlHandler = (params: UseGQLHandlerParams = {}) => {
data: {
name: "Group",
slug: "group",
icon: "ico/ico",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: "description"
}
})
Expand Down
6 changes: 5 additions & 1 deletion packages/api-aco/src/createAcoModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export const createAcoModels = (context: CmsContext) => {
slug: "aco",
name: "ACO",
description: "Group for Advanced Content Organisation and Search",
icon: "fas/folder",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
isPrivate: true
});

Expand Down
6 changes: 5 additions & 1 deletion packages/api-apw/__tests__/graphql/mocks/access/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ export const accessTestGroup = createCmsGroup({
slug: "accessTestGroup",
name: "Access Test Group",
description: "",
icon: "fa/fas"
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
}
});

export const accessTestModel = createCmsModel({
Expand Down
6 changes: 5 additions & 1 deletion packages/api-apw/__tests__/utils/cms.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ const createGroupData = () => {
return {
name: "Group",
slug: "group",
icon: "ico/ico",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
description: "description"
};
};
Expand Down
6 changes: 5 additions & 1 deletion packages/api-apw/src/storageOperations/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export const createApwModels = (context: CmsContext) => {
slug: "apw",
name: "APW",
description: "Group for Advanced Publishing Workflow",
icon: "fas/star",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
isPrivate: true
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export const createFileManagerPlugins = () => {
slug: "fileManager",
name: "File Manager",
description: "Group for File Manager models",
icon: "fas/folder",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
isPrivate: true
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ export const createGroup = () => {
return new CmsGroupPlugin({
id: "testing",
name: "Testing",
icon: "fas/star",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
slug: "testing",
description: ""
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ const setupGroup = async (context: CmsContext) => {
return context.cms.createGroup({
name: "Test Group",
description: "Test Group Description",
icon: "fa/fas",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
slug: "test-group"
});
};
Expand Down
2 changes: 1 addition & 1 deletion packages/api-headless-cms-ddb-es/src/definitions/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const createGroupEntity = (params: CreateGroupEntityParams): Entity<any>
type: "string"
},
icon: {
type: "string"
type: "map"
},

createdBy: {
Expand Down
2 changes: 1 addition & 1 deletion packages/api-headless-cms-ddb-es/src/definitions/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const createModelEntity = (params: CreateModelEntityParams): Entity<any>
required: true
},
icon: {
type: "string"
type: "map"
},
description: {
type: "string"
Expand Down
2 changes: 1 addition & 1 deletion packages/api-headless-cms-ddb/src/definitions/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const createGroupEntity = (params: Params): Entity<any> => {
type: "string"
},
icon: {
type: "string"
type: "map"
},

createdBy: {
Expand Down
2 changes: 1 addition & 1 deletion packages/api-headless-cms-ddb/src/definitions/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const createModelEntity = (params: Params): Entity<any> => {
required: true
},
icon: {
type: "string"
type: "map"
},
description: {
type: "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ export const createGroupPlugin = () => {
name: "Group",
slug: "group",
description: "Group description",
icon: "fas/star",
icon: {
type: "emoji",
name: "thumbs_up",
value: "👍"
},
id: "group"
});
};
Expand Down
Loading