Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 29d962e

Browse files
authoredApr 9, 2024··
Merge pull request #39 from oss-slu/Issue#33
fixes issue #33 Webpage for Gaussian Data
2 parents c61079f + c05e3a6 commit 29d962e

11 files changed

+918
-95
lines changed
 

‎frontend/orca_data_converter/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To u
2525
## Further help
2626

2727
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
28+
29+
## Client's Request for Gaussian Webpage
30+
31+
The ORCA and Gaussian websites should be very similar or perhaps even merged if possible.
32+
The types of data needed are going to be very similar, the only difference will be the formatting of the text in the output files.
33+
The suggestion would be to try and duplicate the orca website with the gaussian website.
34+
It might be easier to select the output file type (ORCA or Gaussian) on the same page, and then use the same code to do the text extraction.

‎frontend/orca_data_converter/src/app/app-routing.module.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { NgModule } from '@angular/core';
22
import { RouterModule, Routes } from '@angular/router';
3-
import { Dashboard1Component } from './views/dashboard1/dashboard1.component';
3+
import { DashboardComponent } from './views/dashboard/dashboard.component';
4+
import { GaussianDashboardComponent } from './views/gaussianDashboard/gaussianDashboard.component';
45

56
const routes: Routes = [
6-
{ path: 'home1', component: Dashboard1Component }
7+
{ path: 'orca', component: DashboardComponent },
8+
{ path: 'gaussian', component: GaussianDashboardComponent },
9+
{ path: '', redirectTo: 'orca', pathMatch: 'full' }
710
];
811

912
@NgModule({
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
<div class="filter-wrapper row" *ngIf="dashboard == '/' ">
2-
<div class="col-md-3 offset-md-3">
3-
<app-dashboard appendTo="body" [options]="options" (onPanelHide)="onPanelHide($event)"></app-dashboard>
4-
</div>
5-
</div>
61
<router-outlet></router-outlet>

‎frontend/orca_data_converter/src/app/app.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import { Component, OnInit } from '@angular/core';
22
import {HttpClient} from '@angular/common/http';
33
import {firstValueFrom} from 'rxjs';
4+
import { Router } from '@angular/router';
45

56
@Component({
67
selector: 'app-root',
78
templateUrl: './app.component.html',
89
styleUrls: ['./app.component.css']
910
})
1011
export class AppComponent implements OnInit {
11-
dashboard:any;
12+
dashboard:string;
1213

1314

14-
constructor(private http: HttpClient) {
15-
this.dashboard = window.location.pathname
15+
constructor(private http: HttpClient, private router: Router) {
16+
this.dashboard = this.router.url;
1617
}
1718

1819
async ngOnInit(): Promise<void> {

‎frontend/orca_data_converter/src/app/app.module.ts

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { BrowserAnimationsModule }
66
from "@angular/platform-browser/animations";
77
import { AppRoutingModule } from './app-routing.module';
88
import { AppComponent } from './app.component';
9+
import { GaussianDashboardComponent } from './views/gaussianDashboard/gaussianDashboard.component';
910
import { DashboardComponent } from './views/dashboard/dashboard.component';
1011
import { MultiSelectModule } from "primeng/multiselect";
1112
import { Dashboard1Component } from './views/dashboard1/dashboard1.component';
@@ -14,6 +15,7 @@ import { HttpClientModule } from "@angular/common/http";
1415
@NgModule({
1516
declarations: [
1617
AppComponent,
18+
GaussianDashboardComponent,
1719
DashboardComponent,
1820
Dashboard1Component
1921
],

‎frontend/orca_data_converter/src/app/views/dashboard/dashboard.component.html

-83
This file was deleted.

‎frontend/orca_data_converter/src/app/views/dashboard/dashboard.component.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ interface BrandsGroup {
1818

1919
@Component({
2020
selector: 'app-dashboard',
21-
templateUrl: './dashboard.component.html',
22-
styleUrls: ['./dashboard.component.css']
21+
templateUrl: '../dashboardView/dashboardView.component.html',
22+
styleUrls: ['../dashboardView/dashboardView.component.css']
2323
})
2424

2525
export class DashboardComponent implements OnInit{
2626

27+
fileType = 'ORCA';
28+
fileExtension = '.txt';
2729
brandGroups: BrandsGroup[] = [];
2830
selectedBrands: Brand[] = [];
2931
public fileName: string;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<div id="whole">
2+
<h2>Convert {{ fileType }} files to Word documents</h2>
3+
<h3>Upload your {{ fileType }} data file</h3>
4+
<div class="background-image"></div>
5+
<div>
6+
<input type="file" (change)="onFileSelected($event)" [accept]="fileExtension">
7+
<button class="Submit" (click)="onUpload()">Submit</button>
8+
</div>
9+
<div>
10+
<h3>Enter the terms you wish to search for (txt only):</h3>
11+
<div class="keyterms-search">
12+
<form action="localhost:4200/" method="POST">
13+
<input type="text" placeholder="E.g., CARTESIAN COORDINATES" id="keyTerms-toSearch" />
14+
</form>
15+
</div>
16+
</div>
17+
<div>
18+
<h3>Enter how you want the lines specified:</h3>
19+
<div class="linesSpecified_search">
20+
<form action="localhost:4200/" method="POST">
21+
<input type="text" placeholder="E.g., WHOLE, FIRST X, LAST X" id="linesSpecified-toSearch" />
22+
</form>
23+
</div>
24+
</div>
25+
<div>
26+
<h3>Number of sections?</h3>
27+
<div class="sections_search">
28+
<form action="localhost:4200/" method="POST">
29+
<input type="text" placeholder="Input as number..." id="sections-toSearch" />
30+
</form>
31+
</div>
32+
</div>
33+
<div>
34+
<h3>Use total lines?</h3>
35+
<div class="useTotalLines_search">
36+
<form action="localhost:4200/" method="POST">
37+
<input type="text" placeholder="TRUE/FALSE" id="useTotalLines-toSearch" />
38+
</form>
39+
</div>
40+
</div>
41+
<div>
42+
<h3>Total number of lines for output doc?</h3>
43+
<div class="totalLines_search">
44+
<form action="localhost:4200/" method="POST">
45+
<input type="text" placeholder="Input as number..." id="totalLines-toSearch" />
46+
</form>
47+
</div>
48+
</div>
49+
<div>
50+
<button id="downloadButton" value="Download" type="button" (click)="runBackend()">Convert</button>
51+
</div>
52+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { TestBed } from '@angular/core/testing';
2+
import { RouterTestingModule } from '@angular/router/testing';
3+
import { AppComponent } from '../../app.component';
4+
5+
describe('AppComponent', () => {
6+
beforeEach(async () => {
7+
await TestBed.configureTestingModule({
8+
imports: [
9+
RouterTestingModule
10+
],
11+
declarations: [
12+
AppComponent
13+
],
14+
}).compileComponents();
15+
});
16+
17+
it('should create the app', () => {
18+
const fixture = TestBed.createComponent(AppComponent);
19+
const app = fixture.componentInstance;
20+
expect(app).toBeTruthy();
21+
});
22+
23+
it(`should have as title 'example'`, () => {
24+
const fixture = TestBed.createComponent(AppComponent);
25+
const app = fixture.componentInstance;
26+
expect(app.title).toEqual('example');
27+
});
28+
29+
it('should render title', () => {
30+
const fixture = TestBed.createComponent(AppComponent);
31+
fixture.detectChanges();
32+
const compiled = fixture.nativeElement as HTMLElement;
33+
expect(compiled.querySelector('.content span')?.textContent).toContain('example app is running!');
34+
});
35+
});

‎frontend/orca_data_converter/src/app/views/gaussianDashboard/gaussianDashboard.component.ts

+809
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.