Skip to content

Commit

Permalink
Add number of rollup jobs in the rollup jobs title
Browse files Browse the repository at this point in the history
Signed-off-by: Sandeep Kumawat <[email protected]>
  • Loading branch information
Sandeep Kumawat committed Sep 3, 2024
1 parent 6c815fe commit e5c98d6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,6 @@ Object {
<span
class="euiButtonContent euiButton__content"
>
EuiIconMock
<span
class="euiButton__text"
>
Expand Down
10 changes: 10 additions & 0 deletions public/pages/Rollups/containers/Rollups/Rollups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,19 @@ export class Rollups extends MDSEnabledComponent<RollupsProps, RollupsState> {
this.getRollups = _.debounce(this.getRollups, 500, { leading: true });
}

async updateBreadCrumbs() {
if (this.state.useNewUX) {
this.context.chrome.setBreadcrumbs([
{ text: BREADCRUMBS.ROLLUPS.text.concat(` (${this.state.rollups.length})`), href: BREADCRUMBS.ROLLUPS.href },
]);
}
}

async componentDidMount() {
const breadCrumbs = this.state.useNewUX ? [BREADCRUMBS.ROLLUPS] : [BREADCRUMBS.INDEX_MANAGEMENT, BREADCRUMBS.ROLLUPS];
this.context.chrome.setBreadcrumbs(breadCrumbs);
await this.getRollups();
this.updateBreadCrumbs();
}

async componentDidUpdate(prevProps: RollupsProps, prevState: RollupsState) {
Expand All @@ -112,6 +121,7 @@ export class Rollups extends MDSEnabledComponent<RollupsProps, RollupsState> {
if (!_.isEqual(prevQuery, currQuery)) {
await this.getRollups();
}
this.updateBreadCrumbs();
}

static getQueryObjectFromState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ const FlyoutFooter = ({ edit, action, disabledAction = false, onClickCancel, onC
</EuiSmallButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSmallButton
disabled={disabledAction}
onClick={onClickAction}
fill
data-test-subj="flyout-footer-action-button"
iconType={"Add" ? "plusInCircle" : "plus"}
>
<EuiSmallButton disabled={disabledAction} onClick={onClickAction} fill data-test-subj="flyout-footer-action-button">
{text ? text : restore ? "Restore snapshot" : !save ? `${edit ? "Edit" : "Add"} ${action}` : save ? "Save" : "Create"}
</EuiSmallButton>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ exports[`<FlyoutFooter /> spec renders the component 1`] = `
<span
class="euiButtonContent euiButton__content"
>
EuiIconMock
<span
class="euiButton__text"
>
Expand Down

0 comments on commit e5c98d6

Please sign in to comment.