From bfbd0f4ca4e771d96708fb785e63152f951a24aa Mon Sep 17 00:00:00 2001 From: Dmitriy Borzenko Date: Tue, 10 Sep 2024 17:26:10 +0300 Subject: [PATCH] hide force update link --- .../flows-table/flows-table.component.html | 5 +++-- .../components/flows-table/flows-table.component.ts | 11 ++++------- .../components/flows-table/flows-table.helpers.ts | 11 ++++------- .../flow-details-history-tab.helpers.ts | 13 +++++-------- 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/app/common/components/flows-table/flows-table.component.html b/src/app/common/components/flows-table/flows-table.component.html index f5e81264..6111a66a 100644 --- a/src/app/common/components/flows-table/flows-table.component.html +++ b/src/app/common/components/flows-table/flows-table.component.html @@ -86,12 +86,13 @@ " >   - + diff --git a/src/app/common/components/flows-table/flows-table.component.ts b/src/app/common/components/flows-table/flows-table.component.ts index b210dff8..7c1df635 100644 --- a/src/app/common/components/flows-table/flows-table.component.ts +++ b/src/app/common/components/flows-table/flows-table.component.ts @@ -197,13 +197,10 @@ export class FlowsTableComponent extends BaseComponent implements OnInit, OnChan node.description.__typename === "FlowDescriptionDatasetPollingIngest" && node.description.ingestResult?.__typename === "FlowDescriptionUpdateResultUpToDate" && node.configSnapshot?.__typename === "FlowConfigurationIngest" && - !node.configSnapshot.fetchUncacheable && - // TODO: Remove this condition - Boolean(node.configSnapshot) + node.description.ingestResult.uncacheable && + ((node.configSnapshot?.__typename === "FlowConfigurationIngest" && !node.configSnapshot.fetchUncacheable) || + !node.configSnapshot) ); - // TODO: Replace when will be new API - // || - // !node.configSnapshot) } public onForceUpdate(node: FlowSummaryDataFragment): void { @@ -222,7 +219,7 @@ export class FlowsTableComponent extends BaseComponent implements OnInit, OnChan .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe((result: boolean) => { if (result) { - this.toastrService.success("Success"); + this.toastrService.success("Force update started"); } }); } else { diff --git a/src/app/common/components/flows-table/flows-table.helpers.ts b/src/app/common/components/flows-table/flows-table.helpers.ts index d63a0c62..7f343f90 100644 --- a/src/app/common/components/flows-table/flows-table.helpers.ts +++ b/src/app/common/components/flows-table/flows-table.helpers.ts @@ -97,14 +97,11 @@ export class DatasetFlowTableHelpers { : element.description.ingestResult?.__typename === "FlowDescriptionUpdateResultUpToDate" && element.description.ingestResult.uncacheable && - element.configSnapshot?.__typename === "FlowConfigurationIngest" && - !element.configSnapshot.fetchUncacheable && - // TODO: Remove this condition - element.configSnapshot + ((element.configSnapshot?.__typename === "FlowConfigurationIngest" && + !element.configSnapshot.fetchUncacheable) || + !element.configSnapshot) ? // TODO: Replace when will be new API - // || - // !node.configSnapshot) - `Source is uncacheable: to re-scan the data, use` + `Source is uncacheable: to re-scan the data, use force update` : "Dataset is up-to-date"; case "FlowDescriptionDatasetExecuteTransform": diff --git a/src/app/dataset-flow/dataset-flow-details/tabs/flow-details-history-tab/flow-details-history-tab.helpers.ts b/src/app/dataset-flow/dataset-flow-details/tabs/flow-details-history-tab/flow-details-history-tab.helpers.ts index a6358599..01b2dc1c 100644 --- a/src/app/dataset-flow/dataset-flow-details/tabs/flow-details-history-tab/flow-details-history-tab.helpers.ts +++ b/src/app/dataset-flow/dataset-flow-details/tabs/flow-details-history-tab/flow-details-history-tab.helpers.ts @@ -140,14 +140,11 @@ export class DatasetFlowDetailsHelpers { : flowDetails.description.ingestResult?.__typename === "FlowDescriptionUpdateResultUpToDate" && flowDetails.description.ingestResult.uncacheable && - flowDetails.configSnapshot?.__typename === "FlowConfigurationIngest" && - !flowDetails.configSnapshot.fetchUncacheable && - // TODO: Remove this condition - flowDetails.configSnapshot - ? // TODO: Replace when will be new API - // || - // !flowDetails.configSnapshot) - "Source is uncacheable: to re-scan the data, use force update" + ((flowDetails.configSnapshot?.__typename === + "FlowConfigurationIngest" && + !flowDetails.configSnapshot.fetchUncacheable) || + !flowDetails.configSnapshot) + ? "Source is uncacheable: to re-scan the data, use force update" : "Dataset is up-to-date"; case "FlowDescriptionDatasetExecuteTransform":