Commit 4b78a672 authored by Anusha Mamidala's avatar Anusha Mamidala
Browse files

Merge branch 'dev_ui' into main

parents f92557e8 75ff5293
# Balaswecha
# BalaSwecha
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.0.2.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.0.
## Development
- [ ] Download Node on your machine `https://nodejs.org/en/download/`
......@@ -9,7 +10,6 @@ This project was generated with [Angular CLI](https://github.com/angular/angular
- [ ] Run the web app using `ng serve`
- [ ] Run the desktop app using `npm run desktop`
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
......
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
"balaswecha": {
"BalaSwecha": {
"projectType": "application",
"schematics": {},
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
......@@ -16,7 +17,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/balaswecha",
"outputPath": "dist/BalaSwecha",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
......@@ -27,13 +28,9 @@
"src/assets"
],
"styles": [
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
"src/styles.scss"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
]
"scripts": []
},
"configurations": {
"production": {
......@@ -68,18 +65,18 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "balaswecha:build"
"browserTarget": "BalaSwecha:build"
},
"configurations": {
"production": {
"browserTarget": "balaswecha:build:production"
"browserTarget": "BalaSwecha:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "balaswecha:build"
"browserTarget": "BalaSwecha:build"
}
},
"test": {
......@@ -94,13 +91,9 @@
"src/assets"
],
"styles": [
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
"src/styles.scss"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
]
"scripts": []
}
},
"lint": {
......@@ -120,16 +113,16 @@
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "balaswecha:serve"
"devServerTarget": "BalaSwecha:serve"
},
"configurations": {
"production": {
"devServerTarget": "balaswecha:serve:production"
"devServerTarget": "BalaSwecha:serve:production"
}
}
}
}
}
},
"defaultProject": "balaswecha"
"defaultProject": "BalaSwecha"
}
......@@ -13,19 +13,13 @@ module.exports = function (config) {
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/balaswecha'),
dir: require('path').join(__dirname, './coverage/BalaSwecha'),
subdir: '.',
reporters: [
{ type: 'html' },
......
This diff is collapsed.
{
"name": "balaswecha",
"name": "bala-swecha",
"version": "0.0.0",
"main": "main.js",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"electron": "electron ./src/electron.dev",
"desktop": "concurrently \"ng serve\" \"npm run electron\""
"e2e": "ng e2e"
},
"private": false,
"private": true,
"dependencies": {
"@angular/animations": "~11.2.0",
"@angular/common": "~11.2.0",
"@angular/compiler": "~11.2.0",
"@angular/core": "~11.2.0",
"@angular/forms": "~11.2.0",
"@angular/platform-browser": "~11.2.0",
"@angular/platform-browser-dynamic": "~11.2.0",
"@angular/router": "~11.2.0",
"bootstrap": "^4.6.0",
"bootstrap-icons": "^1.4.0",
"jquery": "^3.6.0",
"@angular/animations": "~11.0.1",
"@angular/common": "~11.0.1",
"@angular/compiler": "~11.0.1",
"@angular/core": "~11.0.1",
"@angular/forms": "~11.0.1",
"@angular/platform-browser": "~11.0.1",
"@angular/platform-browser-dynamic": "~11.0.1",
"@angular/router": "~11.0.1",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.3"
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1102.0",
"@angular/cli": "~11.2.0",
"@angular/compiler-cli": "~11.2.0",
"@angular-devkit/build-angular": "~0.1100.2",
"@angular/cli": "~11.0.2",
"@angular/compiler-cli": "~11.0.1",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"concurrently": "^6.0.0",
"electron": "^12.0.1",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.1.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
......@@ -48,6 +40,6 @@
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.1.2"
"typescript": "~4.0.2"
}
}
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from "@angular/platform-browser";
import { DomSanitizer } from '@angular/platform-browser';
@Pipe({
name: 'safe'
})
export class SafePipe implements PipeTransform {
constructor(private sanitizer: DomSanitizer) { }
transform(url) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
......
import { TestBed } from '@angular/core/testing';
import { SimulationService } from './simulation.service';
describe('SimulationService', () => {
let service: SimulationService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(SimulationService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class CourseService {
private _jsonURL = 'assets/course-data.json';
export class SimulationService {
private _jsonURL = 'assets/simulation-data.json';
constructor(private http: HttpClient) {
}
public getJSON(): Observable<any> {
return this.http.get(this._jsonURL);
}
}
export interface Course {
export interface Simulation {
simID: string;
category: string;
name: string;
desc: string;
img_src: string;
url: string;
class: number[];
......
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { Routes, RouterModule } from '@angular/router';
import { FrameComponent } from 'src/app/components/Core/frame/frame.component';
import { SimulationsComponent } from 'src/app/components/Core/simulations/simulations.component';
import { Error404Component } from 'src/app/components/error404/error404.component';
import { HomeComponent } from 'src/app/components/home/home.component';
import { SimulationsComponent } from 'src/app/components/simulations/simulations.component';
import { VideoSimulationComponent } from 'src/app/components/video-simulation/video-simulation.component';
const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{
path: 'home', component: HomeComponent
},
{ path: 'home', component: HomeComponent },
{ path: 'home/:subject', component: SimulationsComponent },
{
path: 'videos/:simUrl', component: VideoSimulationComponent,
path: 'simulation/:simUrl', component: FrameComponent,
},
{
path: 'home/:subject', component: SimulationsComponent
}
{ path: '', redirectTo: 'home', pathMatch: 'full' },
// { path: '**', component: Error404Component }
];
@NgModule({
......
<app-header></app-header>
<router-outlet></router-outlet>
\ No newline at end of file
<router-outlet></router-outlet>
<app-footer></app-footer>
\ No newline at end of file
......@@ -20,16 +20,16 @@ describe('AppComponent', () => {
expect(app).toBeTruthy();
});
it(`should have as title 'balaswecha'`, () => {
it(`should have as title 'BalaSwecha'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('balaswecha');
expect(app.title).toEqual('BalaSwecha');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement;
expect(compiled.querySelector('.content span').textContent).toContain('balaswecha app is running!');
expect(compiled.querySelector('.content span').textContent).toContain('BalaSwecha app is running!');
});
});
......@@ -3,9 +3,8 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'balaswecha';
appsList = ["../assets/atomic-interactions_en.html", "../assets/balancing-act_en.html"]
title = 'BalaSwecha';
}
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SafePipe } from './safe.pipe';
import { HeaderComponent } from 'src/app/components/header/header.component';
import { FooterComponent } from 'src/app/components/footer/footer.component';
import { HomeComponent } from 'src/app/components/home/home.component';
import { SimulationsComponent } from 'src/app/components/simulations/simulations.component';
import { VideoSimulationComponent } from 'src/app/components/video-simulation/video-simulation.component';
import { Error404Component } from 'src/app/components/error404/error404.component';
import { SafePipe } from './Pipes/safe.pipe';
import { SimulationsComponent } from 'src/app/components/Core/simulations/simulations.component';
import { FrameComponent } from 'src/app/components/Core/frame/frame.component';
@NgModule({
declarations: [
AppComponent,
SafePipe,
HeaderComponent,
FooterComponent,
HomeComponent,
Error404Component,
SafePipe,
SimulationsComponent,
VideoSimulationComponent
FrameComponent
],
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
HttpClientModule
],
providers: [],
bootstrap: [AppComponent]
......
......@@ -3,5 +3,10 @@
width: 100%;
height: calc(100vh - 20vh);
border: none;
margin-left: 250px;
margin-top: 100px;
}
.iframe-container {
overflow: hidden;
padding-top: 56.25%; /* 16:9*/
position: relative;
}
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { VideoSimulationComponent } from './video-simulation.component';
import { FrameComponent } from './frame.component';
describe('VideoSimulationComponent', () => {
let component: VideoSimulationComponent;
let fixture: ComponentFixture<VideoSimulationComponent>;
describe('FrameComponent', () => {
let component: FrameComponent;
let fixture: ComponentFixture<FrameComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ VideoSimulationComponent ]
declarations: [ FrameComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(VideoSimulationComponent);
fixture = TestBed.createComponent(FrameComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
......
......@@ -2,18 +2,19 @@ import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-video-simulation',
templateUrl: './video-simulation.component.html',
styleUrls: ['./video-simulation.component.css']
selector: 'app-frame',
templateUrl: './frame.component.html',
styleUrls: ['./frame.component.scss']
})
export class VideoSimulationComponent implements OnInit {
export class FrameComponent implements OnInit {
item: any;
constructor(private route: ActivatedRoute) { }
ngOnInit(): void {
let id = this.route.snapshot.paramMap.get('simUrl');
this.item = "../assets/simulation-files/" + id + ".html";
console.log(this.item)
// console.log(this.item)
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment