Skip to content

Commit

Permalink
Add slug to Dataset to fix issue w/ labels layer
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprdhomme committed Aug 30, 2024
1 parent cdf3d07 commit 0e1ded0
Show file tree
Hide file tree
Showing 8 changed files with 873 additions and 890 deletions.
385 changes: 194 additions & 191 deletions cms/config/sync/admin-role.strapi-author.json

Large diffs are not rendered by default.

417 changes: 210 additions & 207 deletions cms/config/sync/admin-role.strapi-editor.json

Large diffs are not rendered by default.

897 changes: 412 additions & 485 deletions cms/config/sync/admin-role.strapi-super-admin.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@
"sortable": false
}
},
"slug": {
"edit": {
"label": "slug",
"description": "",
"placeholder": "",
"visible": true,
"editable": true
},
"list": {
"label": "slug",
"searchable": true,
"sortable": true
}
},
"createdAt": {
"edit": {
"label": "createdAt",
Expand Down Expand Up @@ -109,23 +123,29 @@
}
},
"layouts": {
"list": [
"id",
"name",
"layers",
"createdAt"
],
"edit": [
[
{
"name": "name",
"size": 6
},
{
"name": "slug",
"size": 6
}
],
[
{
"name": "layers",
"size": 6
}
]
],
"list": [
"id",
"name",
"layers",
"createdAt"
]
}
},
Expand Down
10 changes: 10 additions & 0 deletions cms/src/api/dataset/content-types/dataset/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
"type": "relation",
"relation": "oneToMany",
"target": "api::layer.layer"
},
"slug": {
"pluginOptions": {
"i18n": {
"localized": false
}
},
"type": "string",
"unique": false,
"required": true
}
}
}
7 changes: 7 additions & 0 deletions cms/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,13 @@ export interface ApiDatasetDataset extends Schema.CollectionType {
'oneToMany',
'api::layer.layer'
>;
slug: Attribute.String &
Attribute.Required &
Attribute.SetPluginOptions<{
i18n: {
localized: false;
};
}>;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/containers/map/sidebar/layers-panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const LayersPanel: FCWithMessages = (): JSX.Element => {
})}

<>
{dataset.attributes?.name === 'Basemap' && (
{dataset.attributes?.slug === 'basemap' && (
<li className="flex items-center justify-between">
<span className="flex gap-2">
<Switch
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/types/generated/strapi.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2151,6 +2151,7 @@ export type ProtectionCoverageStatLocationDataAttributesFishingProtectionLevelSt
location?: ProtectionCoverageStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesLocation;
fishing_protection_level?: ProtectionCoverageStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesFishingProtectionLevel;
area?: number;
pct?: number;
createdAt?: string;
updatedAt?: string;
createdBy?: ProtectionCoverageStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesCreatedBy;
Expand Down Expand Up @@ -2852,6 +2853,7 @@ export type MpaaProtectionLevelStatLocationDataAttributesFishingProtectionLevelS
location?: MpaaProtectionLevelStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesLocation;
fishing_protection_level?: MpaaProtectionLevelStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesFishingProtectionLevel;
area?: number;
pct?: number;
createdAt?: string;
updatedAt?: string;
createdBy?: MpaaProtectionLevelStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesCreatedBy;
Expand Down Expand Up @@ -3927,6 +3929,7 @@ export type MpaaEstablishmentStageStatLocationDataAttributesFishingProtectionLev
location?: MpaaEstablishmentStageStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesLocation;
fishing_protection_level?: MpaaEstablishmentStageStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesFishingProtectionLevel;
area?: number;
pct?: number;
createdAt?: string;
updatedAt?: string;
createdBy?: MpaaEstablishmentStageStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesCreatedBy;
Expand Down Expand Up @@ -5295,6 +5298,7 @@ export type MpaChildrenDataItemAttributesLocationDataAttributesFishingProtection
location?: MpaChildrenDataItemAttributesLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesLocation;
fishing_protection_level?: MpaChildrenDataItemAttributesLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesFishingProtectionLevel;
area?: number;
pct?: number;
createdAt?: string;
updatedAt?: string;
createdBy?: MpaChildrenDataItemAttributesLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesCreatedBy;
Expand Down Expand Up @@ -6164,6 +6168,7 @@ export type LocationGroupsDataItemAttributesFishingProtectionLevelStatsDataItemA
location?: LocationGroupsDataItemAttributesFishingProtectionLevelStatsDataItemAttributesLocation;
fishing_protection_level?: LocationGroupsDataItemAttributesFishingProtectionLevelStatsDataItemAttributesFishingProtectionLevel;
area?: number;
pct?: number;
createdAt?: string;
updatedAt?: string;
createdBy?: LocationGroupsDataItemAttributesFishingProtectionLevelStatsDataItemAttributesCreatedBy;
Expand Down Expand Up @@ -6662,6 +6667,7 @@ export type LayerDatasetDataAttributesLocalizations = {
export type LayerDatasetDataAttributes = {
name?: string;
layers?: LayerDatasetDataAttributesLayers;
slug?: string;
createdAt?: string;
updatedAt?: string;
publishedAt?: string;
Expand Down Expand Up @@ -7515,6 +7521,7 @@ export type HabitatStatLocationDataAttributesFishingProtectionLevelStatsDataItem
location?: HabitatStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesLocation;
fishing_protection_level?: HabitatStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesFishingProtectionLevel;
area?: number;
pct?: number;
createdAt?: string;
updatedAt?: string;
createdBy?: HabitatStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesCreatedBy;
Expand Down Expand Up @@ -8169,6 +8176,7 @@ export interface FishingProtectionLevelStat {
location?: FishingProtectionLevelStatLocation;
fishing_protection_level?: FishingProtectionLevelStatFishingProtectionLevel;
area: number;
pct?: number;
createdAt?: string;
updatedAt?: string;
createdBy?: FishingProtectionLevelStatCreatedBy;
Expand Down Expand Up @@ -8521,6 +8529,7 @@ export type FishingProtectionLevelStatLocationDataAttributesFishingProtectionLev
location?: FishingProtectionLevelStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesLocation;
fishing_protection_level?: FishingProtectionLevelStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesFishingProtectionLevel;
area?: number;
pct?: number;
createdAt?: string;
updatedAt?: string;
createdBy?: FishingProtectionLevelStatLocationDataAttributesFishingProtectionLevelStatsDataItemAttributesCreatedBy;
Expand Down Expand Up @@ -9141,6 +9150,7 @@ export type DatasetCreatedBy = {
export interface Dataset {
name: string;
layers?: DatasetLayers;
slug: string;
createdAt?: string;
updatedAt?: string;
publishedAt?: string;
Expand Down Expand Up @@ -9237,6 +9247,7 @@ export type DatasetLayersDataItemAttributesDatasetDataAttributesLocalizations =
export type DatasetLayersDataItemAttributesDatasetDataAttributes = {
name?: string;
layers?: DatasetLayersDataItemAttributesDatasetDataAttributesLayers;
slug?: string;
createdAt?: string;
updatedAt?: string;
publishedAt?: string;
Expand Down Expand Up @@ -9544,6 +9555,7 @@ export type DatasetRequestDataLayersItem = number | string;
export type DatasetRequestData = {
name: string;
layers?: DatasetRequestDataLayersItem[];
slug: string;
locale?: string;
};

Expand All @@ -9556,6 +9568,7 @@ export type DatasetLocalizationRequestLayersItem = number | string;
export interface DatasetLocalizationRequest {
name: string;
layers?: DatasetLocalizationRequestLayersItem[];
slug: string;
locale: string;
}

Expand Down

0 comments on commit 0e1ded0

Please sign in to comment.