diff --git a/terminus-core/src/components/checkbox.component.ts b/terminus-core/src/components/checkbox.component.ts index cb8b30c6..46a3d532 100644 --- a/terminus-core/src/components/checkbox.component.ts +++ b/terminus-core/src/components/checkbox.component.ts @@ -17,7 +17,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' }) export class CheckboxComponent implements ControlValueAccessor { @HostBinding('class.active') @Input() model: boolean - @Input() disabled: boolean + @HostBinding('class.disabled') @Input() disabled: boolean @Input() text: string private changed = new Array<(val: boolean) => void>() diff --git a/terminus-core/src/components/toggle.component.scss b/terminus-core/src/components/toggle.component.scss index b7ae7fbc..bc1ed495 100644 --- a/terminus-core/src/components/toggle.component.scss +++ b/terminus-core/src/components/toggle.component.scss @@ -3,7 +3,6 @@ $toggle-size: 18px; $height: 30px; $padding: 2px; - cursor: pointer; display: inline-flex; overflow: visible; border-radius: 3px; @@ -16,8 +15,11 @@ padding-left: 10px; margin-left: -10px; - &[disabled] { + &.disabled { opacity: 0.5; } + * { + cursor: pointer; + } } diff --git a/terminus-plugin-manager/src/components/pluginsSettingsTab.component.pug b/terminus-plugin-manager/src/components/pluginsSettingsTab.component.pug index 2345a363..1c522607 100644 --- a/terminus-plugin-manager/src/components/pluginsSettingsTab.component.pug +++ b/terminus-plugin-manager/src/components/pluginsSettingsTab.component.pug @@ -12,7 +12,8 @@ .list-group-item.d-flex.align-items-center(*ngFor='let plugin of pluginManager.installedPlugins') toggle( [ngModel]='isPluginEnabled(plugin)', - (ngModelChange)='togglePlugin(plugin)' + (ngModelChange)='togglePlugin(plugin)', + [disabled]='!canDisablePlugin(plugin)' ) .mr-auto.d-flex.flex-column diff --git a/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts b/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts index f07fd677..d56162c0 100644 --- a/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts +++ b/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts @@ -9,6 +9,8 @@ import { PluginInfo, PluginManagerService } from '../services/pluginManager.serv enum BusyState { Installing = 'Installing', Uninstalling = 'Uninstalling' } +const FORCE_ENABLE = ['terminus-core', 'terminus-settings'] + /** @hidden */ @Component({ template: require('./pluginsSettingsTab.component.pug'), @@ -106,6 +108,10 @@ export class PluginsSettingsTabComponent { return !this.config.store.pluginBlacklist.includes(plugin.name) } + canDisablePlugin (plugin: PluginInfo) { + return !FORCE_ENABLE.includes(plugin.packageName) + } + togglePlugin (plugin: PluginInfo) { if (this.isPluginEnabled(plugin)) { this.disablePlugin(plugin)