Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bat Mírialta Drawer Beside Story #535

Merged
merged 3 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="group">
<div class="batmirialtaHeader">
<div>
{{ ts.l.batmirialta }}
An Bat Mírialta
</div>
<div class="closeBatmirialtaBtn" (click)="closeEmitter.next(true)">
<i class="fa fa-times"></i>
</div>
</div>
<iframe src="https://bat-mirialta.abair.ie" frameborder="0">
</iframe>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.batmirialtaHeader {
width: 100%;
padding: 25px;
height: 30px;
background-color: var(--scealai-green);
color: white;
display: flex;
align-items: center;
}

.group {
height: 100%;
width: 100%;
margin: none;
padding: none;
display: flex;
flex-flow: column;
}

.closeBatmirialtaBtn {
margin-left: auto;
}

.closeBatmirialtaBtn:hover {
cursor: pointer;
}

iframe {
flex: 1 1 auto;
}

:host {
overflow: hidden;
}

// .textFieldContainer {
// width: 100%;
// resize: none;
// z-index: 1;
// color: var(--dark-text);
// background: white;
// padding-left: 20px;
// padding-right: 20px;
// padding-top: 10px;
// }
//
// .textField {
// width: 100%;
// resize: none;
// z-index: 1;
// color: var(--dark-text);
// background: white;
// padding-left: 20px;
// padding-right: 20px;
// padding-top: 10px;
// border: none;
// }
//
// .audioPlayer {
// height: 30px;
// width: 90%;
// background-color: #f1f3f4;
// border: 1px solid #8c806e86;
// }
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';

import { BatMirialtaDrawerComponent } from './batmirialta-drawer.component';

describe('BatMirialtaDrawerComponent', () => {
let component: BatmirialtaDrawerComponent;
let fixture: ComponentFixture<BatmirialtaDrawerComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ HttpClientTestingModule ],
declarations: [ BatMirialtaDrawerComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(BatMirialtaDrawerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Component, OnInit, Output, EventEmitter, Input } from "@angular/core";
import { TranslationService } from "app/core/services/translation.service";
import { StoryService } from "app/core/services/story.service";
import { EngagementService } from "app/core/services/engagement.service";
import { NotificationService } from "app/core/services/notification-service.service";
import { DomSanitizer, SafeUrl } from "@angular/platform-browser";
import { Story } from "app/core/models/story";
import { EventType } from "app/core/models/event";

@Component({
selector: "app-bat-mirialta-drawer",
templateUrl: "./bat-mirialta-drawer.component.html",
styleUrls: ["./bat-mirialta-drawer.component.scss"],
})
export class BatMirialtaDrawerComponent implements OnInit {
@Output() closeEmitter = new EventEmitter();
@Input() story: Story;
@Input() hasBatmirialta: boolean;
audioSource: SafeUrl | null = null;

constructor(
protected ts: TranslationService,
protected sanitizer: DomSanitizer,
private storyService: StoryService,
private engagement: EngagementService,
private notificationService: NotificationService
) {}

ngOnInit(): void {}

ngOnChanges(changes: any) {
if (!this.hasBatmirialta) {
this.closeEmitter.next(true)
}
}
}
16 changes: 16 additions & 0 deletions ngapp/src/app/student/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@
<i class="fas fa-spell-check optionsBtnIcon"></i>
</div>

<!-- BAT MIRIALTA -->
<div
class="optionsBtn optionsPopupBtn"
[class.optionsBtnClicked]="rightDrawerOpened && selectedDrawer == 'bat-mirialta'"
(click)="dontToggle = true; toggleRightDrawer('bat-mirialta')"
>
{{ ts.l.batmirialta}}
An Bat Mírialta
<i class="fas fa-spell-check optionsBtnIcon"></i>
</div>

<!-- DICTIONARY -->
<div
class="optionsBtn optionsPopupBtn"
Expand Down Expand Up @@ -191,5 +202,10 @@
[checkBoxes]="checkBoxes"
(closeGrammarEmitter)="toggleRightDrawer('grammar')"
></app-grammar-error-drawer>
<app-bat-mirialta-drawer
*ngIf="selectedDrawer == 'bat-mirialta'"
(closeEmitter)="toggleRightDrawer('bat-mirialta')"
>
</app-bat-mirialta-drawer>
</mat-drawer>
</mat-drawer-container>
2 changes: 1 addition & 1 deletion ngapp/src/app/student/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class DashboardComponent implements OnInit {
dontToggle = false;
@ViewChild("rightDrawer") rightDrawer: MatDrawer;
rightDrawerOpened: boolean = false;
selectedDrawer: "grammar" | "dictionary" | "feedback" | "synthesis" = "grammar";
selectedDrawer: "grammar" | "dictionary" | "feedback" | "synthesis" | "bat-mirialta" = "grammar";

// WORD COUNT
words: string[] = [];
Expand Down
2 changes: 2 additions & 0 deletions ngapp/src/app/student/student.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { StoryDrawerComponent } from './story-drawer/story-drawer.component';
import { DictionaryDrawerComponent } from './dictionary-drawer/dictionary-drawer.component';
import { GrammarErrorDrawerComponent } from './grammar-error-drawer/grammar-error-drawer.component';
import { FeedbackDrawerComponent } from './feedback-drawer/feedback-drawer.component';
import { BatMirialtaDrawerComponent } from './bat-mirialta-drawer/bat-mirialta-drawer.component';
import { SynthesisDrawerComponent } from './synthesis-drawer/synthesis-drawer.component';
import { HomePageComponent } from './home-page/home-page.component';

Expand Down Expand Up @@ -45,6 +46,7 @@ import { SafeHtmlPipe } from 'app/core/pipes/safe-html.pipe';
DictionaryDrawerComponent,
GrammarErrorDrawerComponent,
FeedbackDrawerComponent,
BatMirialtaDrawerComponent,
SynthesisDrawerComponent,
HomePageComponent
],
Expand Down
Loading