Skip to content

Commit

Permalink
fix: add loading message when loading template in create pipeline form (
Browse files Browse the repository at this point in the history
#583)

* fix: add loading message when loading template in create pipeline form

* fix: add another case to handle both loading and search no matches
  • Loading branch information
adong authored Aug 14, 2020
1 parent 4eb8604 commit 915fb21
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions app/components/pipeline-create-form/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ export default Component.extend({
isDisabled: or('isSaving', 'isInvalid'),
autoKeysGeneration: false,

messageForSearching: computed('templates.[]', {
get() {
if (this.templates.length) {
return 'Not found.';
}

return 'Loading...';
}
}),

isValid: computed('scmUrl', {
get() {
const val = this.scmUrl;
Expand Down
3 changes: 2 additions & 1 deletion app/components/pipeline-create-form/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
onchange=(action "selectTemplate")
searchField="name"
searchEnabled=true
noMatchesMessage=messageForSearching
as |template| }}
{{template.name}}
{{/power-select}}
Expand Down Expand Up @@ -91,4 +92,4 @@
delayHide="1000"}}
What is a <a href="https://docs.screwdriver.cd/user-guide/configuration/" target="_blank" rel="noopener">screwdriver.yaml</a>
{{/bs-tooltip}}
</div>
</div>

0 comments on commit 915fb21

Please sign in to comment.