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

Kamu UI 417 hide force update link #418

Merged
merged 3 commits into from
Sep 10, 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
### Fixed
- Hid the `force-update` link

## [0.26.2] - 2024-09-09
### Added
- Added reset flatten option for derivative datasets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@
"
></div>
&nbsp;
<a
<!--//TODO: Uncomment with new API -->
<!-- <a
*ngIf="showForceUpdateLink(element)"
class="text-small text-primary d-inline-block"
(click)="onForceUpdate(element)"
>force update</a
>
> -->
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@ describe("FlowsTableComponent", () => {
component.onForceUpdate(mockFlowSummaryDataFragmentShowForceLink);

expect(datasetTriggerFlowSpy).toHaveBeenCalledTimes(1);
expect(toastrServiceSuccessSpy).toHaveBeenCalledWith("Success");
expect(toastrServiceSuccessSpy).toHaveBeenCalledWith("Force update started");
});
});
11 changes: 4 additions & 7 deletions src/app/common/components/flows-table/flows-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,6 @@ describe("DatasetFlowTableHelpers", () => {
mockDatasets,
mockDatasets[1].id,
),
).toEqual(`Source is uncacheable: to re-scan the data, use`);
).toEqual(`Source is uncacheable: to re-scan the data, use force update`);
});
});
11 changes: 4 additions & 7 deletions src/app/common/components/flows-table/flows-table.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
Loading