From 91b6243407ea41fc60e959d9732adef44591afce Mon Sep 17 00:00:00 2001 From: Samuel Gerard Date: Mon, 18 Nov 2024 18:57:23 -0800 Subject: [PATCH] chore: pull home page content from CMS (#16) --- .../api/home/content-types/home/schema.json | 13 +- cms/types/generated/components.d.ts | 116 +- cms/types/generated/contentTypes.d.ts | 1089 +++++++++-------- frontend/src/app/app.component.ts | 8 +- frontend/src/app/app.routes.ts | 6 +- frontend/src/app/graphql.module.ts | 1 - frontend/src/app/home/home.component.html | 93 +- frontend/src/app/home/home.component.ts | 18 +- frontend/src/app/models/content/fast-fact.ts | 4 + .../src/app/models/content/feature-block.ts | 7 + .../{header_button.ts => header-button.ts} | 2 +- .../src/app/models/content/home-response.ts | 15 + frontend/src/app/models/content/home.ts | 11 + frontend/src/app/models/content/page.ts | 4 +- frontend/src/app/models/home.ts | 3 - frontend/src/app/page/page.component.ts | 1 - frontend/src/app/services/content-resolver.ts | 40 +- frontend/src/app/services/home-resolver.ts | 80 ++ 18 files changed, 812 insertions(+), 699 deletions(-) create mode 100644 frontend/src/app/models/content/fast-fact.ts create mode 100644 frontend/src/app/models/content/feature-block.ts rename frontend/src/app/models/content/{header_button.ts => header-button.ts} (59%) create mode 100644 frontend/src/app/models/content/home-response.ts create mode 100644 frontend/src/app/models/content/home.ts delete mode 100644 frontend/src/app/models/home.ts create mode 100644 frontend/src/app/services/home-resolver.ts diff --git a/cms/src/api/home/content-types/home/schema.json b/cms/src/api/home/content-types/home/schema.json index 5d9fe2b..9faad26 100644 --- a/cms/src/api/home/content-types/home/schema.json +++ b/cms/src/api/home/content-types/home/schema.json @@ -4,7 +4,8 @@ "info": { "singularName": "home", "pluralName": "homes", - "displayName": "Home" + "displayName": "Home", + "description": "" }, "options": { "draftAndPublish": true @@ -17,9 +18,6 @@ "Description": { "type": "text" }, - "About": { - "type": "richtext" - }, "Mining_blocks": { "type": "component", "repeatable": true, @@ -29,6 +27,13 @@ "type": "component", "repeatable": true, "component": "page.feature-block" + }, + "About": { + "type": "customField", + "options": { + "preset": "toolbar" + }, + "customField": "plugin::ckeditor5.CKEditor" } } } diff --git a/cms/types/generated/components.d.ts b/cms/types/generated/components.d.ts index b8dc104..ce9053c 100644 --- a/cms/types/generated/components.d.ts +++ b/cms/types/generated/components.d.ts @@ -1,124 +1,124 @@ -import type { Schema, Attribute } from '@strapi/strapi'; +import type { Attribute, Schema } from '@strapi/strapi'; -export interface PageScrollButton extends Schema.Component { - collectionName: 'components_page_scroll_buttons'; +export interface ComponentsFooterLink extends Schema.Component { + collectionName: 'components_components_footer_links'; info: { - displayName: 'Scroll Button'; - description: ''; + displayName: 'FooterLink'; }; attributes: { - Text: Attribute.String; - Section_id: Attribute.String; + Link_name: Attribute.String; + Page: Attribute.Relation< + 'components.footer-link', + 'oneToOne', + 'api::page.page' + >; }; } -export interface PageFeatureBlock extends Schema.Component { - collectionName: 'components_page_feature_blocks'; +export interface ComponentsInternalLink extends Schema.Component { + collectionName: 'components_components_internal_links'; info: { - displayName: 'Feature Block'; - icon: 'grid'; description: ''; + displayName: 'internalLink'; }; attributes: { - Title: Attribute.String; - Description: Attribute.String; - page: Attribute.Relation< - 'page.feature-block', + Description: Attribute.Text; + Link: Attribute.Relation< + 'components.internal-link', 'oneToOne', 'api::page.page' >; + Link_heading: Attribute.String; }; } -export interface LayoutHeader extends Schema.Component { - collectionName: 'components_layout_headers'; +export interface ComponentsLink extends Schema.Component { + collectionName: 'components_components_links'; info: { - displayName: 'NavLinks'; description: ''; + displayName: 'externalLink'; }; attributes: { - Nav_heading: Attribute.String; - Footer_link: Attribute.Component<'components.footer-link', true>; + url: Attribute.String; + Url_name: Attribute.String; }; } -export interface LayoutFooterBar extends Schema.Component { - collectionName: 'components_layout_footer_bars'; +export interface ComponentsSocialLink extends Schema.Component { + collectionName: 'components_components_social_links'; info: { - displayName: 'footer_bar'; - description: ''; + displayName: 'SocialLink'; }; attributes: { - External_link: Attribute.Component<'components.link', true>; + Image: Attribute.Media<'images' | 'files' | 'videos' | 'audios', true>; + Url: Attribute.String; }; } -export interface ComponentsSocialLink extends Schema.Component { - collectionName: 'components_components_social_links'; +export interface LayoutFooterBar extends Schema.Component { + collectionName: 'components_layout_footer_bars'; info: { - displayName: 'SocialLink'; + description: ''; + displayName: 'footer_bar'; }; attributes: { - Image: Attribute.Media<'images' | 'files' | 'videos' | 'audios', true>; - Url: Attribute.String; + External_link: Attribute.Component<'components.link', true>; }; } -export interface ComponentsLink extends Schema.Component { - collectionName: 'components_components_links'; +export interface LayoutHeader extends Schema.Component { + collectionName: 'components_layout_headers'; info: { - displayName: 'externalLink'; description: ''; + displayName: 'NavLinks'; }; attributes: { - Url_name: Attribute.String; - url: Attribute.String; + Footer_link: Attribute.Component<'components.footer-link', true>; + Nav_heading: Attribute.String; }; } -export interface ComponentsInternalLink extends Schema.Component { - collectionName: 'components_components_internal_links'; +export interface PageFeatureBlock extends Schema.Component { + collectionName: 'components_page_feature_blocks'; info: { - displayName: 'internalLink'; description: ''; + displayName: 'Feature Block'; + icon: 'grid'; }; attributes: { - Link_heading: Attribute.String; - Link: Attribute.Relation< - 'components.internal-link', + Description: Attribute.String; + page: Attribute.Relation< + 'page.feature-block', 'oneToOne', 'api::page.page' >; - Description: Attribute.Text; + Title: Attribute.String; }; } -export interface ComponentsFooterLink extends Schema.Component { - collectionName: 'components_components_footer_links'; +export interface PageScrollButton extends Schema.Component { + collectionName: 'components_page_scroll_buttons'; info: { - displayName: 'FooterLink'; + description: ''; + displayName: 'Scroll Button'; }; attributes: { - Link_name: Attribute.String; - Page: Attribute.Relation< - 'components.footer-link', - 'oneToOne', - 'api::page.page' - >; + Section_id: Attribute.String; + Text: Attribute.String; }; } declare module '@strapi/types' { export module Shared { export interface Components { - 'page.scroll-button': PageScrollButton; - 'page.feature-block': PageFeatureBlock; - 'layout.header': LayoutHeader; - 'layout.footer-bar': LayoutFooterBar; - 'components.social-link': ComponentsSocialLink; - 'components.link': ComponentsLink; - 'components.internal-link': ComponentsInternalLink; 'components.footer-link': ComponentsFooterLink; + 'components.internal-link': ComponentsInternalLink; + 'components.link': ComponentsLink; + 'components.social-link': ComponentsSocialLink; + 'layout.footer-bar': LayoutFooterBar; + 'layout.header': LayoutHeader; + 'page.feature-block': PageFeatureBlock; + 'page.scroll-button': PageScrollButton; } } } diff --git a/cms/types/generated/contentTypes.d.ts b/cms/types/generated/contentTypes.d.ts index e67bbd6..65e3265 100644 --- a/cms/types/generated/contentTypes.d.ts +++ b/cms/types/generated/contentTypes.d.ts @@ -1,13 +1,13 @@ -import type { Schema, Attribute } from '@strapi/strapi'; +import type { Attribute, Schema } from '@strapi/strapi'; -export interface AdminPermission extends Schema.CollectionType { - collectionName: 'admin_permissions'; +export interface AdminApiToken extends Schema.CollectionType { + collectionName: 'strapi_api_tokens'; info: { - name: 'Permission'; description: ''; - singularName: 'permission'; - pluralName: 'permissions'; - displayName: 'Permission'; + displayName: 'Api Token'; + name: 'Api Token'; + pluralName: 'api-tokens'; + singularName: 'api-token'; }; pluginOptions: { 'content-manager': { @@ -18,29 +18,88 @@ export interface AdminPermission extends Schema.CollectionType { }; }; attributes: { - action: Attribute.String & + accessKey: Attribute.String & Attribute.Required & Attribute.SetMinMaxLength<{ minLength: 1; }>; - actionParameters: Attribute.JSON & Attribute.DefaultTo<{}>; - subject: Attribute.String & + createdAt: Attribute.DateTime; + createdBy: Attribute.Relation< + 'admin::api-token', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + description: Attribute.String & + Attribute.SetMinMaxLength<{ + minLength: 1; + }> & + Attribute.DefaultTo<''>; + expiresAt: Attribute.DateTime; + lastUsedAt: Attribute.DateTime; + lifespan: Attribute.BigInteger; + name: Attribute.String & + Attribute.Required & + Attribute.Unique & Attribute.SetMinMaxLength<{ minLength: 1; }>; - properties: Attribute.JSON & Attribute.DefaultTo<{}>; - conditions: Attribute.JSON & Attribute.DefaultTo<[]>; - role: Attribute.Relation<'admin::permission', 'manyToOne', 'admin::role'>; - createdAt: Attribute.DateTime; + permissions: Attribute.Relation< + 'admin::api-token', + 'oneToMany', + 'admin::api-token-permission' + >; + type: Attribute.Enumeration<['read-only', 'full-access', 'custom']> & + Attribute.Required & + Attribute.DefaultTo<'read-only'>; updatedAt: Attribute.DateTime; + updatedBy: Attribute.Relation< + 'admin::api-token', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + }; +} + +export interface AdminApiTokenPermission extends Schema.CollectionType { + collectionName: 'strapi_api_token_permissions'; + info: { + description: ''; + displayName: 'API Token Permission'; + name: 'API Token Permission'; + pluralName: 'api-token-permissions'; + singularName: 'api-token-permission'; + }; + pluginOptions: { + 'content-manager': { + visible: false; + }; + 'content-type-builder': { + visible: false; + }; + }; + attributes: { + action: Attribute.String & + Attribute.Required & + Attribute.SetMinMaxLength<{ + minLength: 1; + }>; + createdAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'admin::permission', + 'admin::api-token-permission', 'oneToOne', 'admin::user' > & Attribute.Private; + token: Attribute.Relation< + 'admin::api-token-permission', + 'manyToOne', + 'admin::api-token' + >; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< - 'admin::permission', + 'admin::api-token-permission', 'oneToOne', 'admin::user' > & @@ -48,14 +107,14 @@ export interface AdminPermission extends Schema.CollectionType { }; } -export interface AdminUser extends Schema.CollectionType { - collectionName: 'admin_users'; +export interface AdminPermission extends Schema.CollectionType { + collectionName: 'admin_permissions'; info: { - name: 'User'; description: ''; - singularName: 'user'; - pluralName: 'users'; - displayName: 'User'; + displayName: 'Permission'; + name: 'Permission'; + pluralName: 'permissions'; + singularName: 'permission'; }; pluginOptions: { 'content-manager': { @@ -66,41 +125,32 @@ export interface AdminUser extends Schema.CollectionType { }; }; attributes: { - firstname: Attribute.String & + action: Attribute.String & + Attribute.Required & Attribute.SetMinMaxLength<{ minLength: 1; }>; - lastname: Attribute.String & + actionParameters: Attribute.JSON & Attribute.DefaultTo<{}>; + conditions: Attribute.JSON & Attribute.DefaultTo<[]>; + createdAt: Attribute.DateTime; + createdBy: Attribute.Relation< + 'admin::permission', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + properties: Attribute.JSON & Attribute.DefaultTo<{}>; + role: Attribute.Relation<'admin::permission', 'manyToOne', 'admin::role'>; + subject: Attribute.String & Attribute.SetMinMaxLength<{ minLength: 1; }>; - username: Attribute.String; - email: Attribute.Email & - Attribute.Required & - Attribute.Private & - Attribute.Unique & - Attribute.SetMinMaxLength<{ - minLength: 6; - }>; - password: Attribute.Password & - Attribute.Private & - Attribute.SetMinMaxLength<{ - minLength: 6; - }>; - resetPasswordToken: Attribute.String & Attribute.Private; - registrationToken: Attribute.String & Attribute.Private; - isActive: Attribute.Boolean & - Attribute.Private & - Attribute.DefaultTo; - roles: Attribute.Relation<'admin::user', 'manyToMany', 'admin::role'> & - Attribute.Private; - blocked: Attribute.Boolean & Attribute.Private & Attribute.DefaultTo; - preferedLanguage: Attribute.String; - createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; - createdBy: Attribute.Relation<'admin::user', 'oneToOne', 'admin::user'> & - Attribute.Private; - updatedBy: Attribute.Relation<'admin::user', 'oneToOne', 'admin::user'> & + updatedBy: Attribute.Relation< + 'admin::permission', + 'oneToOne', + 'admin::user' + > & Attribute.Private; }; } @@ -108,11 +158,11 @@ export interface AdminUser extends Schema.CollectionType { export interface AdminRole extends Schema.CollectionType { collectionName: 'admin_roles'; info: { - name: 'Role'; description: ''; - singularName: 'role'; - pluralName: 'roles'; displayName: 'Role'; + name: 'Role'; + pluralName: 'roles'; + singularName: 'role'; }; pluginOptions: { 'content-manager': { @@ -123,42 +173,42 @@ export interface AdminRole extends Schema.CollectionType { }; }; attributes: { - name: Attribute.String & + code: Attribute.String & Attribute.Required & Attribute.Unique & Attribute.SetMinMaxLength<{ minLength: 1; }>; - code: Attribute.String & + createdAt: Attribute.DateTime; + createdBy: Attribute.Relation<'admin::role', 'oneToOne', 'admin::user'> & + Attribute.Private; + description: Attribute.String; + name: Attribute.String & Attribute.Required & Attribute.Unique & Attribute.SetMinMaxLength<{ minLength: 1; }>; - description: Attribute.String; - users: Attribute.Relation<'admin::role', 'manyToMany', 'admin::user'>; permissions: Attribute.Relation< 'admin::role', 'oneToMany', 'admin::permission' >; - createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; - createdBy: Attribute.Relation<'admin::role', 'oneToOne', 'admin::user'> & - Attribute.Private; updatedBy: Attribute.Relation<'admin::role', 'oneToOne', 'admin::user'> & Attribute.Private; + users: Attribute.Relation<'admin::role', 'manyToMany', 'admin::user'>; }; } -export interface AdminApiToken extends Schema.CollectionType { - collectionName: 'strapi_api_tokens'; +export interface AdminTransferToken extends Schema.CollectionType { + collectionName: 'strapi_transfer_tokens'; info: { - name: 'Api Token'; - singularName: 'api-token'; - pluralName: 'api-tokens'; - displayName: 'Api Token'; description: ''; + displayName: 'Transfer Token'; + name: 'Transfer Token'; + pluralName: 'transfer-tokens'; + singularName: 'transfer-token'; }; pluginOptions: { 'content-manager': { @@ -169,43 +219,40 @@ export interface AdminApiToken extends Schema.CollectionType { }; }; attributes: { - name: Attribute.String & + accessKey: Attribute.String & Attribute.Required & - Attribute.Unique & Attribute.SetMinMaxLength<{ minLength: 1; }>; + createdAt: Attribute.DateTime; + createdBy: Attribute.Relation< + 'admin::transfer-token', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; description: Attribute.String & Attribute.SetMinMaxLength<{ minLength: 1; }> & Attribute.DefaultTo<''>; - type: Attribute.Enumeration<['read-only', 'full-access', 'custom']> & - Attribute.Required & - Attribute.DefaultTo<'read-only'>; - accessKey: Attribute.String & + expiresAt: Attribute.DateTime; + lastUsedAt: Attribute.DateTime; + lifespan: Attribute.BigInteger; + name: Attribute.String & Attribute.Required & + Attribute.Unique & Attribute.SetMinMaxLength<{ minLength: 1; }>; - lastUsedAt: Attribute.DateTime; permissions: Attribute.Relation< - 'admin::api-token', + 'admin::transfer-token', 'oneToMany', - 'admin::api-token-permission' + 'admin::transfer-token-permission' >; - expiresAt: Attribute.DateTime; - lifespan: Attribute.BigInteger; - createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; - createdBy: Attribute.Relation< - 'admin::api-token', - 'oneToOne', - 'admin::user' - > & - Attribute.Private; updatedBy: Attribute.Relation< - 'admin::api-token', + 'admin::transfer-token', 'oneToOne', 'admin::user' > & @@ -213,14 +260,14 @@ export interface AdminApiToken extends Schema.CollectionType { }; } -export interface AdminApiTokenPermission extends Schema.CollectionType { - collectionName: 'strapi_api_token_permissions'; +export interface AdminTransferTokenPermission extends Schema.CollectionType { + collectionName: 'strapi_transfer_token_permissions'; info: { - name: 'API Token Permission'; description: ''; - singularName: 'api-token-permission'; - pluralName: 'api-token-permissions'; - displayName: 'API Token Permission'; + displayName: 'Transfer Token Permission'; + name: 'Transfer Token Permission'; + pluralName: 'transfer-token-permissions'; + singularName: 'transfer-token-permission'; }; pluginOptions: { 'content-manager': { @@ -236,21 +283,21 @@ export interface AdminApiTokenPermission extends Schema.CollectionType { Attribute.SetMinMaxLength<{ minLength: 1; }>; - token: Attribute.Relation< - 'admin::api-token-permission', - 'manyToOne', - 'admin::api-token' - >; createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'admin::api-token-permission', + 'admin::transfer-token-permission', 'oneToOne', 'admin::user' > & Attribute.Private; + token: Attribute.Relation< + 'admin::transfer-token-permission', + 'manyToOne', + 'admin::transfer-token' + >; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< - 'admin::api-token-permission', + 'admin::transfer-token-permission', 'oneToOne', 'admin::user' > & @@ -258,14 +305,14 @@ export interface AdminApiTokenPermission extends Schema.CollectionType { }; } -export interface AdminTransferToken extends Schema.CollectionType { - collectionName: 'strapi_transfer_tokens'; +export interface AdminUser extends Schema.CollectionType { + collectionName: 'admin_users'; info: { - name: 'Transfer Token'; - singularName: 'transfer-token'; - pluralName: 'transfer-tokens'; - displayName: 'Transfer Token'; description: ''; + displayName: 'User'; + name: 'User'; + pluralName: 'users'; + singularName: 'user'; }; pluginOptions: { 'content-manager': { @@ -276,85 +323,114 @@ export interface AdminTransferToken extends Schema.CollectionType { }; }; attributes: { - name: Attribute.String & + blocked: Attribute.Boolean & Attribute.Private & Attribute.DefaultTo; + createdAt: Attribute.DateTime; + createdBy: Attribute.Relation<'admin::user', 'oneToOne', 'admin::user'> & + Attribute.Private; + email: Attribute.Email & Attribute.Required & + Attribute.Private & Attribute.Unique & Attribute.SetMinMaxLength<{ - minLength: 1; + minLength: 6; }>; - description: Attribute.String & + firstname: Attribute.String & Attribute.SetMinMaxLength<{ minLength: 1; - }> & - Attribute.DefaultTo<''>; - accessKey: Attribute.String & - Attribute.Required & + }>; + isActive: Attribute.Boolean & + Attribute.Private & + Attribute.DefaultTo; + lastname: Attribute.String & Attribute.SetMinMaxLength<{ minLength: 1; }>; - lastUsedAt: Attribute.DateTime; - permissions: Attribute.Relation< - 'admin::transfer-token', - 'oneToMany', - 'admin::transfer-token-permission' - >; - expiresAt: Attribute.DateTime; - lifespan: Attribute.BigInteger; - createdAt: Attribute.DateTime; + password: Attribute.Password & + Attribute.Private & + Attribute.SetMinMaxLength<{ + minLength: 6; + }>; + preferedLanguage: Attribute.String; + registrationToken: Attribute.String & Attribute.Private; + resetPasswordToken: Attribute.String & Attribute.Private; + roles: Attribute.Relation<'admin::user', 'manyToMany', 'admin::role'> & + Attribute.Private; updatedAt: Attribute.DateTime; + updatedBy: Attribute.Relation<'admin::user', 'oneToOne', 'admin::user'> & + Attribute.Private; + username: Attribute.String; + }; +} + +export interface ApiFastFactFastFact extends Schema.CollectionType { + collectionName: 'fast_facts'; + info: { + displayName: 'Fast Facts'; + pluralName: 'fast-facts'; + singularName: 'fast-fact'; + }; + options: { + draftAndPublish: false; + }; + attributes: { + createdAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'admin::transfer-token', + 'api::fast-fact.fast-fact', 'oneToOne', 'admin::user' > & Attribute.Private; + description: Attribute.String; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< - 'admin::transfer-token', + 'api::fast-fact.fast-fact', 'oneToOne', 'admin::user' > & Attribute.Private; + value: Attribute.String; }; } -export interface AdminTransferTokenPermission extends Schema.CollectionType { - collectionName: 'strapi_transfer_token_permissions'; +export interface ApiFooterFooter extends Schema.SingleType { + collectionName: 'footers'; info: { - name: 'Transfer Token Permission'; description: ''; - singularName: 'transfer-token-permission'; - pluralName: 'transfer-token-permissions'; - displayName: 'Transfer Token Permission'; + displayName: 'Footer'; + pluralName: 'footers'; + singularName: 'footer'; }; - pluginOptions: { - 'content-manager': { - visible: false; - }; - 'content-type-builder': { - visible: false; - }; + options: { + draftAndPublish: true; }; attributes: { - action: Attribute.String & - Attribute.Required & - Attribute.SetMinMaxLength<{ - minLength: 1; - }>; - token: Attribute.Relation< - 'admin::transfer-token-permission', - 'manyToOne', - 'admin::transfer-token' - >; + About_description: Attribute.RichText & + Attribute.CustomField< + 'plugin::ckeditor5.CKEditor', + { + preset: 'toolbar'; + } + >; + About_title: Attribute.String; + Connect_description: Attribute.RichText & + Attribute.CustomField< + 'plugin::ckeditor5.CKEditor', + { + preset: 'toolbar'; + } + >; + Connect_title: Attribute.String; createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'admin::transfer-token-permission', + 'api::footer.footer', 'oneToOne', 'admin::user' > & Attribute.Private; + publishedAt: Attribute.DateTime; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< - 'admin::transfer-token-permission', + 'api::footer.footer', 'oneToOne', 'admin::user' > & @@ -362,63 +438,68 @@ export interface AdminTransferTokenPermission extends Schema.CollectionType { }; } -export interface PluginUploadFile extends Schema.CollectionType { - collectionName: 'files'; +export interface ApiHomeHome extends Schema.SingleType { + collectionName: 'homes'; info: { - singularName: 'file'; - pluralName: 'files'; - displayName: 'File'; description: ''; + displayName: 'Home'; + pluralName: 'homes'; + singularName: 'home'; }; - pluginOptions: { - 'content-manager': { - visible: false; - }; - 'content-type-builder': { - visible: false; - }; + options: { + draftAndPublish: true; }; attributes: { - name: Attribute.String & Attribute.Required; - alternativeText: Attribute.String; - caption: Attribute.String; - width: Attribute.Integer; - height: Attribute.Integer; - formats: Attribute.JSON; - hash: Attribute.String & Attribute.Required; - ext: Attribute.String; - mime: Attribute.String & Attribute.Required; - size: Attribute.Decimal & Attribute.Required; - url: Attribute.String & Attribute.Required; - previewUrl: Attribute.String; - provider: Attribute.String & Attribute.Required; - provider_metadata: Attribute.JSON; - related: Attribute.Relation<'plugin::upload.file', 'morphToMany'>; - folder: Attribute.Relation< - 'plugin::upload.file', - 'manyToOne', - 'plugin::upload.folder' - > & - Attribute.Private; - folderPath: Attribute.String & - Attribute.Required & - Attribute.Private & - Attribute.SetMinMax< + About: Attribute.RichText & + Attribute.CustomField< + 'plugin::ckeditor5.CKEditor', { - min: 1; - }, - number + preset: 'toolbar'; + } >; createdAt: Attribute.DateTime; + createdBy: Attribute.Relation<'api::home.home', 'oneToOne', 'admin::user'> & + Attribute.Private; + Description: Attribute.Text; + Mining_blocks: Attribute.Component<'page.feature-block', true>; + Processes_blocks: Attribute.Component<'page.feature-block', true>; + publishedAt: Attribute.DateTime; + Title: Attribute.String; updatedAt: Attribute.DateTime; + updatedBy: Attribute.Relation<'api::home.home', 'oneToOne', 'admin::user'> & + Attribute.Private; + }; +} + +export interface ApiNavigationNavigation extends Schema.CollectionType { + collectionName: 'navigations'; + info: { + description: ''; + displayName: 'Navigation'; + pluralName: 'navigations'; + singularName: 'navigation'; + }; + options: { + draftAndPublish: false; + }; + attributes: { + createdAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'plugin::upload.file', + 'api::navigation.navigation', 'oneToOne', 'admin::user' > & Attribute.Private; + Heading: Attribute.String; + pages: Attribute.Relation< + 'api::navigation.navigation', + 'oneToMany', + 'api::page.page' + >; + Short_heading: Attribute.String; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< - 'plugin::upload.file', + 'api::navigation.navigation', 'oneToOne', 'admin::user' > & @@ -426,67 +507,65 @@ export interface PluginUploadFile extends Schema.CollectionType { }; } -export interface PluginUploadFolder extends Schema.CollectionType { - collectionName: 'upload_folders'; +export interface ApiPagePage extends Schema.CollectionType { + collectionName: 'pages'; info: { - singularName: 'folder'; - pluralName: 'folders'; - displayName: 'Folder'; + description: ''; + displayName: 'Page'; + pluralName: 'pages'; + singularName: 'page'; }; - pluginOptions: { - 'content-manager': { - visible: false; - }; - 'content-type-builder': { - visible: false; - }; + options: { + draftAndPublish: true; }; attributes: { - name: Attribute.String & + Content: Attribute.RichText & Attribute.Required & - Attribute.SetMinMax< + Attribute.CustomField< + 'plugin::ckeditor5.CKEditor', { - min: 1; - }, - number + preset: 'toolbar'; + } >; - pathId: Attribute.Integer & Attribute.Required & Attribute.Unique; - parent: Attribute.Relation< - 'plugin::upload.folder', - 'manyToOne', - 'plugin::upload.folder' - >; - children: Attribute.Relation< - 'plugin::upload.folder', - 'oneToMany', - 'plugin::upload.folder' - >; - files: Attribute.Relation< - 'plugin::upload.folder', - 'oneToMany', - 'plugin::upload.file' - >; - path: Attribute.String & - Attribute.Required & - Attribute.SetMinMax< + createdAt: Attribute.DateTime; + createdBy: Attribute.Relation<'api::page.page', 'oneToOne', 'admin::user'> & + Attribute.Private; + Description: Attribute.Text & Attribute.Required; + Enforcement_Actions_card: Attribute.RichText & + Attribute.CustomField< + 'plugin::ckeditor5.CKEditor', { - min: 1; - }, - number + preset: 'toolbar'; + } >; - createdAt: Attribute.DateTime; + External_card: Attribute.RichText & + Attribute.CustomField< + 'plugin::ckeditor5.CKEditor', + { + preset: 'toolbar'; + } + >; + Header_button: Attribute.Component<'page.scroll-button', true>; + Ongoing_card: Attribute.RichText & + Attribute.CustomField< + 'plugin::ckeditor5.CKEditor', + { + preset: 'toolbar'; + } + >; + publishedAt: Attribute.DateTime; + Related_card: Attribute.RichText & + Attribute.CustomField< + 'plugin::ckeditor5.CKEditor', + { + preset: 'toolbar'; + } + >; + route: Attribute.String & Attribute.Required; + Title: Attribute.String & Attribute.Required & Attribute.Unique; + tooltip: Attribute.Text; updatedAt: Attribute.DateTime; - createdBy: Attribute.Relation< - 'plugin::upload.folder', - 'oneToOne', - 'admin::user' - > & - Attribute.Private; - updatedBy: Attribute.Relation< - 'plugin::upload.folder', - 'oneToOne', - 'admin::user' - > & + updatedBy: Attribute.Relation<'api::page.page', 'oneToOne', 'admin::user'> & Attribute.Private; }; } @@ -494,9 +573,9 @@ export interface PluginUploadFolder extends Schema.CollectionType { export interface PluginContentReleasesRelease extends Schema.CollectionType { collectionName: 'strapi_releases'; info: { - singularName: 'release'; - pluralName: 'releases'; displayName: 'Release'; + pluralName: 'releases'; + singularName: 'release'; }; options: { draftAndPublish: false; @@ -510,27 +589,27 @@ export interface PluginContentReleasesRelease extends Schema.CollectionType { }; }; attributes: { - name: Attribute.String & Attribute.Required; - releasedAt: Attribute.DateTime; - scheduledAt: Attribute.DateTime; - timezone: Attribute.String; - status: Attribute.Enumeration< - ['ready', 'blocked', 'failed', 'done', 'empty'] - > & - Attribute.Required; actions: Attribute.Relation< 'plugin::content-releases.release', 'oneToMany', 'plugin::content-releases.release-action' >; createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< 'plugin::content-releases.release', 'oneToOne', 'admin::user' > & Attribute.Private; + name: Attribute.String & Attribute.Required; + releasedAt: Attribute.DateTime; + scheduledAt: Attribute.DateTime; + status: Attribute.Enumeration< + ['ready', 'blocked', 'failed', 'done', 'empty'] + > & + Attribute.Required; + timezone: Attribute.String; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< 'plugin::content-releases.release', 'oneToOne', @@ -544,9 +623,9 @@ export interface PluginContentReleasesReleaseAction extends Schema.CollectionType { collectionName: 'strapi_release_actions'; info: { - singularName: 'release-action'; - pluralName: 'release-actions'; displayName: 'Release Action'; + pluralName: 'release-actions'; + singularName: 'release-action'; }; options: { draftAndPublish: false; @@ -560,27 +639,27 @@ export interface PluginContentReleasesReleaseAction }; }; attributes: { - type: Attribute.Enumeration<['publish', 'unpublish']> & Attribute.Required; + contentType: Attribute.String & Attribute.Required; + createdAt: Attribute.DateTime; + createdBy: Attribute.Relation< + 'plugin::content-releases.release-action', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; entry: Attribute.Relation< 'plugin::content-releases.release-action', 'morphToOne' >; - contentType: Attribute.String & Attribute.Required; + isEntryValid: Attribute.Boolean; locale: Attribute.String; release: Attribute.Relation< 'plugin::content-releases.release-action', 'manyToOne', 'plugin::content-releases.release' >; - isEntryValid: Attribute.Boolean; - createdAt: Attribute.DateTime; + type: Attribute.Enumeration<['publish', 'unpublish']> & Attribute.Required; updatedAt: Attribute.DateTime; - createdBy: Attribute.Relation< - 'plugin::content-releases.release-action', - 'oneToOne', - 'admin::user' - > & - Attribute.Private; updatedBy: Attribute.Relation< 'plugin::content-releases.release-action', 'oneToOne', @@ -590,14 +669,14 @@ export interface PluginContentReleasesReleaseAction }; } -export interface PluginStrapiPluginSsoRoles extends Schema.CollectionType { - collectionName: 'strapi-plugin-sso_roles'; +export interface PluginI18NLocale extends Schema.CollectionType { + collectionName: 'i18n_locale'; info: { - singularName: 'roles'; - pluralName: 'sso-roles'; - collectionName: 'sso-roles'; - displayName: 'sso-role'; + collectionName: 'locales'; description: ''; + displayName: 'Locale'; + pluralName: 'locales'; + singularName: 'locale'; }; options: { draftAndPublish: false; @@ -611,18 +690,25 @@ export interface PluginStrapiPluginSsoRoles extends Schema.CollectionType { }; }; attributes: { - oauth_type: Attribute.String & Attribute.Required; - roles: Attribute.JSON; + code: Attribute.String & Attribute.Unique; createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'plugin::strapi-plugin-sso.roles', + 'plugin::i18n.locale', 'oneToOne', 'admin::user' > & Attribute.Private; + name: Attribute.String & + Attribute.SetMinMax< + { + max: 50; + min: 1; + }, + number + >; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< - 'plugin::strapi-plugin-sso.roles', + 'plugin::i18n.locale', 'oneToOne', 'admin::user' > & @@ -630,14 +716,14 @@ export interface PluginStrapiPluginSsoRoles extends Schema.CollectionType { }; } -export interface PluginI18NLocale extends Schema.CollectionType { - collectionName: 'i18n_locale'; +export interface PluginStrapiPluginSsoRoles extends Schema.CollectionType { + collectionName: 'strapi-plugin-sso_roles'; info: { - singularName: 'locale'; - pluralName: 'locales'; - collectionName: 'locales'; - displayName: 'Locale'; + collectionName: 'sso-roles'; description: ''; + displayName: 'sso-role'; + pluralName: 'sso-roles'; + singularName: 'roles'; }; options: { draftAndPublish: false; @@ -651,25 +737,18 @@ export interface PluginI18NLocale extends Schema.CollectionType { }; }; attributes: { - name: Attribute.String & - Attribute.SetMinMax< - { - min: 1; - max: 50; - }, - number - >; - code: Attribute.String & Attribute.Unique; createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'plugin::i18n.locale', + 'plugin::strapi-plugin-sso.roles', 'oneToOne', 'admin::user' > & Attribute.Private; + oauth_type: Attribute.String & Attribute.Required; + roles: Attribute.JSON; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< - 'plugin::i18n.locale', + 'plugin::strapi-plugin-sso.roles', 'oneToOne', 'admin::user' > & @@ -677,15 +756,13 @@ export interface PluginI18NLocale extends Schema.CollectionType { }; } -export interface PluginUsersPermissionsPermission - extends Schema.CollectionType { - collectionName: 'up_permissions'; +export interface PluginUploadFile extends Schema.CollectionType { + collectionName: 'files'; info: { - name: 'permission'; description: ''; - singularName: 'permission'; - pluralName: 'permissions'; - displayName: 'Permission'; + displayName: 'File'; + pluralName: 'files'; + singularName: 'file'; }; pluginOptions: { 'content-manager': { @@ -696,37 +773,59 @@ export interface PluginUsersPermissionsPermission }; }; attributes: { - action: Attribute.String & Attribute.Required; - role: Attribute.Relation< - 'plugin::users-permissions.permission', - 'manyToOne', - 'plugin::users-permissions.role' - >; + alternativeText: Attribute.String; + caption: Attribute.String; createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'plugin::users-permissions.permission', + 'plugin::upload.file', 'oneToOne', 'admin::user' > & Attribute.Private; + ext: Attribute.String; + folder: Attribute.Relation< + 'plugin::upload.file', + 'manyToOne', + 'plugin::upload.folder' + > & + Attribute.Private; + folderPath: Attribute.String & + Attribute.Required & + Attribute.Private & + Attribute.SetMinMax< + { + min: 1; + }, + number + >; + formats: Attribute.JSON; + hash: Attribute.String & Attribute.Required; + height: Attribute.Integer; + mime: Attribute.String & Attribute.Required; + name: Attribute.String & Attribute.Required; + previewUrl: Attribute.String; + provider: Attribute.String & Attribute.Required; + provider_metadata: Attribute.JSON; + related: Attribute.Relation<'plugin::upload.file', 'morphToMany'>; + size: Attribute.Decimal & Attribute.Required; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< - 'plugin::users-permissions.permission', + 'plugin::upload.file', 'oneToOne', 'admin::user' > & Attribute.Private; + url: Attribute.String & Attribute.Required; + width: Attribute.Integer; }; } -export interface PluginUsersPermissionsRole extends Schema.CollectionType { - collectionName: 'up_roles'; +export interface PluginUploadFolder extends Schema.CollectionType { + collectionName: 'upload_folders'; info: { - name: 'role'; - description: ''; - singularName: 'role'; - pluralName: 'roles'; - displayName: 'Role'; + displayName: 'Folder'; + pluralName: 'folders'; + singularName: 'folder'; }; pluginOptions: { 'content-manager': { @@ -737,90 +836,48 @@ export interface PluginUsersPermissionsRole extends Schema.CollectionType { }; }; attributes: { - name: Attribute.String & - Attribute.Required & - Attribute.SetMinMaxLength<{ - minLength: 3; - }>; - description: Attribute.String; - type: Attribute.String & Attribute.Unique; - permissions: Attribute.Relation< - 'plugin::users-permissions.role', - 'oneToMany', - 'plugin::users-permissions.permission' - >; - users: Attribute.Relation< - 'plugin::users-permissions.role', + children: Attribute.Relation< + 'plugin::upload.folder', 'oneToMany', - 'plugin::users-permissions.user' + 'plugin::upload.folder' >; createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'plugin::users-permissions.role', - 'oneToOne', - 'admin::user' - > & - Attribute.Private; - updatedBy: Attribute.Relation< - 'plugin::users-permissions.role', + 'plugin::upload.folder', 'oneToOne', 'admin::user' > & Attribute.Private; - }; -} - -export interface PluginUsersPermissionsUser extends Schema.CollectionType { - collectionName: 'up_users'; - info: { - name: 'user'; - description: ''; - singularName: 'user'; - pluralName: 'users'; - displayName: 'User'; - }; - options: { - draftAndPublish: false; - timestamps: true; - }; - attributes: { - username: Attribute.String & - Attribute.Required & - Attribute.Unique & - Attribute.SetMinMaxLength<{ - minLength: 3; - }>; - email: Attribute.Email & + files: Attribute.Relation< + 'plugin::upload.folder', + 'oneToMany', + 'plugin::upload.file' + >; + name: Attribute.String & Attribute.Required & - Attribute.SetMinMaxLength<{ - minLength: 6; - }>; - provider: Attribute.String; - password: Attribute.Password & - Attribute.Private & - Attribute.SetMinMaxLength<{ - minLength: 6; - }>; - resetPasswordToken: Attribute.String & Attribute.Private; - confirmationToken: Attribute.String & Attribute.Private; - confirmed: Attribute.Boolean & Attribute.DefaultTo; - blocked: Attribute.Boolean & Attribute.DefaultTo; - role: Attribute.Relation< - 'plugin::users-permissions.user', + Attribute.SetMinMax< + { + min: 1; + }, + number + >; + parent: Attribute.Relation< + 'plugin::upload.folder', 'manyToOne', - 'plugin::users-permissions.role' + 'plugin::upload.folder' >; - createdAt: Attribute.DateTime; + path: Attribute.String & + Attribute.Required & + Attribute.SetMinMax< + { + min: 1; + }, + number + >; + pathId: Attribute.Integer & Attribute.Required & Attribute.Unique; updatedAt: Attribute.DateTime; - createdBy: Attribute.Relation< - 'plugin::users-permissions.user', - 'oneToOne', - 'admin::user' - > & - Attribute.Private; updatedBy: Attribute.Relation< - 'plugin::users-permissions.user', + 'plugin::upload.folder', 'oneToOne', 'admin::user' > & @@ -828,29 +885,41 @@ export interface PluginUsersPermissionsUser extends Schema.CollectionType { }; } -export interface ApiFastFactFastFact extends Schema.CollectionType { - collectionName: 'fast_facts'; +export interface PluginUsersPermissionsPermission + extends Schema.CollectionType { + collectionName: 'up_permissions'; info: { - singularName: 'fast-fact'; - pluralName: 'fast-facts'; - displayName: 'Fast Facts'; + description: ''; + displayName: 'Permission'; + name: 'permission'; + pluralName: 'permissions'; + singularName: 'permission'; }; - options: { - draftAndPublish: false; + pluginOptions: { + 'content-manager': { + visible: false; + }; + 'content-type-builder': { + visible: false; + }; }; attributes: { - value: Attribute.String; - description: Attribute.String; + action: Attribute.String & Attribute.Required; createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'api::fast-fact.fast-fact', + 'plugin::users-permissions.permission', 'oneToOne', 'admin::user' > & Attribute.Private; + role: Attribute.Relation< + 'plugin::users-permissions.permission', + 'manyToOne', + 'plugin::users-permissions.role' + >; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< - 'api::fast-fact.fast-fact', + 'plugin::users-permissions.permission', 'oneToOne', 'admin::user' > & @@ -858,201 +927,139 @@ export interface ApiFastFactFastFact extends Schema.CollectionType { }; } -export interface ApiFooterFooter extends Schema.SingleType { - collectionName: 'footers'; +export interface PluginUsersPermissionsRole extends Schema.CollectionType { + collectionName: 'up_roles'; info: { - singularName: 'footer'; - pluralName: 'footers'; - displayName: 'Footer'; description: ''; + displayName: 'Role'; + name: 'role'; + pluralName: 'roles'; + singularName: 'role'; }; - options: { - draftAndPublish: true; + pluginOptions: { + 'content-manager': { + visible: false; + }; + 'content-type-builder': { + visible: false; + }; }; attributes: { - About_title: Attribute.String; - Connect_description: Attribute.RichText & - Attribute.CustomField< - 'plugin::ckeditor5.CKEditor', - { - preset: 'toolbar'; - } - >; - Connect_title: Attribute.String; - About_description: Attribute.RichText & - Attribute.CustomField< - 'plugin::ckeditor5.CKEditor', - { - preset: 'toolbar'; - } - >; createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; - publishedAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'api::footer.footer', + 'plugin::users-permissions.role', 'oneToOne', 'admin::user' > & Attribute.Private; + description: Attribute.String; + name: Attribute.String & + Attribute.Required & + Attribute.SetMinMaxLength<{ + minLength: 3; + }>; + permissions: Attribute.Relation< + 'plugin::users-permissions.role', + 'oneToMany', + 'plugin::users-permissions.permission' + >; + type: Attribute.String & Attribute.Unique; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< - 'api::footer.footer', + 'plugin::users-permissions.role', 'oneToOne', 'admin::user' > & Attribute.Private; + users: Attribute.Relation< + 'plugin::users-permissions.role', + 'oneToMany', + 'plugin::users-permissions.user' + >; }; } -export interface ApiHomeHome extends Schema.SingleType { - collectionName: 'homes'; - info: { - singularName: 'home'; - pluralName: 'homes'; - displayName: 'Home'; - }; - options: { - draftAndPublish: true; - }; - attributes: { - Title: Attribute.String; - Description: Attribute.Text; - About: Attribute.RichText; - Mining_blocks: Attribute.Component<'page.feature-block', true>; - Processes_blocks: Attribute.Component<'page.feature-block', true>; - createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; - publishedAt: Attribute.DateTime; - createdBy: Attribute.Relation<'api::home.home', 'oneToOne', 'admin::user'> & - Attribute.Private; - updatedBy: Attribute.Relation<'api::home.home', 'oneToOne', 'admin::user'> & - Attribute.Private; - }; -} - -export interface ApiNavigationNavigation extends Schema.CollectionType { - collectionName: 'navigations'; +export interface PluginUsersPermissionsUser extends Schema.CollectionType { + collectionName: 'up_users'; info: { - singularName: 'navigation'; - pluralName: 'navigations'; - displayName: 'Navigation'; description: ''; + displayName: 'User'; + name: 'user'; + pluralName: 'users'; + singularName: 'user'; }; options: { draftAndPublish: false; + timestamps: true; }; attributes: { - Heading: Attribute.String; - pages: Attribute.Relation< - 'api::navigation.navigation', - 'oneToMany', - 'api::page.page' - >; - Short_heading: Attribute.String; + blocked: Attribute.Boolean & Attribute.DefaultTo; + confirmationToken: Attribute.String & Attribute.Private; + confirmed: Attribute.Boolean & Attribute.DefaultTo; createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< - 'api::navigation.navigation', + 'plugin::users-permissions.user', 'oneToOne', 'admin::user' > & Attribute.Private; + email: Attribute.Email & + Attribute.Required & + Attribute.SetMinMaxLength<{ + minLength: 6; + }>; + password: Attribute.Password & + Attribute.Private & + Attribute.SetMinMaxLength<{ + minLength: 6; + }>; + provider: Attribute.String; + resetPasswordToken: Attribute.String & Attribute.Private; + role: Attribute.Relation< + 'plugin::users-permissions.user', + 'manyToOne', + 'plugin::users-permissions.role' + >; + updatedAt: Attribute.DateTime; updatedBy: Attribute.Relation< - 'api::navigation.navigation', + 'plugin::users-permissions.user', 'oneToOne', 'admin::user' > & Attribute.Private; - }; -} - -export interface ApiPagePage extends Schema.CollectionType { - collectionName: 'pages'; - info: { - singularName: 'page'; - pluralName: 'pages'; - displayName: 'Page'; - description: ''; - }; - options: { - draftAndPublish: true; - }; - attributes: { - Title: Attribute.String & Attribute.Required & Attribute.Unique; - Description: Attribute.Text & Attribute.Required; - Content: Attribute.RichText & + username: Attribute.String & Attribute.Required & - Attribute.CustomField< - 'plugin::ckeditor5.CKEditor', - { - preset: 'toolbar'; - } - >; - Ongoing_card: Attribute.RichText & - Attribute.CustomField< - 'plugin::ckeditor5.CKEditor', - { - preset: 'toolbar'; - } - >; - External_card: Attribute.RichText & - Attribute.CustomField< - 'plugin::ckeditor5.CKEditor', - { - preset: 'toolbar'; - } - >; - Related_card: Attribute.RichText & - Attribute.CustomField< - 'plugin::ckeditor5.CKEditor', - { - preset: 'toolbar'; - } - >; - route: Attribute.String & Attribute.Required; - tooltip: Attribute.Text; - Enforcement_Actions_card: Attribute.RichText & - Attribute.CustomField< - 'plugin::ckeditor5.CKEditor', - { - preset: 'toolbar'; - } - >; - Header_button: Attribute.Component<'page.scroll-button', true>; - createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; - publishedAt: Attribute.DateTime; - createdBy: Attribute.Relation<'api::page.page', 'oneToOne', 'admin::user'> & - Attribute.Private; - updatedBy: Attribute.Relation<'api::page.page', 'oneToOne', 'admin::user'> & - Attribute.Private; + Attribute.Unique & + Attribute.SetMinMaxLength<{ + minLength: 3; + }>; }; } declare module '@strapi/types' { export module Shared { export interface ContentTypes { - 'admin::permission': AdminPermission; - 'admin::user': AdminUser; - 'admin::role': AdminRole; 'admin::api-token': AdminApiToken; 'admin::api-token-permission': AdminApiTokenPermission; + 'admin::permission': AdminPermission; + 'admin::role': AdminRole; 'admin::transfer-token': AdminTransferToken; 'admin::transfer-token-permission': AdminTransferTokenPermission; - 'plugin::upload.file': PluginUploadFile; - 'plugin::upload.folder': PluginUploadFolder; + 'admin::user': AdminUser; + 'api::fast-fact.fast-fact': ApiFastFactFastFact; + 'api::footer.footer': ApiFooterFooter; + 'api::home.home': ApiHomeHome; + 'api::navigation.navigation': ApiNavigationNavigation; + 'api::page.page': ApiPagePage; 'plugin::content-releases.release': PluginContentReleasesRelease; 'plugin::content-releases.release-action': PluginContentReleasesReleaseAction; - 'plugin::strapi-plugin-sso.roles': PluginStrapiPluginSsoRoles; 'plugin::i18n.locale': PluginI18NLocale; + 'plugin::strapi-plugin-sso.roles': PluginStrapiPluginSsoRoles; + 'plugin::upload.file': PluginUploadFile; + 'plugin::upload.folder': PluginUploadFolder; 'plugin::users-permissions.permission': PluginUsersPermissionsPermission; 'plugin::users-permissions.role': PluginUsersPermissionsRole; 'plugin::users-permissions.user': PluginUsersPermissionsUser; - 'api::fast-fact.fast-fact': ApiFastFactFastFact; - 'api::footer.footer': ApiFooterFooter; - 'api::home.home': ApiHomeHome; - 'api::navigation.navigation': ApiNavigationNavigation; - 'api::page.page': ApiPagePage; } } } diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index 80188b0..d9bf0eb 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -45,8 +45,12 @@ export class AppComponent implements OnInit, AfterViewInit { private configService: ConfigService, private router: Router) { if(configService.globalContent){ - this.footer = configService.globalContent.footer?.data.attributes; - this.navigation = configService.globalContent.navigations?.data; + if(configService.globalContent.footer && configService.globalContent.footer.data){ + this.footer = configService.globalContent.footer?.data.attributes; + } + if(configService.globalContent.navigations && configService.globalContent.navigations.data){ + this.navigation = configService.globalContent.navigations?.data; + } } this.router.events.subscribe((event: Event) => { switch (true) { diff --git a/frontend/src/app/app.routes.ts b/frontend/src/app/app.routes.ts index 9f1e661..e8d5ed2 100644 --- a/frontend/src/app/app.routes.ts +++ b/frontend/src/app/app.routes.ts @@ -3,12 +3,14 @@ import { Routes, RouterModule } from '@angular/router'; import { HomeComponent } from './home/home.component'; import { MainMapComponent } from './map/main-map/main-map.component'; import { NotFoundComponent } from './not-found/not-found.component'; +import { HomeResolver } from './services/home-resolver'; export const routes: Routes = [ { path: '', - component: HomeComponent - }, + component: HomeComponent, + resolve: {homeData: HomeResolver}, + }, { path: 'map', component: MainMapComponent diff --git a/frontend/src/app/graphql.module.ts b/frontend/src/app/graphql.module.ts index 5906b8d..456ec6c 100644 --- a/frontend/src/app/graphql.module.ts +++ b/frontend/src/app/graphql.module.ts @@ -2,7 +2,6 @@ import { APOLLO_OPTIONS, ApolloModule } from 'apollo-angular'; import { HttpLink } from 'apollo-angular/http'; import { NgModule } from '@angular/core'; import { ApolloClientOptions, InMemoryCache } from '@apollo/client/core'; -import { environment } from 'environments/environment'; const uri = "/graphql" export function createApollo(httpLink: HttpLink): ApolloClientOptions { diff --git a/frontend/src/app/home/home.component.html b/frontend/src/app/home/home.component.html index e436538..22f34ec 100644 --- a/frontend/src/app/home/home.component.html +++ b/frontend/src/app/home/home.component.html @@ -1,10 +1,9 @@
-
-

British Columbia Mine Information

-

Mining is one of British Columbia’s oldest and most dynamic industries. The Province of British Columbia is committed - to continuing to provide effective oversight of this important sector.

+
+

{{homeData.Title}}

+

{{homeData.Description}}

Find Mines in British Columbia... listView List @@ -19,35 +18,21 @@

British Columbia Mine Information

+
-
-
-

About BC Mine Information

-

The Ministry of Energy, Mines, and Low Carbon Innovation (EMLI), Ministry of Environment and Climate Change Strategy (ENV) and Environmental Assessment Office (EAO) have collaborated to make information on the Province’s oversight of major mines in British Columbia more accessible than ever before.

-

This is the first time mine-related information from all three agencies has been made available online in one place, and more information will be added on an ongoing basis.

-

This site currently profiles {{numProjects}} major mines across the province. Information on these mines will be continually added to the website, and other permitted major mines in BC will be added in the coming months.

-
+ +
+
-
+ +

Fast Facts about the Mining Industry in British Columbia

-
    -
  • -
    - $16.6B - 2023 production value [Natural Resources Canada] -
    -
  • +
    • - $643.5M - 2023 Industry Mineral Exploration Spending [British Columbia Geological Survey] -
      -
    • -
    • -
      - 9 - Number of environmental assessment applications for mining projects in progress [EPIC] + {{facts.value}} + {{facts.description}}
    @@ -56,24 +41,20 @@

    Fast Facts about the Mining Industry in British Columbia

-
+ +

Mining in British Columbia

-
-
-

The Mining Lifecycle

-

It can take decades to develop a deposit into a mine, which in turn can operate for decades

- Learn More -
-
-
-
-

Topics of Interest

-

Profiling key topics of interest regarding mining activities in British Columbia

- Learn More + +
+
+

{{block.Title}}

+

{{block.Description}}

+ Learn More +
-
+

Find Mines in B.C.

@@ -87,31 +68,19 @@

Find Mines in B.C.

-
+

Our Processes & Procedures

-
-
-

Legislation

-

Learn about the key statutes and regulations that apply to mining activities in the province of British Columbia.

- Learn More + +
+
+

{{block.Title}}

+

{{block.Description}}

+ Learn More +
-
-
-
-

Authorizations

-

Environmental assessment certificates and permits issued under the Mines Act and Environmental Management Act

- Learn More -
-
-
-
-

Compliance Oversight

-

Several provincial agencies work together to provide integrated oversight of British Columbia’s mining sector

- Learn More -
-
+
diff --git a/frontend/src/app/home/home.component.ts b/frontend/src/app/home/home.component.ts index 16a71ae..c727402 100644 --- a/frontend/src/app/home/home.component.ts +++ b/frontend/src/app/home/home.component.ts @@ -2,6 +2,9 @@ import { Component, OnInit } from '@angular/core'; import { ProjectService } from '@services/project.service'; import { Api } from '@services/api'; import { LoggerService } from '@services/logger.service'; +import { ActivatedRoute } from '@angular/router'; +import { Home } from '@app/models/content/home'; +import { FastFact } from '@app/models/content/fast-fact'; @Component({ selector: 'app-home', @@ -11,9 +14,14 @@ import { LoggerService } from '@services/logger.service'; export class HomeComponent implements OnInit { numProjects: number; hostname: string; + homeData: Home; + fastFacts: FastFact[]; + constructor( private projectService: ProjectService, - private api: Api, - private logger: LoggerService) { } + private activatedRoute: ActivatedRoute, + private api: Api, + private logger: LoggerService) + { } ngOnInit() { this.projectService.getAll().subscribe( @@ -22,5 +30,11 @@ export class HomeComponent implements OnInit { ); this.hostname = this.api.hostnameNRPTI; window.scrollTo(0, 0); + + this.activatedRoute.data.subscribe((response: any) => { + this.homeData = response.homeData.home; + this.fastFacts = response.homeData.facts; + console.log(response); + }); } } diff --git a/frontend/src/app/models/content/fast-fact.ts b/frontend/src/app/models/content/fast-fact.ts new file mode 100644 index 0000000..6952638 --- /dev/null +++ b/frontend/src/app/models/content/fast-fact.ts @@ -0,0 +1,4 @@ +export class FastFact{ + description: string + value: string +} \ No newline at end of file diff --git a/frontend/src/app/models/content/feature-block.ts b/frontend/src/app/models/content/feature-block.ts new file mode 100644 index 0000000..c09c0bd --- /dev/null +++ b/frontend/src/app/models/content/feature-block.ts @@ -0,0 +1,7 @@ +import { Page } from "./page"; + +export class FeatureBlock { + Title: string; + Description: string; + page: {"data":{"attributes": Page}} +} \ No newline at end of file diff --git a/frontend/src/app/models/content/header_button.ts b/frontend/src/app/models/content/header-button.ts similarity index 59% rename from frontend/src/app/models/content/header_button.ts rename to frontend/src/app/models/content/header-button.ts index 1d88a19..8d70da0 100644 --- a/frontend/src/app/models/content/header_button.ts +++ b/frontend/src/app/models/content/header-button.ts @@ -1,4 +1,4 @@ -export class Header_Button { +export class HeaderButton { Text: string; Section_id: string; } \ No newline at end of file diff --git a/frontend/src/app/models/content/home-response.ts b/frontend/src/app/models/content/home-response.ts new file mode 100644 index 0000000..8666bdd --- /dev/null +++ b/frontend/src/app/models/content/home-response.ts @@ -0,0 +1,15 @@ +import { FastFact } from "./fast-fact"; +import { Home } from "./home"; + +export class HomeResponse{ + home: Home + facts: FastFact[] + + constructor(){ + //Loads defaults incase the CMS fails to load + this.home = new Home(); + this.home.Title = "British Columbia Mine Information" + this.home.Description = "Mining is one of British Columbia’s oldest and most dynamic industries. The Province of British Columbia is committed to continuing to provide effective oversight of this important sector." + this.home.About = '

About BC Mine Information

The Ministry of Energy, Mines, and Low Carbon Innovation (EMLI), Ministry of Environment and Climate Change Strategy (ENV) and Environmental Assessment Office (EAO) have collaborated to make information on the Province’s oversight of major mines in British Columbia more accessible than ever before.

This is the first time mine-related information from all three agencies has been made available online in one place, and more information will be added on an ongoing basis.

This site currently profiles 78 major mines across the province. Information on these mines will be continually added to the website, and other permitted major mines in BC will be added in the coming months.

' + } +} \ No newline at end of file diff --git a/frontend/src/app/models/content/home.ts b/frontend/src/app/models/content/home.ts new file mode 100644 index 0000000..afa20bc --- /dev/null +++ b/frontend/src/app/models/content/home.ts @@ -0,0 +1,11 @@ +import { FeatureBlock } from "./feature-block" + +// When adding new properties to this class, edit the query in /src/app/services/content-resolver.ts to include the new property +export class Home { + Title: string + Description: string + About: string + Mining_blocks: FeatureBlock[] + Processes_blocks: FeatureBlock[] + } + \ No newline at end of file diff --git a/frontend/src/app/models/content/page.ts b/frontend/src/app/models/content/page.ts index f455cda..779f7fc 100644 --- a/frontend/src/app/models/content/page.ts +++ b/frontend/src/app/models/content/page.ts @@ -1,10 +1,10 @@ -import { Header_Button } from "./header_button" +import { HeaderButton } from "./header-button" // When adding new properties to this class, edit the query in /src/app/services/content-resolver.ts to include the new property export class Page { Title: string Description: string - Header_button: Header_Button[] // strapi doesn't allow renaming :( I wish I could add an s + Header_button: HeaderButton[] // strapi doesn't allow renaming :( I wish I could add an s Content: string // If you're adding a new sidecard variable, please add it to the isTwoColumn conditional as well! Ongoing_card: string diff --git a/frontend/src/app/models/home.ts b/frontend/src/app/models/home.ts deleted file mode 100644 index 5af9a84..0000000 --- a/frontend/src/app/models/home.ts +++ /dev/null @@ -1,3 +0,0 @@ -export class Home { - -} diff --git a/frontend/src/app/page/page.component.ts b/frontend/src/app/page/page.component.ts index 8abac66..f3d14b7 100644 --- a/frontend/src/app/page/page.component.ts +++ b/frontend/src/app/page/page.component.ts @@ -1,7 +1,6 @@ import { afterRender, Component, OnInit, ViewEncapsulation } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Page } from '../models/content/page'; -import { SafeHtmlPipe } from '@app/pipes/safe-html.pipe'; @Component({ selector: 'app-page', diff --git a/frontend/src/app/services/content-resolver.ts b/frontend/src/app/services/content-resolver.ts index 25ba7f3..e0693bf 100644 --- a/frontend/src/app/services/content-resolver.ts +++ b/frontend/src/app/services/content-resolver.ts @@ -13,30 +13,30 @@ export class ContentResolver implements Resolve { private getPage = function(route){ - // When adding new properties to the Page class, edit this query - return gql` - { - pageByRoute(route: "${route}") { - data{ - attributes{ - Title, - Description - Header_button{ - Text - Section_id + // When adding new properties to the Page class, edit this query + return gql` + { + pageByRoute(route: "${route}") { + data{ + attributes{ + Title, + Description + Header_button{ + Text + Section_id + } + Content + Ongoing_card + External_card + Related_card + Enforcement_Actions_card + route + tooltip } - Content - Ongoing_card - External_card - Related_card - Enforcement_Actions_card - route - tooltip } } } - } - `; + `; } resolve(route: ActivatedRouteSnapshot): Observable { diff --git a/frontend/src/app/services/home-resolver.ts b/frontend/src/app/services/home-resolver.ts new file mode 100644 index 0000000..e703e66 --- /dev/null +++ b/frontend/src/app/services/home-resolver.ts @@ -0,0 +1,80 @@ +import { Injectable } from '@angular/core'; +import { Resolve } from '@angular/router'; +import { Observable, catchError, map, of } from 'rxjs'; +import { Apollo, gql } from 'apollo-angular'; +import { Home } from '@app/models/content/home'; +import { FastFact} from '@app/models/content/fast-fact' +import { HomeResponse } from '@app/models/content/home-response'; + +@Injectable({ + providedIn: 'root' +}) +export class HomeResolver implements Resolve { + + constructor(private readonly apollo: Apollo){} + + private getHome = function(){ + + // When adding new properties to the Page class, edit this query + return gql` + { + home { + data { + attributes { + Title, + Description, + About, + Mining_blocks { + Title, + Description, + page { + data { + attributes { + route + } + } + } + } + Processes_blocks { + Title, + Description, + page { + data { + attributes { + route + } + } + } + } + } + } + } + fastFacts{ + data{ + attributes{ + description, + value + } + } + } + }`; + } + + resolve(): Observable { + // Return an Observable that represents the GraphQL request to execute before the route is activated. + return this.apollo.watchQuery({ + query: this.getHome() + }) + .valueChanges.pipe(map(result => { + return { + home: result.data?.home.data.attributes as Home, + facts: result.data?.fastFacts.data.map(fact => fact.attributes) as FastFact[] + } + }), + catchError(error => { + //Failed to fetch content for HomePage from CMS. Fallback to hard coded defaults. + console.error(error); + return of(new HomeResponse()); + })) + } +}