Skip to content

Commit

Permalink
Add more z-index fixes (#4665)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc authored and tomaskikutis committed Nov 5, 2024
1 parent 25c8b35 commit 7c33757
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {IArticleSideWidget, IArticleSideWidgetComponentType, IComment, IRestApiR
import {gettext} from 'core/utils';
import CommentsWidget from '../../generic-widgets/comments/CommentsWidget';
import {httpRequestJsonLocal} from 'core/helpers/network';
import {notify} from 'core/notify/notify';
// Can't call `gettext` in the top level
const getLabel = () => gettext('Comments');

Expand Down Expand Up @@ -49,7 +50,13 @@ class Component extends React.PureComponent<IArticleSideWidgetComponentType> {
item: this.props.article._id,
text: text,
},
});
})
.then((res: void) => res)
.catch((error) => {
if (error.data._issues?.text != null) {
notify.error(error.data._issues.text);
}
});
}}
/>
);
Expand Down
7 changes: 6 additions & 1 deletion scripts/apps/authoring/comments/comments.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {notify} from 'core/notify/notify';
import {gettext} from 'core/utils';
import {each} from 'lodash';

Expand All @@ -22,7 +23,11 @@ function CommentsService(api) {
};

this.save = function(comment) {
return api.item_comments.save(comment);
return api.item_comments.save(comment).catch((error) => {
if (error.data._issues?.text != null) {
notify.error(error.data._issues.text);
}
});
};
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/apps/authoring/views/change-image.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="modal__header modal__header--flex" data-test-id="change-image" data-theme="dark-ui">
<div class="modal__header modal__header--flex" style="z-index:1051" data-test-id="change-image" data-theme="dark-ui">
<h3 class="modal__heading modal__heading--no-grow" ng-if="!nav || nav === 'view'">{{ :: activity.label}}</h3>
<h3 class="modal__heading modal__heading--no-grow" ng-if="nav === 'image-edit'">{{ :: 'Edit image' | translate }}</h3>
<h3 class="modal__heading modal__heading--no-grow" ng-if="nav === 'crop'">{{ :: 'Edit Crops' | translate }}</h3>
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/activity/views/activity-modal.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="modal in {{activity.cssClass}}" ng-if="activity">
<div style="z-index: 1051 !important;" class="modal in {{activity.cssClass}}" ng-if="activity">
<div class="modal__dialog" ng-controller="activity.controller">
<div class="modal__content" ng-include="activity.templateUrl"></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function getNextPosition(originalElement, editorNode) {
element.style.bottom = '';
mainFlexElement.style['max-height'] = '';

element.style.left = (editorNode.getBoundingClientRect().left - 360) + 'px';
// Math.abs is needed, so that the popover is never positioned outside of the viewport
element.style.left = `${Math.abs(editorNode.getBoundingClientRect().left - 360)}px`;

const paddingBlockStart = 4;
const paddingBlockEnd = 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class AnnotationInputBody extends React.Component<IProps, IState> {
ref={(component) => {
this.positionerRef = component;
}}
zIndex={90}
zIndex={1051}
>
<Card padding={10}>
<div className="annotation-input" style={{width: 460}}>
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/menu/views/superdesk-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<div id="main-container" ng-class="superdesk.flags" ng-if="renderMonitoring && superdesk.flags.workspace === false" ng-view></div>

<div id="react-placeholder"></div>
<div style="z-index: 1051 !important" id="react-placeholder"></div>
<div id="react-backdrop"></div>

<div sd-activity-modal></div>
Expand Down

0 comments on commit 7c33757

Please sign in to comment.