2023-04-10 15:36:59 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2022-09-22 14:58:52 +00:00
|
|
|
// @ts-check
|
|
|
|
import Component from '@glimmer/component';
|
2023-01-10 21:35:53 +00:00
|
|
|
import { action } from '@ember/object';
|
|
|
|
import { tracked } from '@glimmer/tracking';
|
2022-09-22 14:58:52 +00:00
|
|
|
|
|
|
|
export default class TaskContextSidebarComponent extends Component {
|
|
|
|
get isSideBarOpen() {
|
|
|
|
return !!this.args.task;
|
|
|
|
}
|
|
|
|
|
|
|
|
keyCommands = [
|
|
|
|
{
|
|
|
|
label: 'Close Task Logs Sidebar',
|
|
|
|
pattern: ['Escape'],
|
|
|
|
action: () => this.args.fns.closeSidebar(),
|
|
|
|
},
|
|
|
|
];
|
2023-01-10 21:35:53 +00:00
|
|
|
|
2023-01-17 17:08:41 +00:00
|
|
|
narrowCommand = {
|
|
|
|
label: 'Narrow Sidebar',
|
|
|
|
pattern: ['ArrowRight', 'ArrowRight'],
|
|
|
|
action: () => this.toggleWide(),
|
|
|
|
};
|
|
|
|
|
|
|
|
widenCommand = {
|
|
|
|
label: 'Widen Sidebar',
|
|
|
|
pattern: ['ArrowLeft', 'ArrowLeft'],
|
|
|
|
action: () => this.toggleWide(),
|
|
|
|
};
|
|
|
|
|
2023-01-10 21:35:53 +00:00
|
|
|
@tracked wide = false;
|
|
|
|
@action toggleWide() {
|
|
|
|
this.wide = !this.wide;
|
|
|
|
}
|
2022-09-22 14:58:52 +00:00
|
|
|
}
|