@scalemule/news-publication 0.0.50 → 0.0.51
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/pets-forms.cjs +3 -1
- package/dist/pets-forms.js +3 -1
- package/dist/pets-plugin.cjs +8 -3
- package/dist/pets-plugin.js +8 -3
- package/package.json +1 -1
package/dist/pets-forms.cjs
CHANGED
|
@@ -309,7 +309,9 @@ function PetSubmissionForm({
|
|
|
309
309
|
source: content.source,
|
|
310
310
|
event: content.event
|
|
311
311
|
});
|
|
312
|
-
setCommunity(
|
|
312
|
+
setCommunity(
|
|
313
|
+
communities.some((c) => c.id === p.area_id) ? p.area_id : defaultCommunity || ""
|
|
314
|
+
);
|
|
313
315
|
}
|
|
314
316
|
},
|
|
315
317
|
children: [
|
package/dist/pets-forms.js
CHANGED
|
@@ -261,7 +261,9 @@ function PetSubmissionForm({
|
|
|
261
261
|
source: content.source,
|
|
262
262
|
event: content.event
|
|
263
263
|
});
|
|
264
|
-
setCommunity(
|
|
264
|
+
setCommunity(
|
|
265
|
+
communities.some((c) => c.id === p.area_id) ? p.area_id : defaultCommunity || ""
|
|
266
|
+
);
|
|
265
267
|
}
|
|
266
268
|
},
|
|
267
269
|
children: [
|
package/dist/pets-plugin.cjs
CHANGED
|
@@ -371,15 +371,20 @@ async function PetSubmitPage({
|
|
|
371
371
|
] });
|
|
372
372
|
else
|
|
373
373
|
try {
|
|
374
|
-
const [collection, own, initial] = await Promise.all([
|
|
374
|
+
const [collection, own, initial, preferences] = await Promise.all([
|
|
375
375
|
petCollectionRequest(scope),
|
|
376
376
|
petCollectionRequest(scope, "/pets/mine"),
|
|
377
|
-
edit && PET_UUID.test(edit) ? petCollectionRequest(scope, "/pets/mine/" + edit) : void 0
|
|
377
|
+
edit && PET_UUID.test(edit) ? petCollectionRequest(scope, "/pets/mine/" + edit) : void 0,
|
|
378
|
+
edit ? petCollectionRequest(scope, "/pets/preferences") : void 0
|
|
378
379
|
]);
|
|
380
|
+
const currentHome = preferences?.communities?.find(
|
|
381
|
+
(a) => a.id === initial?.area_id
|
|
382
|
+
);
|
|
383
|
+
const editCommunities = currentHome && !collection.areas.some((a) => a.id === currentHome.id) ? [...collection.areas, currentHome] : collection.areas;
|
|
379
384
|
form = edit && !initial ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: "This contribution is unavailable. Open it from My pets." }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
380
385
|
petsForms.PetSubmissionForm,
|
|
381
386
|
{
|
|
382
|
-
communities:
|
|
387
|
+
communities: editCommunities,
|
|
383
388
|
policy: collection.submission_policy,
|
|
384
389
|
profiles: own.items.filter((p) => p.kind === "profile"),
|
|
385
390
|
initial,
|
package/dist/pets-plugin.js
CHANGED
|
@@ -145,15 +145,20 @@ async function PetSubmitPage({
|
|
|
145
145
|
] });
|
|
146
146
|
else
|
|
147
147
|
try {
|
|
148
|
-
const [collection, own, initial] = await Promise.all([
|
|
148
|
+
const [collection, own, initial, preferences] = await Promise.all([
|
|
149
149
|
petCollectionRequest(scope),
|
|
150
150
|
petCollectionRequest(scope, "/pets/mine"),
|
|
151
|
-
edit && PET_UUID.test(edit) ? petCollectionRequest(scope, "/pets/mine/" + edit) : void 0
|
|
151
|
+
edit && PET_UUID.test(edit) ? petCollectionRequest(scope, "/pets/mine/" + edit) : void 0,
|
|
152
|
+
edit ? petCollectionRequest(scope, "/pets/preferences") : void 0
|
|
152
153
|
]);
|
|
154
|
+
const currentHome = preferences?.communities?.find(
|
|
155
|
+
(a) => a.id === initial?.area_id
|
|
156
|
+
);
|
|
157
|
+
const editCommunities = currentHome && !collection.areas.some((a) => a.id === currentHome.id) ? [...collection.areas, currentHome] : collection.areas;
|
|
153
158
|
form = edit && !initial ? /* @__PURE__ */ jsx("p", { children: "This contribution is unavailable. Open it from My pets." }) : /* @__PURE__ */ jsx(
|
|
154
159
|
PetSubmissionForm,
|
|
155
160
|
{
|
|
156
|
-
communities:
|
|
161
|
+
communities: editCommunities,
|
|
157
162
|
policy: collection.submission_policy,
|
|
158
163
|
profiles: own.items.filter((p) => p.kind === "profile"),
|
|
159
164
|
initial,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalemule/news-publication",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51",
|
|
4
4
|
"description": "Shared server framework for ScaleMule local news publications. Walnut Creek Times is the broadsheet default; each paper supplies its own identity and feature flags.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|