@camstack/addon-waste-collections 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -52834,7 +52834,10 @@ sourceId: string().min(1).optional() }).optional(), object({
|
|
|
52834
52834
|
}),
|
|
52835
52835
|
listServices: customAction(object({ countryId: string().min(1) }), array(object({
|
|
52836
52836
|
id: string(),
|
|
52837
|
+
/** Operator list label — may include `(serviceCode)`. */
|
|
52837
52838
|
label: string(),
|
|
52839
|
+
/** Catalog title without the service-code suffix (calendar default). */
|
|
52840
|
+
title: string(),
|
|
52838
52841
|
module: string()
|
|
52839
52842
|
})).readonly(), {
|
|
52840
52843
|
kind: "mutation",
|
|
@@ -138889,6 +138892,15 @@ function listCatalogCountries() {
|
|
|
138889
138892
|
function listCatalogServices(countryId) {
|
|
138890
138893
|
return catalog.services.filter((s) => s.countryId === countryId);
|
|
138891
138894
|
}
|
|
138895
|
+
/**
|
|
138896
|
+
* Operator-facing service title. When the catalog pinned a service code
|
|
138897
|
+
* (`service` / `service_id`, e.g. AbfallNavi `zew2`), append it in parentheses.
|
|
138898
|
+
*/
|
|
138899
|
+
function serviceDisplayLabel(service) {
|
|
138900
|
+
const code = service.defaultArgs["service"] ?? service.defaultArgs["service_id"];
|
|
138901
|
+
if (typeof code === "string" && code.length > 0) return `${service.label} (${code})`;
|
|
138902
|
+
return service.label;
|
|
138903
|
+
}
|
|
138892
138904
|
function findCatalogService(serviceId) {
|
|
138893
138905
|
return catalog.services.find((s) => s.id === serviceId);
|
|
138894
138906
|
}
|
|
@@ -138949,7 +138961,7 @@ function serviceFormSchema(service) {
|
|
|
138949
138961
|
}]
|
|
138950
138962
|
}, {
|
|
138951
138963
|
id: "args",
|
|
138952
|
-
title: service
|
|
138964
|
+
title: serviceDisplayLabel(service),
|
|
138953
138965
|
description: `Module \`${service.module}\`${Object.keys(service.defaultArgs).length > 0 ? ` — fixed: ${Object.entries(service.defaultArgs).map(([k, v]) => `${k}=${v}`).join(", ")}` : ""}`,
|
|
138954
138966
|
columns: 2,
|
|
138955
138967
|
fields: argFields
|
|
@@ -139024,7 +139036,8 @@ var WasteCollectionsAddon = class extends BaseAddon {
|
|
|
139024
139036
|
listCountries: async () => listCatalogCountries(),
|
|
139025
139037
|
listServices: async (input) => listCatalogServices(input.countryId).map((s) => ({
|
|
139026
139038
|
id: s.id,
|
|
139027
|
-
label: s
|
|
139039
|
+
label: serviceDisplayLabel(s),
|
|
139040
|
+
title: s.label,
|
|
139028
139041
|
module: s.module
|
|
139029
139042
|
})),
|
|
139030
139043
|
serviceFormSchema: async (input) => {
|
|
@@ -52830,7 +52830,10 @@ sourceId: string().min(1).optional() }).optional(), object({
|
|
|
52830
52830
|
}),
|
|
52831
52831
|
listServices: customAction(object({ countryId: string().min(1) }), array(object({
|
|
52832
52832
|
id: string(),
|
|
52833
|
+
/** Operator list label — may include `(serviceCode)`. */
|
|
52833
52834
|
label: string(),
|
|
52835
|
+
/** Catalog title without the service-code suffix (calendar default). */
|
|
52836
|
+
title: string(),
|
|
52834
52837
|
module: string()
|
|
52835
52838
|
})).readonly(), {
|
|
52836
52839
|
kind: "mutation",
|
|
@@ -138885,6 +138888,15 @@ function listCatalogCountries() {
|
|
|
138885
138888
|
function listCatalogServices(countryId) {
|
|
138886
138889
|
return catalog.services.filter((s) => s.countryId === countryId);
|
|
138887
138890
|
}
|
|
138891
|
+
/**
|
|
138892
|
+
* Operator-facing service title. When the catalog pinned a service code
|
|
138893
|
+
* (`service` / `service_id`, e.g. AbfallNavi `zew2`), append it in parentheses.
|
|
138894
|
+
*/
|
|
138895
|
+
function serviceDisplayLabel(service) {
|
|
138896
|
+
const code = service.defaultArgs["service"] ?? service.defaultArgs["service_id"];
|
|
138897
|
+
if (typeof code === "string" && code.length > 0) return `${service.label} (${code})`;
|
|
138898
|
+
return service.label;
|
|
138899
|
+
}
|
|
138888
138900
|
function findCatalogService(serviceId) {
|
|
138889
138901
|
return catalog.services.find((s) => s.id === serviceId);
|
|
138890
138902
|
}
|
|
@@ -138945,7 +138957,7 @@ function serviceFormSchema(service) {
|
|
|
138945
138957
|
}]
|
|
138946
138958
|
}, {
|
|
138947
138959
|
id: "args",
|
|
138948
|
-
title: service
|
|
138960
|
+
title: serviceDisplayLabel(service),
|
|
138949
138961
|
description: `Module \`${service.module}\`${Object.keys(service.defaultArgs).length > 0 ? ` — fixed: ${Object.entries(service.defaultArgs).map(([k, v]) => `${k}=${v}`).join(", ")}` : ""}`,
|
|
138950
138962
|
columns: 2,
|
|
138951
138963
|
fields: argFields
|
|
@@ -139020,7 +139032,8 @@ var WasteCollectionsAddon = class extends BaseAddon {
|
|
|
139020
139032
|
listCountries: async () => listCatalogCountries(),
|
|
139021
139033
|
listServices: async (input) => listCatalogServices(input.countryId).map((s) => ({
|
|
139022
139034
|
id: s.id,
|
|
139023
|
-
label: s
|
|
139035
|
+
label: serviceDisplayLabel(s),
|
|
139036
|
+
title: s.label,
|
|
139024
139037
|
module: s.module
|
|
139025
139038
|
})),
|
|
139026
139039
|
serviceFormSchema: async (input) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-waste-collections",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Waste collection schedules via the vendored HACS waste_collection_schedule Python core — full source catalog as calendar-source.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|