-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11780 from hashicorp/f-ui/job-page-refactor
fix: authorization bug for `job-client-status-summary`
- Loading branch information
Showing
61 changed files
with
1,813 additions
and
1,370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { action } from '@ember/object'; | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import messageForError from 'nomad-ui/utils/message-from-adapter-error'; | ||
|
||
export default class JobPage extends Component { | ||
@tracked errorMessage = null; | ||
|
||
@action | ||
clearErrorMessage() { | ||
this.errorMessage = null; | ||
} | ||
|
||
@action | ||
handleError(errorObject) { | ||
this.errorMessage = errorObject; | ||
} | ||
|
||
@action | ||
setError(err) { | ||
this.errorMessage = { | ||
title: 'Could Not Force Launch', | ||
description: messageForError(err, 'submit jobs'), | ||
}; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 21 additions & 8 deletions
29
ui/app/components/job-page/parts/job-client-status-summary.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,11 @@ | ||
import AbstractJobPage from './abstract'; | ||
import { inject as service } from '@ember/service'; | ||
import { action } from '@ember/object'; | ||
import classic from 'ember-classic-decorator'; | ||
import messageForError from 'nomad-ui/utils/message-from-adapter-error'; | ||
|
||
@classic | ||
export default class Periodic extends AbstractJobPage { | ||
@service store; | ||
|
||
errorMessage = null; | ||
import Component from '@glimmer/component'; | ||
|
||
export default class Periodic extends Component { | ||
@action | ||
forceLaunch() { | ||
this.job.forcePeriodic().catch((err) => { | ||
this.set('errorMessage', { | ||
title: 'Could Not Force Launch', | ||
description: messageForError(err, 'submit jobs'), | ||
}); | ||
forceLaunch(setError) { | ||
this.args.job.forcePeriodic().catch((err) => { | ||
setError(err); | ||
}); | ||
} | ||
|
||
@action | ||
clearErrorMessage() { | ||
this.set('errorMessage', null); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
import Component from '@ember/component'; | ||
import { tagName } from '@ember-decorators/component'; | ||
import { inject as service } from '@ember/service'; | ||
import Component from '@glimmer/component'; | ||
|
||
@tagName('') | ||
export default class JobSubnav extends Component {} | ||
export default class JobSubnav extends Component { | ||
@service can; | ||
|
||
get shouldRenderClientsTab() { | ||
const { job } = this.args; | ||
return ( | ||
job?.hasClientStatus && !job?.hasChildren && this.can.can('read client') | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.