apostrophe 4.0.0 → 4.1.0

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/defaults.js +2 -1
  3. package/modules/@apostrophecms/area/ui/apos/components/AposWidgetControls.vue +10 -10
  4. package/modules/@apostrophecms/attachment/index.js +2 -1
  5. package/modules/@apostrophecms/attachment/public/img/missing-icon.svg +14 -0
  6. package/modules/@apostrophecms/command-menu/ui/apos/components/AposCommandMenuKey.vue +1 -1
  7. package/modules/@apostrophecms/doc-type/index.js +34 -13
  8. package/modules/@apostrophecms/doc-type/ui/apos/components/AposDocContextMenu.vue +3 -3
  9. package/modules/@apostrophecms/i18n/i18n/en.json +13 -0
  10. package/modules/@apostrophecms/i18n/ui/apos/components/AposI18nLocalize.vue +173 -6
  11. package/modules/@apostrophecms/image/ui/apos/components/AposMediaManagerSelections.vue +3 -2
  12. package/modules/@apostrophecms/login/index.js +18 -1
  13. package/modules/@apostrophecms/login/ui/apos/components/AposResetPasswordForm.vue +2 -2
  14. package/modules/@apostrophecms/login/ui/apos/logic/AposLoginForm.js +1 -16
  15. package/modules/@apostrophecms/modal/ui/apos/components/AposModal.vue +9 -9
  16. package/modules/@apostrophecms/modal/ui/apos/components/AposModalConfirm.vue +4 -4
  17. package/modules/@apostrophecms/modal/ui/apos/components/AposModalLip.vue +2 -2
  18. package/modules/@apostrophecms/modal/ui/apos/components/AposModalTabs.vue +4 -3
  19. package/modules/@apostrophecms/notification/ui/apos/components/TheAposNotifications.vue +4 -2
  20. package/modules/@apostrophecms/oembed-field/ui/apos/components/AposInputOembed.vue +8 -6
  21. package/modules/@apostrophecms/page/index.js +1 -0
  22. package/modules/@apostrophecms/piece-type/ui/apos/components/AposDocsManagerSelectBox.vue +9 -5
  23. package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposTiptapButton.vue +1 -1
  24. package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposTiptapImage.vue +1 -1
  25. package/modules/@apostrophecms/schema/index.js +69 -8
  26. package/modules/@apostrophecms/schema/lib/addFieldTypes.js +1 -1
  27. package/modules/@apostrophecms/schema/ui/apos/components/AposInputPassword.vue +6 -4
  28. package/modules/@apostrophecms/schema/ui/apos/components/AposInputRange.vue +9 -6
  29. package/modules/@apostrophecms/schema/ui/apos/components/AposInputString.vue +1 -1
  30. package/modules/@apostrophecms/schema/ui/apos/components/AposInputWrapper.vue +15 -12
  31. package/modules/@apostrophecms/schema/ui/apos/components/AposSchema.vue +28 -19
  32. package/modules/@apostrophecms/schema/ui/apos/components/AposSearchList.vue +1 -1
  33. package/modules/@apostrophecms/schema/ui/apos/logic/AposInputRelationship.js +1 -1
  34. package/modules/@apostrophecms/schema/ui/apos/logic/AposInputSelect.js +2 -2
  35. package/modules/@apostrophecms/schema/ui/apos/logic/AposInputString.js +2 -2
  36. package/modules/@apostrophecms/schema/ui/apos/logic/AposInputWrapper.js +4 -4
  37. package/modules/@apostrophecms/schema/ui/apos/logic/AposSchema.js +4 -1
  38. package/modules/@apostrophecms/settings/ui/apos/components/AposSettingsManager.vue +1 -1
  39. package/modules/@apostrophecms/task/index.js +2 -0
  40. package/modules/@apostrophecms/translation/index.js +233 -0
  41. package/modules/@apostrophecms/translation/ui/apos/components/AposTranslationIndicator.vue +84 -0
  42. package/modules/@apostrophecms/ui/ui/apos/components/AposAvatar.vue +2 -1
  43. package/modules/@apostrophecms/ui/ui/apos/components/AposCellButton.vue +2 -1
  44. package/modules/@apostrophecms/ui/ui/apos/components/AposCellLabels.vue +49 -5
  45. package/modules/@apostrophecms/ui/ui/apos/components/AposCloudUploadIcon.vue +10 -5
  46. package/modules/@apostrophecms/ui/ui/apos/components/AposContextMenu.vue +3 -5
  47. package/modules/@apostrophecms/ui/ui/apos/components/AposEmptyState.vue +3 -3
  48. package/modules/@apostrophecms/ui/ui/apos/components/AposIndicator.vue +1 -1
  49. package/modules/@apostrophecms/ui/ui/apos/components/AposLabel.vue +1 -1
  50. package/modules/@apostrophecms/ui/ui/apos/components/AposPagerDots.vue +2 -1
  51. package/modules/@apostrophecms/ui/ui/apos/components/AposSlat.vue +11 -10
  52. package/modules/@apostrophecms/ui/ui/apos/components/AposSpinner.vue +2 -2
  53. package/modules/@apostrophecms/ui/ui/apos/components/AposTag.vue +3 -2
  54. package/modules/@apostrophecms/ui/ui/apos/components/AposTagListItem.vue +2 -1
  55. package/modules/@apostrophecms/ui/ui/apos/components/AposTreeRows.vue +1 -1
  56. package/modules/@apostrophecms/ui/ui/apos/scss/global/_theme.scss +1 -0
  57. package/package.json +3 -3
  58. package/test/attachments.js +5 -0
  59. package/test/schemas.js +138 -0
  60. package/test/translation.js +538 -0
  61. package/test-lib/util.js +21 -0
@@ -32,7 +32,7 @@
32
32
  :style="style"
33
33
  >
34
34
  <defs>
35
- <linearGradient x1="8.042%" y1="0%" x2="65.682%" y2="23.865%" id="a">
35
+ <linearGradient id="a" x1="8.042%" y1="0%" x2="65.682%" y2="23.865%">
36
36
  <stop stop-color="currentColor" stop-opacity="0" offset="0%" />
37
37
  <stop stop-color="currentColor" stop-opacity=".631" offset="63.146%" />
38
38
  <stop stop-color="currentColor" offset="100%" />
@@ -40,7 +40,7 @@
40
40
  </defs>
41
41
  <g fill="none" fill-rule="evenodd">
42
42
  <g transform="translate(1 1)">
43
- <path d="M36 18c0-9.94-8.06-18-18-18" id="Oval-2" stroke="url(#a)" stroke-width="2" transform="rotate(266.312 18 18)">
43
+ <path id="Oval-2" d="M36 18c0-9.94-8.06-18-18-18" stroke="url(#a)" stroke-width="2" transform="rotate(266.312 18 18)">
44
44
  <animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="0.9s" repeatCount="indefinite" />
45
45
  </path>
46
46
  <circle fill="currentColor" cx="36" cy="18" r="1" transform="rotate(266.312 18 18)">
@@ -1,8 +1,9 @@
1
1
  <template>
2
2
  <div class="apos-tag">
3
- <button @click="click" class="apos-tag__button">
3
+ <button class="apos-tag__button" @click="click">
4
4
  <close-icon
5
- class="apos-tag__remove" title="Remove Tag"
5
+ class="apos-tag__remove"
6
+ title="Remove Tag"
6
7
  :size="10"
7
8
  />
8
9
  </button>
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <li class="apos-tag-list__item">
3
3
  <button
4
- :class="{'apos-is-active' : active}" class="apos-tag-list__button"
4
+ :class="{'apos-is-active' : active}"
5
+ class="apos-tag-list__button"
5
6
  @click="click(tag)"
6
7
  >
7
8
  <AposIndicator
@@ -190,7 +190,7 @@ export default {
190
190
  }
191
191
  }
192
192
  },
193
- emits: [ 'update', 'update:checked' ],
193
+ emits: [ 'update', 'update:checked', 'change' ],
194
194
  data() {
195
195
  return {
196
196
  treeBranches: []
@@ -8,6 +8,7 @@
8
8
  --a-warning-dark: #a75c07;
9
9
  --a-warning-fade: #ffce0030;
10
10
  --a-progress-bg: #2c354d;
11
+ --a-highlight: #fff6e8;
11
12
 
12
13
  --a-danger-button-hover: #c00717;
13
14
  --a-danger-button-active: #a10000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apostrophe",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "The Apostrophe Content Management System.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -78,7 +78,7 @@
78
78
  "form-data": "^4.0.0",
79
79
  "fs-extra": "^7.0.1",
80
80
  "glob": "^5.0.15",
81
- "he": "^0.5.0",
81
+ "he": "^1.2.0",
82
82
  "html-to-text": "^9.0.5",
83
83
  "i18next": "^20.3.2",
84
84
  "i18next-http-middleware": "^3.1.5",
@@ -149,4 +149,4 @@
149
149
  "browserslist": [
150
150
  "ie >= 10"
151
151
  ]
152
- }
152
+ }
@@ -442,5 +442,10 @@ describe('Attachment', function() {
442
442
 
443
443
  assert(height === 400);
444
444
  });
445
+
446
+ it('should generate an appropriate missing attachment url', function() {
447
+ const url = apos.attachment.url(null);
448
+ assert.strictEqual(url, '/apos-frontend/default/modules/@apostrophecms/attachment/img/missing-icon.svg');
449
+ });
445
450
  });
446
451
  });
package/test/schemas.js CHANGED
@@ -288,6 +288,44 @@ describe('Schemas', function() {
288
288
  }
289
289
  };
290
290
  }
291
+ },
292
+ article: {
293
+ extend: '@apostrophecms/piece-type',
294
+ options: {
295
+ alias: 'article'
296
+ },
297
+ fields(self) {
298
+ return {
299
+ add: {
300
+ title: {
301
+ label: '',
302
+ type: 'string',
303
+ required: true
304
+ },
305
+ area: {
306
+ label: 'Area',
307
+ type: 'area',
308
+ options: {
309
+ widgets: {
310
+ '@apostrophecms/rich-text': {}
311
+ }
312
+ }
313
+ },
314
+ array: {
315
+ label: 'Array',
316
+ type: 'array',
317
+ fields: {
318
+ add: {
319
+ arrayTitle: {
320
+ label: 'Array Title',
321
+ type: 'string'
322
+ }
323
+ }
324
+ }
325
+ }
326
+ }
327
+ };
328
+ }
291
329
  }
292
330
  }
293
331
  });
@@ -2263,6 +2301,106 @@ describe('Schemas', function() {
2263
2301
  assert(output.goodValue === '2022-05-09T22:36:00.000Z');
2264
2302
  });
2265
2303
 
2304
+ it('should compare two document properly with the method getChanges', async function() {
2305
+ const req = apos.task.getReq();
2306
+ const instance = apos.article.newInstance();
2307
+ const article1 = {
2308
+ ...instance,
2309
+ title: 'article 1',
2310
+ area: {
2311
+ _id: 'clrth36680007mnmd3jj7cta0',
2312
+ items: [
2313
+ {
2314
+ _id: 'clt79l48g001h2061j5ihxjkv',
2315
+ metaType: 'widget',
2316
+ type: '@apostrophecms/rich-text',
2317
+ aposPlaceholder: false,
2318
+ content: '<p>Some text here.</p>',
2319
+ permalinkIds: [],
2320
+ imageIds: []
2321
+ }
2322
+ ],
2323
+ metaType: 'area'
2324
+ },
2325
+ array: [
2326
+ {
2327
+ _id: 'clt79llm800242061v4dx9kv5',
2328
+ metaType: 'arrayItem',
2329
+ scopedArrayName: 'doc.article.array',
2330
+ arrayTitle: 'array title 1'
2331
+ },
2332
+ {
2333
+ _id: 'clt79llm800242061v4d47364',
2334
+ metaType: 'arrayItem',
2335
+ scopedArrayName: 'doc.article.array',
2336
+ arrayTitle: 'array title 2'
2337
+ }
2338
+ ]
2339
+ };
2340
+ const article2 = {
2341
+ ...article1,
2342
+ title: 'article 2'
2343
+ };
2344
+ const article3 = {
2345
+ ...instance,
2346
+ title: 'article 3',
2347
+
2348
+ area: {
2349
+ _id: 'clrth36680007mnmd3jj7cta0',
2350
+ items: [
2351
+ {
2352
+ _id: 'clt79l48g001h2061j5ihxjkv',
2353
+ metaType: 'widget',
2354
+ type: '@apostrophecms/rich-text',
2355
+ aposPlaceholder: false,
2356
+ content: '<p>Some text here changed.</p>',
2357
+ permalinkIds: [],
2358
+ imageIds: []
2359
+ }
2360
+ ],
2361
+ metaType: 'area'
2362
+ },
2363
+ array: [
2364
+ {
2365
+ _id: 'clt79llm800242061v4dx9kv5',
2366
+ metaType: 'arrayItem',
2367
+ scopedArrayName: 'doc.article.array',
2368
+ arrayTitle: 'array title 1 changed'
2369
+ },
2370
+ {
2371
+ _id: 'clt79llm800242061v4d47364',
2372
+ metaType: 'arrayItem',
2373
+ scopedArrayName: 'doc.article.array',
2374
+ arrayTitle: 'array title 2'
2375
+ }
2376
+ ]
2377
+ };
2378
+
2379
+ await apos.article.insert(req, article1);
2380
+ await apos.article.insert(req, article2);
2381
+ await apos.article.insert(req, article3);
2382
+
2383
+ const art1 = await apos.doc.db.findOne({ title: 'article 1' });
2384
+ const art2 = await apos.doc.db.findOne({ title: 'article 2' });
2385
+ const art3 = await apos.doc.db.findOne({ title: 'article 3' });
2386
+
2387
+ const changes11 = apos.schema.getChanges(req, apos.article.schema, art1, art1);
2388
+ const changes12 = apos.schema.getChanges(req, apos.article.schema, art1, art2);
2389
+ const changes23 = apos.schema.getChanges(req, apos.article.schema, art2, art3);
2390
+ const actual = {
2391
+ changes11,
2392
+ changes12,
2393
+ changes23
2394
+ };
2395
+ const expected = {
2396
+ changes11: [],
2397
+ changes12: [ 'title', 'slug' ],
2398
+ changes23: [ 'title', 'slug', 'area', 'array' ]
2399
+ };
2400
+
2401
+ assert.deepEqual(actual, expected);
2402
+ });
2403
+
2266
2404
  describe('field editPermission|viewPermission', function() {
2267
2405
  const schema = [
2268
2406
  {