@rr0/cms 0.3.5 → 0.3.6
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.
- package/dist/org/CmsOrganization.d.ts +1 -0
- package/dist/org/CmsOrganization.js +3 -0
- package/dist/place/OrganizationPlace.d.ts +1 -0
- package/dist/place/OrganizationPlace.js +4 -0
- package/dist/time/datasource/rr0/RR0Datasource.js +2 -2
- package/dist/time/datasource/rr0/RR0Datasource.test.js +5 -2
- package/package.json +3 -3
|
@@ -8,4 +8,5 @@ export declare class CmsOrganization<M extends TitleMessage = OrganizationMessag
|
|
|
8
8
|
get parent(): CmsOrganization | undefined;
|
|
9
9
|
getMessages(context: RR0Context): M;
|
|
10
10
|
getTitle(context: RR0Context, options?: OrganizationMessageOptions): string;
|
|
11
|
+
toString(): string;
|
|
11
12
|
}
|
|
@@ -5,4 +5,8 @@ export class OrganizationPlace extends Place {
|
|
|
5
5
|
this.org = org;
|
|
6
6
|
Object.assign(this, org.places[0]);
|
|
7
7
|
}
|
|
8
|
+
toString() {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
return (_b = (_a = this.org) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : super.toString();
|
|
11
|
+
}
|
|
8
12
|
}
|
|
@@ -7,8 +7,8 @@ export class RR0Datasource extends AbstractDatasource {
|
|
|
7
7
|
super(["Beau, Jérôme"], "RR0");
|
|
8
8
|
}
|
|
9
9
|
static id(dateTime, place) {
|
|
10
|
-
|
|
11
|
-
return `${dateTime.toString()}
|
|
10
|
+
var _a;
|
|
11
|
+
return `${dateTime.toString()}$${((_a = place === null || place === void 0 ? void 0 : place.toString()) !== null && _a !== void 0 ? _a : "")}`;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
RR0Datasource.placeRegex = /^(.+?)(?:\s*\((.+?)(?:\s*,\s*(.+?)(?:\s*,\s*(.+?)))?\))?$/g;
|
|
@@ -9,6 +9,8 @@ import { TimeTextBuilder } from "../../text/TimeTextBuilder.js";
|
|
|
9
9
|
import { RR0CaseSummaryMapper } from "./RR0CaseSummaryMapper";
|
|
10
10
|
import { RR0FileDatasource } from "./RR0FileDatasource";
|
|
11
11
|
import { NamedPlace } from "@rr0/place";
|
|
12
|
+
import { OrganizationPlace } from "../../../place/OrganizationPlace";
|
|
13
|
+
import { parisCity } from "../../../org/eu/fr/region/idf/75/paris/Paris";
|
|
12
14
|
export class RR0TestDatasource extends RR0Datasource {
|
|
13
15
|
constructor() {
|
|
14
16
|
super();
|
|
@@ -86,7 +88,8 @@ describe("RR0CaseSource", () => {
|
|
|
86
88
|
await testCase.testRender(context);
|
|
87
89
|
});
|
|
88
90
|
test("id", async () => {
|
|
89
|
-
|
|
90
|
-
expect(id).toBe("1972-08-12$
|
|
91
|
+
expect(RR0Datasource.id(EdtfDate.fromString("1972-08-12"), new NamedPlace("Chatillon"))).toBe("1972-08-12$Chatillon");
|
|
92
|
+
expect(RR0Datasource.id(EdtfDate.fromString("1972-08-12"), new OrganizationPlace(parisCity))).toBe("1972-08-12$city$75000");
|
|
93
|
+
expect(RR0Datasource.id(EdtfDate.fromString("1972-08-12"), undefined)).toBe("1972-08-12$");
|
|
91
94
|
});
|
|
92
95
|
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@rr0/cms",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"author": "Jérôme Beau <rr0@rr0.org> (https://rr0.org)",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.6",
|
|
6
6
|
"description": "RR0 Content Management System (CMS)",
|
|
7
7
|
"exports": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@javarome/fileutil": "^0.3.6",
|
|
32
32
|
"@rr0/common": "^1.1.3",
|
|
33
|
-
"@rr0/data": "^0.3.
|
|
33
|
+
"@rr0/data": "^0.3.6",
|
|
34
34
|
"@rr0/lang": "^0.1.12",
|
|
35
|
-
"@rr0/place": "^0.5.
|
|
35
|
+
"@rr0/place": "^0.5.2",
|
|
36
36
|
"@rr0/time": "^0.10.0",
|
|
37
37
|
"canvas": "^2.11.2",
|
|
38
38
|
"csv-parser": "^3.0.0",
|