Skip to content

Commit

Permalink
Merge pull request #3380 from apostrophecms/hotfix-3.3.1
Browse files Browse the repository at this point in the history
Hotfix 3.3.1
  • Loading branch information
boutell committed Sep 1, 2021
2 parents 2b383f9 + b4cb3ee commit 71221f7
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 20 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog

## 3.3.1 - 2021-09-01

### Fixes

* In some situations it was possible for a relationship with just one selected document to list that document several times in the returned result, resulting in very large responses.
* Permissions roles UI localized correctly.
* Do not crash on startup if users have a relationship to another type. This was caused by the code that checks whether any users exist to present a warning to developers. That code was running too early for relationships to work due to event timing issues.

## 3.3.0 - 2021-08-30

### Fixes
Expand Down
4 changes: 4 additions & 0 deletions modules/@apostrophecms/i18n/i18n/en.json
Expand Up @@ -64,6 +64,7 @@
"deleteDraftAffirmativeLabel": "Yes, delete document",
"deleteDraftDescription": "Since {{ title }} has never been published, this will completely delete the document.",
"description": "Description",
"disabled": "Disabled",
"discardChanges": "Discard Changes",
"discardChangesPrompt": "Do you want to discard changes?",
"discardChangesToDocTypePrompt": "Do you want to discard changes to this {{ type }}?",
Expand Down Expand Up @@ -99,6 +100,7 @@
"editWidgetType": "Edit {{ label }}",
"email": "Email",
"emptyRichTextWidget": "Empty Rich Text Widget",
"enabled": "Enabled",
"error": "An error occurred",
"errorCount": "{{ count }} error remaining",
"errorCount_plural": "{{ count }} errors remaining",
Expand Down Expand Up @@ -207,6 +209,8 @@
"pageNumber": "Page {{ number }}",
"pageTitle": "Page Title",
"pages": "Pages",
"piecePermissionsIntro": "Pieces are structured content. They are often used for content like articles, events, products, categories, etc.",
"piecePermissionsPieceTypeList": "Pieces for this site include:",
"richTextAlignCenter": "Align Center",
"richTextAlignJustify": "Align Justify",
"richTextAlignLeft": "Align Left",
Expand Down
2 changes: 1 addition & 1 deletion modules/@apostrophecms/login/index.js
Expand Up @@ -388,7 +388,7 @@ module.exports = {

async checkForUserAndAlert() {
const adminReq = self.apos.task.getReq();
const user = await self.apos.user.find(adminReq, {}).limit(1).toObject();
const user = await self.apos.user.find(adminReq, {}).relationships(false).limit(1).toObject();

if (!user) {
self.apos.util.warn('⚠️ There are no users created for this installation of ApostropheCMS yet.');
Expand Down
Expand Up @@ -18,7 +18,7 @@
:value="JSON.stringify(choice.value)"
:selected="choice.value === value.data"
>
{{ choice.label }}
{{ $t(choice.label) }}
</option>
</select>
<AposIndicator
Expand All @@ -34,7 +34,7 @@
class="apos-input__role__permission-grid__set"
>
<h4 class="apos-input__role__permission-grid__set-name">
{{ permissionSet.label }}
{{ $t(permissionSet.label) }}
<AposIndicator
v-if="permissionSet.includes"
icon="help-circle-icon"
Expand All @@ -56,14 +56,14 @@
:icon-color="permission.value ? 'var(--a-success)' : 'var(--a-base-5)'"
/>
<span v-if="permission.value" class="apos-sr-only">
Enabled
{{ $t('apostrophe:enabled') }}
</span>
<span v-else class="apos-sr-only">
Disabled
{{ $t('apostrophe:disabled') }}
</span>
</dd>
<dt class="apos-input__role__permission-grid__label">
{{ permission.label }}
{{ $t(permission.label) }}
</dt>
</div>
</dl>
Expand Down Expand Up @@ -127,22 +127,17 @@ export default {
const intro = document.createElement('p');
const followUp = document.createElement('p');
const link = document.createElement('a');
intro.appendChild(document.createTextNode('Pieces are structured content. They are often used for content like articles, events, products, categories, etc.'));
followUp.appendChild(document.createTextNode('Pieces for this site include:'));
link.appendChild(document.createTextNode('Explanation of Pieces'));
link.setAttribute('href', 'https://a3.docs.apostrophecms.org/reference/glossary.html#piece');
link.setAttribute('_target', 'blank');
intro.appendChild(document.createTextNode(this.$t('apostrophe:piecePermissionsIntro')));
followUp.appendChild(document.createTextNode(this.$t('apostrophe:piecePermissionsPieceTypeList')));
html.appendChild(intro);
html.appendChild(followUp);
includes.forEach(item => {
const li = document.createElement('li');
li.appendChild(document.createTextNode(item));
li.appendChild(document.createTextNode(this.$t(item)));
list.appendChild(li);
});
html.appendChild(list);
// TODO append this link when doc urls are more stable
// html.appendChild(link);
return { content: html };
return { content: html, localize: false };
},
validate(value) {
if (this.field.required && !value.length) {
Expand Down
4 changes: 1 addition & 3 deletions modules/@apostrophecms/schema/lib/joinr.js
Expand Up @@ -62,9 +62,7 @@ const joinr = module.exports = {
let otherIds = [];
const othersById = {};
for (const item of items) {
if (!item[objectsField]) {
item[objectsField] = [];
}
item[objectsField] = [];
if (joinr._has(item, idsStorage)) {
otherIds = otherIds.concat(joinr._get(item, idsStorage).map(idMapper));
}
Expand Down
Expand Up @@ -50,7 +50,7 @@ export default {
if (value && value.content) {
return {
...value,
content: instance.$t(value.content)
content: (value.localize === false) ? value.content : instance.$t(value.content)
};
} else {
return value;
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "apostrophe",
"version": "3.3.0",
"version": "3.3.1",
"description": "The Apostrophe Content Management System.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 71221f7

Please sign in to comment.