From 09b47634ec8d5ddfdfbc57341023a748bf60fd11 Mon Sep 17 00:00:00 2001 From: Anton Kovalchuck Date: Tue, 20 May 2025 17:03:26 +0300 Subject: [PATCH 1/2] Connected tags to category --- .../case-studies-page/views/index.html | 30 +++++-- .../modules/case-studies-page/views/show.html | 30 +++++-- website/modules/case-studies/index.js | 90 ++++++++++++++++--- website/modules/cases-tags/index.js | 7 ++ website/modules/categories/index.js | 35 +++++++- 5 files changed, 164 insertions(+), 28 deletions(-) diff --git a/website/modules/case-studies-page/views/index.html b/website/modules/case-studies-page/views/index.html index c293c331..c2998e67 100644 --- a/website/modules/case-studies-page/views/index.html +++ b/website/modules/case-studies-page/views/index.html @@ -85,18 +85,34 @@ {% endif %}

{{ article.title }}

-
{{ article.caseStudyType }}
-
{{ article.industry }}
+
+ {% if article._caseStudyType.length %} + {% for type in article._caseStudyType %} + {{ type.title }}{% if not loop.last %}, {% endif %} + {% endfor %} + {% endif %} +
+
+ {% if article._industry.length %} + {% for industry in article._industry %} + {{ industry.title }}{% if not loop.last %}, {% endif %} + {% endfor %} + {% endif %} +
{% if article.portfolioTitle %}

{{ article.portfolioTitle }}

- {% endif %} {% if article.stack %} - -
{{ article.stack }}
- - {% endif %} + {% endif %} + +
+ {% if article._stack.length %} + {% for tech in article._stack %} + {{ tech.title }}{% if not loop.last %}, {% endif %} + {% endfor %} + {% endif %} +
{# CARD END: {{ article.title }} #} {% endfor %} diff --git a/website/modules/case-studies-page/views/show.html b/website/modules/case-studies-page/views/show.html index 5ccc4268..3d364079 100644 --- a/website/modules/case-studies-page/views/show.html +++ b/website/modules/case-studies-page/views/show.html @@ -39,14 +39,25 @@

{{ data.piece.title }}

class="client-website-link" >{{ data.piece.clientWebsite }} - {% endif %} {% if data.piece.industry %} -
{{ data.piece.industry }}
- {% endif %} {% if data.piece.portfolioTitle %} + {% endif %} + {% if data.piece._industry.length %} +
+ {% for industry in data.piece._industry %} + {{ industry.title }}{% if not loop.last %}, {% endif %} + {% endfor %} +
+ {% endif %} + {% if data.piece.portfolioTitle %}

{{ data.piece.portfolioTitle }}

{% endif %} {% if data.piece.descriptor %}

{{ data.piece.descriptor }}

- {% endif %} {% if data.piece.caseStudyType %} -
{{ data.piece.caseStudyType }}
+ {% endif %} + {% if data.piece._caseStudyType.length %} +
+ {% for type in data.piece._caseStudyType %} + {{ type.title }}{% if not loop.last %}, {% endif %} + {% endfor %} +
{% endif %} @@ -82,10 +93,15 @@

Solution

Results

{{ data.piece.results }}

- {% endif %} {% if data.piece.stack %} + {% endif %} + {% if data.piece._stack.length %}

Tech stack

-

{{ data.piece.stack }}

+

+ {% for tech in data.piece._stack %} + {{ tech.title }}{% if not loop.last %}, {% endif %} + {% endfor %} +

{% endif %} diff --git a/website/modules/case-studies/index.js b/website/modules/case-studies/index.js index a9a4855d..b020c84f 100644 --- a/website/modules/case-studies/index.js +++ b/website/modules/case-studies/index.js @@ -37,23 +37,86 @@ module.exports = { }, }, }, - stack: { + _stack: { label: 'Tech Stack', - type: 'string', - help: 'Comma separated tags indicating the technologies utilized in the project.', + type: 'relationship', + withType: 'cases-tags', required: true, + builders: { + project: { + 'title': 1, + '_category.title': 1, + }, + }, + withRelationships: ['_category'], + browser: { + projection: { + 'title': 1, + '_category._id': 1, + '_category.title': 1, + }, + filters: [ + { + field: '_category.title', + value: 'Technology', + }, + ], + }, + help: 'Select technologies utilized in the project.', }, - caseStudyType: { + _caseStudyType: { label: 'Case Study Type', - type: 'string', - help: 'The nature of the project identifying the projectʼs scope and requirements, relationship, or key characteristics (e.g., Mobile Development, Product Enhancement, ML/AI).', + type: 'relationship', + withType: 'cases-tags', required: true, + builders: { + project: { + 'title': 1, + '_category.title': 1, + }, + }, + withRelationships: ['_category'], + browser: { + projection: { + 'title': 1, + '_category._id': 1, + '_category.title': 1, + }, + filters: [ + { + field: '_category.title', + value: 'Case Study Type', + }, + ], + }, + help: 'The nature of the project identifying the projectʼs scope and requirements, relationship, or key characteristics.', }, - industry: { + _industry: { label: 'Industry', - type: 'string', - help: "Comma seperated tags representing the client's industry or sector (e.g. Financial Services, Healthcare, Retail & E-commerce).", + type: 'relationship', + withType: 'cases-tags', required: true, + builders: { + project: { + 'title': 1, + '_category.title': 1, + }, + }, + withRelationships: ['_category'], + browser: { + projection: { + 'title': 1, + '_category._id': 1, + '_category.title': 1, + }, + filters: [ + { + field: '_category.title', + value: 'Industry', + }, + ], + }, + help: "Select client's industry or sector.", }, portfolioTitle: { label: 'Portfolio Title', @@ -136,9 +199,9 @@ module.exports = { 'title', 'clientWebsite', 'picture', - 'stack', - 'caseStudyType', - 'industry', + '_stack', + '_caseStudyType', + '_industry', 'portfolioTitle', 'descriptor', 'prodLink', @@ -157,8 +220,9 @@ module.exports = { }, columns: { add: { - stack: { + _stack: { label: 'Tech Stack', + component: 'AposCellTags', }, _tags: { label: 'Tags', diff --git a/website/modules/cases-tags/index.js b/website/modules/cases-tags/index.js index 3905db3f..9204766c 100644 --- a/website/modules/cases-tags/index.js +++ b/website/modules/cases-tags/index.js @@ -43,4 +43,11 @@ module.exports = { }, }, }, + filters: { + add: { + _category: { + label: 'Category', + }, + }, + }, }; diff --git a/website/modules/categories/index.js b/website/modules/categories/index.js index 03e3202c..e09110e9 100644 --- a/website/modules/categories/index.js +++ b/website/modules/categories/index.js @@ -10,11 +10,44 @@ module.exports = { type: 'string', label: 'Description', }, + categoryType: { + type: 'select', + label: 'Category Type', + required: true, + choices: [ + { + label: 'Technology', + value: 'Technology', + }, + { + label: 'Case Study Type', + value: 'Case Study Type', + }, + { + label: 'Industry', + value: 'Industry', + }, + ], + }, }, group: { basics: { label: 'Basics', - fields: ['title', 'description'], + fields: ['title', 'description', 'categoryType'], + }, + }, + }, + columns: { + add: { + categoryType: { + label: 'Category Type', + }, + }, + }, + filters: { + add: { + categoryType: { + label: 'Category Type', }, }, }, From a5ab2bfd3dab76f33db1e7d1bb132c082424c928 Mon Sep 17 00:00:00 2001 From: Anton Kovalchuck Date: Tue, 20 May 2025 22:20:14 +0300 Subject: [PATCH 2/2] Removed unnecessary category type --- website/modules/categories/index.js | 35 +---------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/website/modules/categories/index.js b/website/modules/categories/index.js index e09110e9..03e3202c 100644 --- a/website/modules/categories/index.js +++ b/website/modules/categories/index.js @@ -10,44 +10,11 @@ module.exports = { type: 'string', label: 'Description', }, - categoryType: { - type: 'select', - label: 'Category Type', - required: true, - choices: [ - { - label: 'Technology', - value: 'Technology', - }, - { - label: 'Case Study Type', - value: 'Case Study Type', - }, - { - label: 'Industry', - value: 'Industry', - }, - ], - }, }, group: { basics: { label: 'Basics', - fields: ['title', 'description', 'categoryType'], - }, - }, - }, - columns: { - add: { - categoryType: { - label: 'Category Type', - }, - }, - }, - filters: { - add: { - categoryType: { - label: 'Category Type', + fields: ['title', 'description'], }, }, },