Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Custom operations registered with `addCreateWidgetOperation` can now specify an `ifTypesIntersect` property containing an array of widget type names. If the area in question allows at least one, the operation is offered.
* The login-requirements tests were updated to include tests for the `uponSubmit` filter
* Add `prependNodes` and `appendNodes` calls for `main`.
* Add options for pieces to change the title, message and icon of the empty state block.

### Fixes

Expand Down
1 change: 1 addition & 0 deletions modules/@apostrophecms/asset/lib/globalIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = {
'drag-icon': 'Apps',
'eye-icon': 'Eye',
'file-document-icon': 'FileDocument',
'file-document-multiple-outline-icon': 'FileDocumentMultipleOutline',
'file-tree-icon': 'FileTree',
'flare-icon': 'Flare',
'format-align-center-icon': 'FormatAlignCenter',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,6 @@ export default {
justify-content: center;
width: 100%;
height: 100%;
margin-top: 130px;
}

.apos-media-manager__sidebar {
Expand Down
10 changes: 10 additions & 0 deletions modules/@apostrophecms/modal/ui/apos/components/AposModalBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ export default {
}
}

.apos-modal__body-inner {
display: flex;
flex-direction: column;
height: 100%;
}

.apos-modal__body-main {
flex-grow: 1;
Copy link
Copy Markdown
Contributor Author

@ValJed ValJed Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartromanek I just changed this line, replaced the height: 100%.
Also running cypress tests.

}

.apos-modal__body--flex {
display: flex;
flex-direction: column;
Expand Down
1 change: 1 addition & 0 deletions modules/@apostrophecms/piece-type/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ module.exports = {
managerModal: self.getComponentName('managerModal', 'AposDocsManager')
});
browserOptions.managerApiProjection = self.getManagerApiProjection(req);
browserOptions.emptyState = self.options.emptyState;

return browserOptions;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,16 @@ export default {
};
},
emptyDisplay() {
const docModule = apos.modules[this.moduleName];
if (docModule?.emptyState) {
return docModule.emptyState;
}
return {
icon: 'file-document-multiple-outline-icon',
title: {
key: 'apostrophe:noTypeFound',
type: this.$t(this.moduleLabels.plural || this.moduleLabels.singular)
},
message: '',
emoji: '📄'
}
};
},
disableUnpublished() {
Expand Down Expand Up @@ -581,7 +584,6 @@ export default {
justify-content: center;
width: 100%;
height: 100%;
margin-top: 130px;
}

.apos-pieces-manager__relationship__rail {
Expand Down
44 changes: 23 additions & 21 deletions modules/@apostrophecms/ui/ui/apos/components/AposEmptyState.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
<template>
<div class="apos-empty-state">
<div
v-if="emptyState.icon"
class="apos-empty-state__icon"
>
<AposIndicator
:icon="emptyState.icon"
class="apos-empty-state__indicator"
icon-color="var(--a-base-3)"
:icon-size="48"
/>
</div>
<p
v-if="emptyState.title"
class="apos-title"
class="apos-empty-state__title"
>
{{ $t(emptyState.title) }}
</p>
<p
v-if="emptyState.message"
class="apos-hint"
class="apos-empty-state__message"
>
{{ $t(emptyState.message) }}
</p>
<div
v-if="emptyState.emoji"
class="apos-emoji"
>
{{ emptyState.emoji }}
</div>
</div>
</template>

Expand All @@ -38,30 +43,27 @@ export default {
display: flex;
flex-direction: column;
align-items: center;
max-width: 450px;
}

.apos-empty-state__icon {
margin-bottom: 10px;
}

.apos-title {
.apos-empty-state__title {
@include type-title;

& {
margin: 0 0 10px;
margin: 0;
}
}

.apos-hint {
@include type-base;
.apos-empty-state__message {
@include type-large;

& {
font-style: italic;
line-height: var(--a-line-tallest);
color: var(--a-base-1);
margin-top: 5px;
text-align: center;
}
}

.apos-emoji {
// Variable sizes are less important for icons.
/* stylelint-disable-next-line declaration-property-unit-allowed-list */
font-size: 34px;
}
</style>