-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
UI: Stop job button #4189
Merged
Merged
UI: Stop job button #4189
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
67f2fa1
Add new model action for stopping a job
DingoEatingFuzz f0cf06a
New two-step-button
DingoEatingFuzz 9899b15
Test coverage for the two-step-button component
DingoEatingFuzz 842ef65
Move common title parts into a part component
DingoEatingFuzz 67df4dd
Common error component for job pages
DingoEatingFuzz 4738144
New errorMessage format
DingoEatingFuzz a3be7ef
Refactor job-page components to use common title and error parts
DingoEatingFuzz 396c4b0
New tests for stop job action
DingoEatingFuzz 91c9e09
Refactor periodic job tests
DingoEatingFuzz 1d19d82
Move job-page helpers and repeat stop tests on the service type
DingoEatingFuzz 10c9e7a
Add button type to the two-step-button buttons
DingoEatingFuzz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 Component from '@ember/component'; | ||
import { equal } from '@ember/object/computed'; | ||
|
||
export default Component.extend({ | ||
classNames: ['two-step-button'], | ||
|
||
idleText: '', | ||
cancelText: '', | ||
confirmText: '', | ||
confirmationMessage: '', | ||
onConfirm() {}, | ||
onCancel() {}, | ||
|
||
state: 'idle', | ||
isIdle: equal('state', 'idle'), | ||
isPendingConfirmation: equal('state', 'prompt'), | ||
|
||
actions: { | ||
setToIdle() { | ||
this.set('state', 'idle'); | ||
}, | ||
promptForConfirmation() { | ||
this.set('state', 'prompt'); | ||
}, | ||
}, | ||
}); |
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,18 +1,19 @@ | ||
@import "./components/badge"; | ||
@import "./components/boxed-section"; | ||
@import "./components/cli-window"; | ||
@import "./components/ember-power-select"; | ||
@import "./components/empty-message"; | ||
@import "./components/error-container"; | ||
@import "./components/gutter"; | ||
@import "./components/inline-definitions"; | ||
@import "./components/job-diff"; | ||
@import "./components/json-viewer"; | ||
@import "./components/loading-spinner"; | ||
@import "./components/metrics"; | ||
@import "./components/node-status-light"; | ||
@import "./components/page-layout"; | ||
@import "./components/simple-list"; | ||
@import "./components/status-text"; | ||
@import "./components/timeline"; | ||
@import "./components/tooltip"; | ||
@import './components/badge'; | ||
@import './components/boxed-section'; | ||
@import './components/cli-window'; | ||
@import './components/ember-power-select'; | ||
@import './components/empty-message'; | ||
@import './components/error-container'; | ||
@import './components/gutter'; | ||
@import './components/inline-definitions'; | ||
@import './components/job-diff'; | ||
@import './components/json-viewer'; | ||
@import './components/loading-spinner'; | ||
@import './components/metrics'; | ||
@import './components/node-status-light'; | ||
@import './components/page-layout'; | ||
@import './components/simple-list'; | ||
@import './components/status-text'; | ||
@import './components/timeline'; | ||
@import './components/tooltip'; | ||
@import './components/two-step-button'; |
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,14 @@ | ||
.two-step-button { | ||
display: inline; | ||
position: relative; | ||
|
||
.confirmation-text { | ||
position: absolute; | ||
left: 0; | ||
top: -1.2em; | ||
font-size: $body-size; | ||
font-weight: $weight-normal; | ||
color: darken($grey-blue, 20%); | ||
white-space: nowrap; | ||
} | ||
} |
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,19 @@ | ||
{{#if isIdle}} | ||
<button class="button is-warning is-small is-inline" onclick={{action "promptForConfirmation"}}> | ||
{{idleText}} | ||
</button> | ||
{{else if isPendingConfirmation}} | ||
<span class="confirmation-text">{{confirmationMessage}}</span> | ||
<button class="button is-dark is-outlined is-small is-inline" onclick={{action (queue | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. type here too please! |
||
(action "setToIdle") | ||
(action onCancel) | ||
)}}> | ||
{{cancelText}} | ||
</button> | ||
<button class="button is-danger is-small is-inline" onclick={{action (queue | ||
(action "setToIdle") | ||
(action onConfirm) | ||
)}}> | ||
{{confirmText}} | ||
</button> | ||
{{/if}} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs type="button"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Updated it.