mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
fix bug allowing click on disabled actions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<ion-item button [disabled]="disabledText">
|
||||
<ion-item button [disabled]="disabledText" (click)="onClick.next()">
|
||||
<ion-icon slot="start" [name]="icon" size="large"></ion-icon>
|
||||
<ion-label>
|
||||
<h1>{{ action.name }}</h1>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
visibility: 'enabled'
|
||||
}"
|
||||
icon="construct-outline"
|
||||
(click)="rebuild(pkg.manifest.id)"
|
||||
(onClick)="rebuild(pkg.manifest.id)"
|
||||
></app-actions-item>
|
||||
<app-actions-item
|
||||
[action]="{
|
||||
@@ -27,7 +27,7 @@
|
||||
visibility: 'enabled'
|
||||
}"
|
||||
icon="trash-outline"
|
||||
(click)="tryUninstall(pkg.manifest)"
|
||||
(onClick)="tryUninstall(pkg.manifest)"
|
||||
></app-actions-item>
|
||||
|
||||
<!-- ** specific actions ** -->
|
||||
@@ -38,7 +38,7 @@
|
||||
*ngFor="let action of pkg.actions"
|
||||
[action]="action"
|
||||
icon="play-outline"
|
||||
(click)="handleAction(pkg.mainStatus, pkg.icon, pkg.manifest, action)"
|
||||
(onClick)="handleAction(pkg.mainStatus, pkg.icon, pkg.manifest, action)"
|
||||
></app-actions-item>
|
||||
</ion-item-group>
|
||||
</ion-content>
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
EventEmitter,
|
||||
Input,
|
||||
Output,
|
||||
} from '@angular/core'
|
||||
import { ActivatedRoute } from '@angular/router'
|
||||
import { getPkgId } from '@start9labs/shared'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
@@ -70,9 +76,10 @@ export class AppActionsItemComponent {
|
||||
description: string
|
||||
visibility: T.ActionVisibility
|
||||
}
|
||||
|
||||
@Input() icon!: string
|
||||
|
||||
@Output() onClick: EventEmitter<void> = new EventEmitter()
|
||||
|
||||
get disabledText() {
|
||||
return (
|
||||
typeof this.action.visibility === 'object' &&
|
||||
|
||||
@@ -1701,7 +1701,7 @@ export module Mock {
|
||||
description:
|
||||
'An example of an action that shows a warning and takes no input',
|
||||
warning: 'careful running this action',
|
||||
visibility: 'enabled',
|
||||
visibility: { disabled: 'This is temporarily disabled' },
|
||||
allowedStatuses: 'only-running',
|
||||
hasInput: false,
|
||||
group: null,
|
||||
|
||||
@@ -129,7 +129,7 @@ export const mockPatchData: DataModel = {
|
||||
description:
|
||||
'An example of an action that shows a warning and takes no input',
|
||||
warning: 'careful running this action',
|
||||
visibility: 'enabled',
|
||||
visibility: { disabled: 'This is temporarily disabled' },
|
||||
allowedStatuses: 'only-running',
|
||||
hasInput: false,
|
||||
group: null,
|
||||
|
||||
Reference in New Issue
Block a user