Skip to content

Commit

Permalink
Update rollup jobs and transform jobs title with total numbers of jobs (
Browse files Browse the repository at this point in the history
#1164)

* Add number of rollup jobs in the rollup jobs title

Signed-off-by: Sandeep Kumawat <skumwt@amazon.com>

* Transform numbers in title

Signed-off-by: Sandeep Kumawat <skumwt@amazon.com>

---------

Signed-off-by: Sandeep Kumawat <skumwt@amazon.com>
Co-authored-by: Sandeep Kumawat <skumwt@amazon.com>
(cherry picked from commit 163ad4e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and Sandeep Kumawat committed Sep 3, 2024
1 parent 577ee65 commit a23bbec
Show file tree
Hide file tree
Showing 5 changed files with 21 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
10 changes: 10 additions & 0 deletions public/pages/Transforms/containers/Transforms/Transforms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,19 @@ export class Transforms extends MDSEnabledComponent<TransformProps, TransformSta
this.getTransforms = _.debounce(this.getTransforms, 500, { leading: true });
}

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

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

async componentDidUpdate(prevProps: TransformProps, prevState: TransformState) {
Expand All @@ -112,6 +121,7 @@ export class Transforms extends MDSEnabledComponent<TransformProps, TransformSta
if (!_.isEqual(prevQuery, currQuery)) {
await this.getTransforms();
}
this.updateBreadCrumbs();
}

render() {
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 a23bbec

Please sign in to comment.