Skip to content

Commit

Permalink
feat(cms): Add download_link attribute in Layer model
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprdhomme committed Nov 8, 2024
1 parent 4fde3f7 commit 0989a06
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 10 deletions.
4 changes: 4 additions & 0 deletions client/src/types/generated/strapi.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,7 @@ export interface Layer {
createdAt?: string;
createdBy?: LayerCreatedBy;
dataset?: LayerDataset;
download_link?: string;
legend_config: LegendLegendConfigComponent;
mapbox_config: unknown;
name: string;
Expand Down Expand Up @@ -1206,6 +1207,7 @@ export type LayerDatasetDataAttributesLayersDataItemAttributes = {
createdAt?: string;
createdBy?: LayerDatasetDataAttributesLayersDataItemAttributesCreatedBy;
dataset?: LayerDatasetDataAttributesLayersDataItemAttributesDataset;
download_link?: string;
legend_config?: LayerDatasetDataAttributesLayersDataItemAttributesLegendConfig;
mapbox_config?: unknown;
name?: string;
Expand Down Expand Up @@ -1476,6 +1478,7 @@ export type LayerRequestDataDataset = number | string;

export type LayerRequestData = {
dataset?: LayerRequestDataDataset;
download_link?: string;
legend_config: LegendLegendConfigComponent;
mapbox_config: unknown;
name: string;
Expand Down Expand Up @@ -1552,6 +1555,7 @@ export type DatasetLayersDataItemAttributes = {
createdAt?: string;
createdBy?: DatasetLayersDataItemAttributesCreatedBy;
dataset?: DatasetLayersDataItemAttributesDataset;
download_link?: string;
legend_config?: DatasetLayersDataItemAttributesLegendConfig;
mapbox_config?: unknown;
name?: string;
Expand Down
9 changes: 6 additions & 3 deletions cms/config/sync/admin-role.strapi-super-admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
"legend_config.items.value",
"legend_config.items.pattern",
"legend_config.unit",
"dataset"
"dataset",
"download_link"
]
},
"conditions": []
Expand All @@ -97,7 +98,8 @@
"legend_config.items.value",
"legend_config.items.pattern",
"legend_config.unit",
"dataset"
"dataset",
"download_link"
]
},
"conditions": []
Expand All @@ -117,7 +119,8 @@
"legend_config.items.value",
"legend_config.items.pattern",
"legend_config.unit",
"dataset"
"dataset",
"download_link"
]
},
"conditions": []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@
"sortable": true
}
},
"download_link": {
"edit": {
"label": "download_link",
"description": "",
"placeholder": "",
"visible": true,
"editable": true
},
"list": {
"label": "download_link",
"searchable": true,
"sortable": true
}
},
"createdAt": {
"edit": {
"label": "createdAt",
Expand Down Expand Up @@ -164,6 +178,12 @@
}
},
"layouts": {
"list": [
"id",
"dataset",
"type",
"name"
],
"edit": [
[
{
Expand Down Expand Up @@ -198,13 +218,13 @@
"name": "legend_config",
"size": 12
}
],
[
{
"name": "download_link",
"size": 6
}
]
],
"list": [
"id",
"dataset",
"type",
"name"
]
},
"uid": "api::layer.layer"
Expand Down
4 changes: 4 additions & 0 deletions cms/src/api/layer/content-types/layer/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
"type": "relation",
"relation": "oneToOne",
"target": "api::dataset.dataset"
},
"download_link": {
"type": "string",
"regex": "^(https?:\\/\\/)?(www\\.)?[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)+((\\/[\\w\\-\\._~:\\/\\?#\\[\\]@!$&'\\(\\)\\*+,;=]*)*)$"
}
}
}
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-05T12:51:46.101Z"
"x-generation-date": "2024-11-08T08:14:51.291Z"
},
"x-strapi-config": {
"path": "/documentation",
Expand Down Expand Up @@ -753,6 +753,9 @@
}
}
},
"download_link": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -960,6 +963,9 @@
}
],
"example": "string or id"
},
"download_link": {
"type": "string"
}
}
}
Expand Down Expand Up @@ -1133,6 +1139,9 @@
}
}
},
"download_link": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -1628,6 +1637,9 @@
}
}
},
"download_link": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down
1 change: 1 addition & 0 deletions cms/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@ export interface ApiLayerLayer extends Schema.CollectionType {
'oneToOne',
'api::dataset.dataset'
>;
download_link: Attribute.String;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
Expand Down

0 comments on commit 0989a06

Please sign in to comment.