Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Update rollup jobs and transform jobs title with total numbers of jobs #1167

Merged
merged 1 commit into from
Sep 3, 2024
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
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
Loading