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