Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.
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
3 changes: 3 additions & 0 deletions .changelog/4553.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Only show health-check “Re-run” button if project has a data source.
```
20 changes: 11 additions & 9 deletions ui/app/components/status-report-meta-table/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@
<td>
<div class="status-indicator">
<StatusReportIndicator @statusReport={{@model.statusReport}} /> &nbsp;
<Pds::Button
@variant="ghost"
@iconStart="refresh-default"
class="refresh-health-check-button"
disabled={{this.isRefreshRunning}}
{{on "click" this.refreshHealthCheck}}
>
{{t "page.artifact.overview.re-run-health-check"}}
</Pds::Button>
{{#if this.projectHasDataSource}}
<Pds::Button
@variant="ghost"
@iconStart="refresh-default"
class="refresh-health-check-button"
disabled={{this.isRefreshRunning}}
{{on "click" this.refreshHealthCheck}}
>
{{t "page.artifact.overview.re-run-health-check"}}
</Pds::Button>
{{/if}}
</div>
</td>
</tr>
Expand Down
7 changes: 7 additions & 0 deletions ui/app/components/status-report-meta-table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
import ApiService from 'waypoint/services/api';
import FlashMessagesService from 'waypoint/services/pds-flash-messages';
import type ProjectService from 'waypoint/services/project';
import {
Ref,
ExpediteStatusReportRequest,
Expand All @@ -21,6 +22,7 @@ interface Args {
export default class StatusReportMetaTable extends Component<Args> {
@service api!: ApiService;
@service('pdsFlashMessages') flashMessages!: FlashMessagesService;
@service declare project: ProjectService;
@tracked isRefreshRunning = false;

get artifactType(): Args['artifactType'] {
Expand All @@ -35,6 +37,11 @@ export default class StatusReportMetaTable extends Component<Args> {
return this.model.statusReport;
}

get projectHasDataSource(): boolean {
let dataSource = this.project.current?.dataSource;
return Boolean(dataSource && !dataSource.local);
}

@action
async refreshHealthCheck(e: Event): Promise<void> {
e.preventDefault();
Expand Down
5 changes: 4 additions & 1 deletion ui/app/routes/workspace/projects/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ApiService from 'waypoint/services/api';
import { UI, Project, Ref, Job } from 'waypoint-pb';
import PollModelService from 'waypoint/services/poll-model';
import { Breadcrumb } from 'waypoint/services/breadcrumbs';
import ProjectService from 'waypoint/services/project';

export type Params = { project_id: string };
export type Model = Project.AsObject & {
Expand All @@ -13,6 +14,7 @@ export type Model = Project.AsObject & {
export default class ProjectDetail extends Route {
@service api!: ApiService;
@service pollModel!: PollModelService;
@service declare project: ProjectService;

breadcrumbs: Breadcrumb[] = [
{
Expand Down Expand Up @@ -46,7 +48,8 @@ export default class ProjectDetail extends Route {
return result;
}

afterModel(): void {
afterModel(model: Model): void {
this.pollModel.setup(this);
this.project.current = model;
}
}
7 changes: 7 additions & 0 deletions ui/app/services/project.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Service from '@ember/service';
import { tracked } from '@glimmer/tracking';
import type { Model as Project } from 'waypoint/routes/workspace/projects/project';

export default class extends Service {
@tracked current?: Project;
}