mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-24 09:06:03 +00:00
disallow disabling core plugins - fixes #1990
This commit is contained in:
@@ -17,7 +17,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
|
|||||||
})
|
})
|
||||||
export class CheckboxComponent implements ControlValueAccessor {
|
export class CheckboxComponent implements ControlValueAccessor {
|
||||||
@HostBinding('class.active') @Input() model: boolean
|
@HostBinding('class.active') @Input() model: boolean
|
||||||
@Input() disabled: boolean
|
@HostBinding('class.disabled') @Input() disabled: boolean
|
||||||
@Input() text: string
|
@Input() text: string
|
||||||
private changed = new Array<(val: boolean) => void>()
|
private changed = new Array<(val: boolean) => void>()
|
||||||
|
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
$toggle-size: 18px;
|
$toggle-size: 18px;
|
||||||
$height: 30px;
|
$height: 30px;
|
||||||
$padding: 2px;
|
$padding: 2px;
|
||||||
cursor: pointer;
|
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
@@ -16,8 +15,11 @@
|
|||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
margin-left: -10px;
|
margin-left: -10px;
|
||||||
|
|
||||||
&[disabled] {
|
&.disabled {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,8 @@
|
|||||||
.list-group-item.d-flex.align-items-center(*ngFor='let plugin of pluginManager.installedPlugins')
|
.list-group-item.d-flex.align-items-center(*ngFor='let plugin of pluginManager.installedPlugins')
|
||||||
toggle(
|
toggle(
|
||||||
[ngModel]='isPluginEnabled(plugin)',
|
[ngModel]='isPluginEnabled(plugin)',
|
||||||
(ngModelChange)='togglePlugin(plugin)'
|
(ngModelChange)='togglePlugin(plugin)',
|
||||||
|
[disabled]='!canDisablePlugin(plugin)'
|
||||||
)
|
)
|
||||||
|
|
||||||
.mr-auto.d-flex.flex-column
|
.mr-auto.d-flex.flex-column
|
||||||
|
@@ -9,6 +9,8 @@ import { PluginInfo, PluginManagerService } from '../services/pluginManager.serv
|
|||||||
|
|
||||||
enum BusyState { Installing = 'Installing', Uninstalling = 'Uninstalling' }
|
enum BusyState { Installing = 'Installing', Uninstalling = 'Uninstalling' }
|
||||||
|
|
||||||
|
const FORCE_ENABLE = ['terminus-core', 'terminus-settings']
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Component({
|
@Component({
|
||||||
template: require('./pluginsSettingsTab.component.pug'),
|
template: require('./pluginsSettingsTab.component.pug'),
|
||||||
@@ -106,6 +108,10 @@ export class PluginsSettingsTabComponent {
|
|||||||
return !this.config.store.pluginBlacklist.includes(plugin.name)
|
return !this.config.store.pluginBlacklist.includes(plugin.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
canDisablePlugin (plugin: PluginInfo) {
|
||||||
|
return !FORCE_ENABLE.includes(plugin.packageName)
|
||||||
|
}
|
||||||
|
|
||||||
togglePlugin (plugin: PluginInfo) {
|
togglePlugin (plugin: PluginInfo) {
|
||||||
if (this.isPluginEnabled(plugin)) {
|
if (this.isPluginEnabled(plugin)) {
|
||||||
this.disablePlugin(plugin)
|
this.disablePlugin(plugin)
|
||||||
|
Reference in New Issue
Block a user