Skip to content

Commit

Permalink
Merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
myovchev committed Oct 13, 2024
2 parents cc6dc7f + 24afef2 commit 822c57d
Show file tree
Hide file tree
Showing 30 changed files with 982 additions and 48 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@

### Adds

* Elements inside modals can have a `data-apos-focus-priority` attribute that prioritizes them inside the focusable elements list.
* Modals will continute trying to find focusable elements until an element marked `data-apos-focus-priority` appears or the max retry threshold is reached.
* Takes care of an edge case where Media Manager would duplicate search results.
* Modules can now have a `before: "module-name"` property in their configuration to run (initialization) before another module.

### Fixes

* Modifies the `AposAreaMenu.vue` component to set the `disabled` attribute to `true` if the max number of widgets have been added in an area with `expanded: true`.
* `pnpm: true` option in `app.js` is no longer breaking the application.
* Remove unused `vue-template-compiler` dependency.
* Prevent un-publishing the `@apostrophecms/global` doc and more generally all singletons.

## 4.7.2 and 4.8.1 (2024-10-09)

### Fixes

* Correct a race condition that can cause a crash at startup when custom `uploadfs` options are present in some specific cloud environments e.g. when using Azure Blob Storage.

## 4.8.0 (2024-10-03)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<button
v-for="(item, itemIndex) in group.widgets"
:key="itemIndex"
:data-apos-focus-priority="itemIndex === 0 ? true : null"
class="apos-widget"
@click="add(item)"
>
Expand Down Expand Up @@ -259,6 +260,7 @@ export default {
& {
padding: 0;
border: none;
border-radius: var(--a-border-radius);
background: none;
text-align: inherit;
}
Expand Down Expand Up @@ -294,6 +296,12 @@ export default {
}
}
&:focus,
&:active {
outline: 2px solid var(--a-primary-light-40);
outline-offset: 4px;
}
&:hover {
cursor: pointer;
// stylelint-disable max-nesting-depth
Expand Down
2 changes: 1 addition & 1 deletion modules/@apostrophecms/asset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ module.exports = {

// The namespace filled by `initUploadfs()`
self.uploadfs = null;
self.initUploadfs();
await self.initUploadfs();

self.enableBrowserData();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<header class="apos-modal__header">
<div class="apos-modal__header__main">
<AposButton
:attrs="{'data-apos-focus-priority': true}"
type="default"
:title="$t('apostrophe:commandMenuEsc')"
:icon-only="true"
Expand Down
4 changes: 4 additions & 0 deletions modules/@apostrophecms/doc-type/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,10 @@ module.exports = {
// This method accepts the draft or the published version of the document
// to achieve this.
async unpublish(req, doc, options) {
if (self.options.singleton) {
throw self.apos.error('forbidden');
}

const DRAFT_SUFFIX = ':draft';
const PUBLISHED_SUFFIX = ':published';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<AposButton
type="default"
label="apostrophe:cancel"
:attrs="{'data-apos-focus-priority': isPriorityButton('cancel')}"
@click="confirmAndCancel"
/>
</template>
Expand Down Expand Up @@ -42,6 +43,7 @@
:label="saveLabel"
:disabled="saveDisabled"
:tooltip="errorTooltip"
:attrs="{'data-apos-focus-priority': isPriorityButton('save')}"
@click="onRestore"
/>
<AposButtonSplit
Expand All @@ -51,6 +53,7 @@
:disabled="saveDisabled"
:tooltip="errorTooltip"
:selected="savePreference"
:attrs="{'data-apos-focus-priority': isPriorityButton('splitSave')}"
@click="saveHandler($event)"
/>
</template>
Expand Down Expand Up @@ -883,6 +886,23 @@ export default {
}
return body;
},
isPriorityButton(name) {
let priority;
if (this.restoreOnly) {
priority = 'save';
}
if (this.saveMenu) {
priority = 'splitSave';
}
if (this.saveDisabled) {
priority = 'cancel';
}
return name === priority ? true : null;
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export default {
this.canEdit &&
!this.context.parked &&
this.moduleOptions.canPublish &&
!this.moduleOptions.singleton &&
this.context.lastPublishedAt &&
this.manuallyPublished
);
Expand Down
Loading

0 comments on commit 822c57d

Please sign in to comment.