ui: only dipslay "Dispatch Job" button on parameterized jobs (#11019)

This commit is contained in:
Luiz Aoqui 2021-08-09 17:49:08 -04:00 committed by GitHub
parent 5b50b385e8
commit d283e90c35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 16 deletions

3
.changelog/11019.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui: Fixed a bug where the "Dispatch Job" button was displayed for non-parameterized jobs
```

View File

@ -1,21 +1,23 @@
<div class="boxed-section-head">
Job Launches
{{#if (can "dispatch job" namespace=this.job.namespace)}}
<LinkTo
data-test-dispatch-button
@route="jobs.job.dispatch"
class="button is-primary is-compact pull-right">
Dispatch Job
</LinkTo>
{{else}}
<button
data-test-dispatch-button
class="button is-disabled is-primary is-compact pull-right tooltip multiline"
aria-label="You dont have permission to dispatch jobs"
disabled
type="button">
Dispatch Job
</button>
{{#if this.job.parameterized}}
{{#if (can "dispatch job" namespace=this.job.namespace)}}
<LinkTo
data-test-dispatch-button
@route="jobs.job.dispatch"
class="button is-primary is-compact pull-right">
Dispatch Job
</LinkTo>
{{else}}
<button
data-test-dispatch-button
class="button is-disabled is-primary is-compact pull-right tooltip multiline"
aria-label="You dont have permission to dispatch jobs"
disabled
type="button">
Dispatch Job
</button>
{{/if}}
{{/if}}
</div>
<div class="boxed-section-body {{if this.sortedChildren.length "is-full-bleed"}}">