Skip to content

Commit

Permalink
fixes after qa
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabowskiM committed Dec 11, 2023
1 parent 83a038f commit 2b8c9c8
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/bundle/ui-dev/src/modules/sub-items/sub.items.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ export default class SubItemsModule extends Component {
}

this.adaptHeaderActions();

const subitemsTab = this._refMainContainerWrapper.current.closest('.ibexa-tab-content__pane');
const subitemsNavTab = document.querySelector(`.ibexa-tabs__link[href="#${subitemsTab.id}"]`);

subitemsNavTab.addEventListener('shown.bs.tab', () => {
this.popperInstance.forceUpdate();
});
}

componentDidUpdate() {
Expand Down Expand Up @@ -191,6 +198,7 @@ export default class SubItemsModule extends Component {
const { subItemsWidth } = this.state;

if (calculatedWidth !== subItemsWidth) {
this.popperInstance.forceUpdate();
this.setState({ subItemsWidth: calculatedWidth });
}
}
Expand Down Expand Up @@ -1432,14 +1440,6 @@ export default class SubItemsModule extends Component {
const isTableViewActive = activeView === VIEW_MODE_TABLE;
const pageLoaded = !!activePageItems;
const bulkBtnDisabled = nothingSelected || !isTableViewActive || !pageLoaded;
const actionBtns = [
...this.props.extraActions.map(this.renderExtraActions),
this.renderBulkMoveBtn(bulkBtnDisabled),
this.renderBulkAddLocationBtn(bulkBtnDisabled),
this.renderBulkHideBtn(bulkHideBtnDisabled),
this.renderBulkUnhideBtn(bulkUnhideBtnDisabled),
this.renderBulkDeleteBtn(bulkBtnDisabled),
];
let bulkHideBtnDisabled = true;
let bulkUnhideBtnDisabled = true;
let listClassName = 'm-sub-items__list';
Expand All @@ -1455,6 +1455,15 @@ export default class SubItemsModule extends Component {
bulkUnhideBtnDisabled = !selectedItemsValues.some((item) => !!item.hidden);
}

const actionBtns = [
...this.props.extraActions.map(this.renderExtraActions),
this.renderBulkMoveBtn(bulkBtnDisabled),
this.renderBulkAddLocationBtn(bulkBtnDisabled),
this.renderBulkHideBtn(bulkHideBtnDisabled),
this.renderBulkUnhideBtn(bulkUnhideBtnDisabled),
this.renderBulkDeleteBtn(bulkBtnDisabled),
];

return (
<div ref={this._refMainContainerWrapper}>
<div className="m-sub-items" style={{ width: `${subItemsWidth}px` }}>
Expand Down

0 comments on commit 2b8c9c8

Please sign in to comment.