diff --git a/src/app/chatbot/chatbot-launcher/chatbot-launcher.component.html b/src/app/chatbot/chatbot-launcher/chatbot-launcher.component.html new file mode 100644 index 00000000000..bf67f9dae7f --- /dev/null +++ b/src/app/chatbot/chatbot-launcher/chatbot-launcher.component.html @@ -0,0 +1,3 @@ + diff --git a/src/app/chatbot/chatbot-launcher/chatbot-launcher.component.spec.ts b/src/app/chatbot/chatbot-launcher/chatbot-launcher.component.spec.ts new file mode 100644 index 00000000000..83deeb79d83 --- /dev/null +++ b/src/app/chatbot/chatbot-launcher/chatbot-launcher.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ChatbotLauncherComponent } from './chatbot-launcher.component'; + +describe('ChatbotLauncherComponent', () => { + let component: ChatbotLauncherComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ChatbotLauncherComponent] + }).compileComponents(); + + fixture = TestBed.createComponent(ChatbotLauncherComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/chatbot/chatbot-launcher/chatbot-launcher.component.ts b/src/app/chatbot/chatbot-launcher/chatbot-launcher.component.ts new file mode 100644 index 00000000000..2fa022fcb3f --- /dev/null +++ b/src/app/chatbot/chatbot-launcher/chatbot-launcher.component.ts @@ -0,0 +1,17 @@ +import { Component, EventEmitter, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +@Component({ + selector: 'chatbot-launcher', + imports: [MatButtonModule, MatIconModule, MatTooltipModule], + templateUrl: './chatbot-launcher.component.html' +}) +export class ChatbotLauncherComponent { + @Output() toggleChatbot = new EventEmitter(); + + protected emitToggleChatbot(): void { + this.toggleChatbot.emit(); + } +} diff --git a/src/assets/wise5/directives/group-tabs/group-tabs.component.html b/src/assets/wise5/directives/group-tabs/group-tabs.component.html index 70c880376f1..34d76b943f5 100644 --- a/src/assets/wise5/directives/group-tabs/group-tabs.component.html +++ b/src/assets/wise5/directives/group-tabs/group-tabs.component.html @@ -1,10 +1,20 @@ - - @for (node of groupNodes; track node.id) { - - } - +
+ + @for (node of groupNodes; track node.id) { + + } + +
+ @if (notebookConfig?.itemTypes.note.enabled) { + + } + @if (chatbotEnabled) { + + } +
+
diff --git a/src/assets/wise5/directives/group-tabs/group-tabs.component.ts b/src/assets/wise5/directives/group-tabs/group-tabs.component.ts index 9c33e3275aa..54cf50c99e3 100644 --- a/src/assets/wise5/directives/group-tabs/group-tabs.component.ts +++ b/src/assets/wise5/directives/group-tabs/group-tabs.component.ts @@ -1,10 +1,12 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Subscription } from 'rxjs'; import { NodeStatusService } from '../../services/nodeStatusService'; import { StudentDataService } from '../../services/studentDataService'; import { VLEProjectService } from '../../vle/vleProjectService'; import { NodeService } from '../../services/nodeService'; import { MatTabsModule } from '@angular/material/tabs'; +import { NotebookLauncherComponent } from '../../../../app/notebook/notebook-launcher/notebook-launcher.component'; +import { ChatbotLauncherComponent } from '../../../../app/chatbot/chatbot-launcher/chatbot-launcher.component'; class GroupNode { id: string; @@ -14,12 +16,15 @@ class GroupNode { } @Component({ - imports: [MatTabsModule], + imports: [ChatbotLauncherComponent, MatTabsModule, NotebookLauncherComponent], selector: 'group-tabs', templateUrl: './group-tabs.component.html' }) export class GroupTabsComponent implements OnInit { + @Input() chatbotEnabled: boolean; + @Output() toggleChatbot = new EventEmitter(); protected groupNodes: GroupNode[] = []; + @Input() notebookConfig: any; protected selectedTabIndex: number; private subscriptions: Subscription = new Subscription(); @@ -68,4 +73,8 @@ export class GroupTabsComponent implements OnInit { const groupStartNodeId = this.groupNodes[groupTabIndex].startId; this.nodeService.setCurrentNode(groupStartNodeId); } + + protected emitToggleChatbot(): void { + this.toggleChatbot.emit(); + } } diff --git a/src/assets/wise5/themes/default/themeComponents/stepTools/step-tools.component.html b/src/assets/wise5/themes/default/themeComponents/stepTools/step-tools.component.html index d7a195810e9..a6b823e7bf4 100644 --- a/src/assets/wise5/themes/default/themeComponents/stepTools/step-tools.component.html +++ b/src/assets/wise5/themes/default/themeComponents/stepTools/step-tools.component.html @@ -77,9 +77,7 @@ } @if (chatbotEnabled) { - + } diff --git a/src/assets/wise5/themes/default/themeComponents/stepTools/step-tools.component.ts b/src/assets/wise5/themes/default/themeComponents/stepTools/step-tools.component.ts index 52520237b2d..9348d58b98e 100644 --- a/src/assets/wise5/themes/default/themeComponents/stepTools/step-tools.component.ts +++ b/src/assets/wise5/themes/default/themeComponents/stepTools/step-tools.component.ts @@ -14,10 +14,12 @@ import { ProjectService } from '../../../../services/projectService'; import { StudentDataService } from '../../../../services/studentDataService'; import { Subscription } from 'rxjs'; import { NotebookLauncherComponent } from '../../../../../../app/notebook/notebook-launcher/notebook-launcher.component'; +import { ChatbotLauncherComponent } from '../../../../../../app/chatbot/chatbot-launcher/chatbot-launcher.component'; @Component({ encapsulation: ViewEncapsulation.None, imports: [ + ChatbotLauncherComponent, CommonModule, FormsModule, MatButtonModule, diff --git a/src/assets/wise5/vle/vle.component.html b/src/assets/wise5/vle/vle.component.html index ca7676c76af..3303720ec91 100644 --- a/src/assets/wise5/vle/vle.component.html +++ b/src/assets/wise5/vle/vle.component.html @@ -10,6 +10,7 @@ (keydown.escape)="chatbotVisible = false" [(opened)]="chatbotVisible" class="sidebar" + [ngClass]="{ 'sidebar-tabbed': projectService.project.theme === 'tab' }" > @@ -58,12 +59,17 @@ +
-
@if (runEndedAndLocked) { diff --git a/src/assets/wise5/vle/vle.component.scss b/src/assets/wise5/vle/vle.component.scss index ead5498b6a6..74b96cf0cd7 100644 --- a/src/assets/wise5/vle/vle.component.scss +++ b/src/assets/wise5/vle/vle.component.scss @@ -12,7 +12,7 @@ $tab-bar-height: 48px; right: 0; } -step-tools { +step-tools, group-tabs { display: block; position: fixed; left: 0; @@ -34,32 +34,16 @@ step-tools { top: variables.$toolbar-height + variables.$secondary-toolbar-height; } -.node-view { - &.tabbed { - position: absolute; - top: variables.$toolbar-height; - margin: 0; - bottom: 0; - } -} - .tabbed { - padding: 0; + top: variables.$toolbar-height + variables.$secondary-toolbar-height + 8px; } group-tabs { - position: absolute; - width: 100%; + height: auto; } .tab-content { - top: $tab-bar-height + 1; - position: absolute; - left: 0; - right: 0; - bottom: 0; - overflow-y: auto; - padding-bottom: 104px; + padding-bottom: 64px; } node, navigation { @@ -119,4 +103,8 @@ run-ended-and-locked-message { .sidebar { top: variables.$toolbar-height + variables.$secondary-toolbar-height + 2; + + &.sidebar-tabbed { + top: variables.$toolbar-height + variables.$secondary-toolbar-height + 8px; + } }