Skip to content

Commit

Permalink
feat(cms): Add order attribute to Sub-Topic and Dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprdhomme committed Nov 22, 2024
1 parent 5060101 commit dd90257
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 32 deletions.
10 changes: 10 additions & 0 deletions client/src/types/generated/strapi.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ export interface SubTopic {
createdAt?: string;
createdBy?: SubTopicCreatedBy;
name: string;
order?: number;
updatedAt?: string;
updatedBy?: SubTopicUpdatedBy;
}
Expand Down Expand Up @@ -763,6 +764,7 @@ export interface SubTopicListResponse {

export type SubTopicRequestData = {
name: string;
order?: number;
};

export interface SubTopicRequest {
Expand Down Expand Up @@ -1173,6 +1175,7 @@ export type LayerDatasetDataAttributes = {
layers?: LayerDatasetDataAttributesLayers;
metadata?: LayerDatasetDataAttributesMetadata;
name?: string;
order?: number;
short_description?: string;
sub_topic?: LayerDatasetDataAttributesSubTopic;
topic?: LayerDatasetDataAttributesTopic;
Expand Down Expand Up @@ -1266,6 +1269,7 @@ export type LayerDatasetDataAttributesSubTopicDataAttributes = {
createdAt?: string;
createdBy?: LayerDatasetDataAttributesSubTopicDataAttributesCreatedBy;
name?: string;
order?: number;
updatedAt?: string;
updatedBy?: LayerDatasetDataAttributesSubTopicDataAttributesUpdatedBy;
};
Expand Down Expand Up @@ -1700,6 +1704,7 @@ export interface Dataset {
layers?: DatasetLayers;
metadata?: MetadataItemComponent;
name: string;
order?: number;
short_description?: string;
sub_topic?: DatasetSubTopic;
topic?: DatasetTopic;
Expand Down Expand Up @@ -1824,6 +1829,7 @@ export type DatasetLayersDataItemAttributesDatasetDataAttributes = {
layers?: DatasetLayersDataItemAttributesDatasetDataAttributesLayers;
metadata?: DatasetLayersDataItemAttributesDatasetDataAttributesMetadata;
name?: string;
order?: number;
short_description?: string;
sub_topic?: DatasetLayersDataItemAttributesDatasetDataAttributesSubTopic;
topic?: DatasetLayersDataItemAttributesDatasetDataAttributesTopic;
Expand Down Expand Up @@ -2041,6 +2047,7 @@ export type DatasetLayersDataItemAttributesDatasetDataAttributesSubTopicDataAttr
createdAt?: string;
createdBy?: DatasetLayersDataItemAttributesDatasetDataAttributesSubTopicDataAttributesCreatedBy;
name?: string;
order?: number;
updatedAt?: string;
updatedBy?: DatasetLayersDataItemAttributesDatasetDataAttributesSubTopicDataAttributesUpdatedBy;
};
Expand Down Expand Up @@ -2245,6 +2252,7 @@ export type DatasetRequestData = {
layers?: DatasetRequestDataLayersItem[];
metadata?: MetadataItemComponent;
name: string;
order?: number;
short_description?: string;
sub_topic?: DatasetRequestDataSubTopic;
topic?: DatasetRequestDataTopic;
Expand Down Expand Up @@ -2368,6 +2376,7 @@ export type ChartDataLayerDataAttributesDatasetDataAttributes = {
layers?: ChartDataLayerDataAttributesDatasetDataAttributesLayers;
metadata?: ChartDataLayerDataAttributesDatasetDataAttributesMetadata;
name?: string;
order?: number;
short_description?: string;
sub_topic?: ChartDataLayerDataAttributesDatasetDataAttributesSubTopic;
topic?: ChartDataLayerDataAttributesDatasetDataAttributesTopic;
Expand Down Expand Up @@ -2585,6 +2594,7 @@ export type ChartDataLayerDataAttributesDatasetDataAttributesSubTopicDataAttribu
createdAt?: string;
createdBy?: ChartDataLayerDataAttributesDatasetDataAttributesSubTopicDataAttributesCreatedBy;
name?: string;
order?: number;
updatedAt?: string;
updatedBy?: ChartDataLayerDataAttributesDatasetDataAttributesSubTopicDataAttributesUpdatedBy;
};
Expand Down
18 changes: 12 additions & 6 deletions cms/config/sync/admin-role.strapi-super-admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
"metadata.units",
"metadata.full_name",
"metadata.temporal_resolution",
"short_description"
"short_description",
"order"
]
},
"conditions": []
Expand Down Expand Up @@ -107,7 +108,8 @@
"metadata.units",
"metadata.full_name",
"metadata.temporal_resolution",
"short_description"
"short_description",
"order"
]
},
"conditions": []
Expand All @@ -132,7 +134,8 @@
"metadata.units",
"metadata.full_name",
"metadata.temporal_resolution",
"short_description"
"short_description",
"order"
]
},
"conditions": []
Expand Down Expand Up @@ -280,7 +283,8 @@
"subject": "api::sub-topic.sub-topic",
"properties": {
"fields": [
"name"
"name",
"order"
]
},
"conditions": []
Expand All @@ -298,7 +302,8 @@
"subject": "api::sub-topic.sub-topic",
"properties": {
"fields": [
"name"
"name",
"order"
]
},
"conditions": []
Expand All @@ -309,7 +314,8 @@
"subject": "api::sub-topic.sub-topic",
"properties": {
"fields": [
"name"
"name",
"order"
]
},
"conditions": []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@
"sortable": true
}
},
"order": {
"edit": {
"label": "order",
"description": "Define the order of the dataset within a sub-topic. The value is relative to the other datasets.",
"placeholder": "",
"visible": true,
"editable": true
},
"list": {
"label": "order",
"searchable": true,
"sortable": true
}
},
"createdAt": {
"edit": {
"label": "createdAt",
Expand Down Expand Up @@ -186,6 +200,10 @@
{
"name": "name",
"size": 6
},
{
"name": "order",
"size": 6
}
],
[
Expand Down Expand Up @@ -225,7 +243,8 @@
"id",
"topic",
"sub_topic",
"name"
"name",
"order"
]
},
"uid": "api::dataset.dataset"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@
"sortable": true
}
},
"order": {
"edit": {
"label": "order",
"description": "Define the order of the sub-topic within a topic. The value is relative to the other sub-topics.",
"placeholder": "",
"visible": true,
"editable": true
},
"list": {
"label": "order",
"searchable": true,
"sortable": true
}
},
"createdAt": {
"edit": {
"label": "createdAt",
Expand Down Expand Up @@ -93,17 +107,22 @@
}
},
"layouts": {
"list": [
"id",
"name"
],
"edit": [
[
{
"name": "name",
"size": 6
},
{
"name": "order",
"size": 4
}
]
],
"list": [
"id",
"name",
"order"
]
},
"uid": "api::sub-topic.sub-topic"
Expand Down
3 changes: 3 additions & 0 deletions cms/src/api/dataset/content-types/dataset/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
"short_description": {
"type": "text",
"maxLength": 100
},
"order": {
"type": "integer"
}
}
}
3 changes: 3 additions & 0 deletions cms/src/api/sub-topic/content-types/sub-topic/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"name": {
"type": "string",
"required": true
},
"order": {
"type": "integer"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2024-11-22T10:48:59.215Z"
"x-generation-date": "2024-11-22T14:00:12.515Z"
},
"x-strapi-config": {
"path": "/documentation",
Expand Down Expand Up @@ -642,6 +642,9 @@
"name": {
"type": "string"
},
"order": {
"type": "integer"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -728,6 +731,9 @@
"short_description": {
"type": "string"
},
"order": {
"type": "integer"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -1051,6 +1057,9 @@
},
"short_description": {
"type": "string"
},
"order": {
"type": "integer"
}
}
}
Expand Down Expand Up @@ -1568,6 +1577,9 @@
"name": {
"type": "string"
},
"order": {
"type": "integer"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -1654,6 +1666,9 @@
"short_description": {
"type": "string"
},
"order": {
"type": "integer"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -1902,6 +1917,9 @@
"short_description": {
"type": "string"
},
"order": {
"type": "integer"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -2737,6 +2755,9 @@
"name": {
"type": "string"
},
"order": {
"type": "integer"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -2823,6 +2844,9 @@
"short_description": {
"type": "string"
},
"order": {
"type": "integer"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -3554,6 +3578,9 @@
"properties": {
"name": {
"type": "string"
},
"order": {
"type": "integer"
}
}
}
Expand Down Expand Up @@ -3614,6 +3641,9 @@
"name": {
"type": "string"
},
"order": {
"type": "integer"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down
Loading

0 comments on commit dd90257

Please sign in to comment.