Skip to content
Snippets Groups Projects
Commit c0a70ff4 authored by Janet Goldstein's avatar Janet Goldstein
Browse files

WS-782: added completely fake, strictly cosmetic version selector as placeholder

parent 88251dcc
No related branches found
No related tags found
1 merge request!629WS-782: show version information on requests page
Pipeline #3551 passed
......@@ -16,32 +16,32 @@
* You should have received a copy of the GNU General Public License
* along with Workspaces. If not, see <https://www.gnu.org/licenses/>.
*/
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { ReactiveFormsModule } from "@angular/forms";
import {BrowserModule} from "@angular/platform-browser";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {ReactiveFormsModule} from "@angular/forms";
import {APP_INITIALIZER, NgModule} from "@angular/core";
import { HttpClientModule } from "@angular/common/http";
import {HttpClientModule} from "@angular/common/http";
import { AppComponent } from "./app.component";
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
import { WebAnalyticsService } from "./web-analytics/web-analytics.service";
import {AppComponent} from "./app.component";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";
import {WebAnalyticsService} from "./web-analytics/web-analytics.service";
import { HeaderComponent } from "./header/header.component";
import { FooterComponent } from "./footer/footer.component";
import { AppRoutingModule } from "./app-routing.module";
import { SplashComponent } from "./splash/splash.component";
import { SharedModule } from "./shared/shared.module";
import { AlertComponent } from "./shared/alert/alert.component";
import { TestDataService } from "./shared/test-data.service";
import {HeaderComponent} from "./header/header.component";
import {FooterComponent} from "./footer/footer.component";
import {AppRoutingModule} from "./app-routing.module";
import {SplashComponent} from "./splash/splash.component";
import {SharedModule} from "./shared/shared.module";
import {AlertComponent} from "./shared/alert/alert.component";
import {TestDataService} from "./shared/test-data.service";
import {VersionsComponent} from "./workspaces/components/capability-request/components/versions/versions.component";
export function initializeApp(testDataService: TestDataService) {
return (): Promise<any> => { return testDataService.Init(); }
}
@NgModule({
declarations: [AppComponent, HeaderComponent, FooterComponent, SplashComponent, AlertComponent],
declarations: [AppComponent, HeaderComponent, FooterComponent, SplashComponent, AlertComponent, VersionsComponent],
entryComponents: [],
imports: [
BrowserModule,
......
......@@ -33,7 +33,6 @@
>
</div>
<div *ngIf="this.capabilityRequest.current_execution !== null">
<!-- FIXME: Not currently implemented; there is no state "Awaiting QA" yet -->
<div
class="d-flex justify-content-center py-3"
*ngIf="
......@@ -53,7 +52,6 @@
</div>
<br />
<div id="qa-container" class="col-5">
<!-- FIXME: Not currently implemented; there is no state "Awaiting QA" yet -->
<div
class="d-flex justify-content-left py-3"
*ngIf="
......@@ -104,7 +102,21 @@
</div>
</div>
<div id="parameters-files-container" class="col-7">
<div id="parameters-files-versions-container" class="col-7">
<span id="versions-label">Versions</span>
<div id="versions-container" class="container fluid">
<form [formGroup]="form">
<div class="form-group">
<select id="versions-dropdown" class="custom-select">
<option *ngFor="let version of this.versionNumbers">{{version}}</option>
</select>
</div>
</form>
</div>
<br/>
<span id="parameters-label">Parameters</span>
<app-parameters
id="parameters"
......
......@@ -29,6 +29,7 @@ import { JsonObject } from "@angular/compiler-cli/ngcc/src/packages/entry_point"
import { Subject } from "rxjs";
import { takeUntil } from "rxjs/operators";
import { Capability } from "../../model/capability";
import {FormControl, FormGroup, Validators} from "@angular/forms";
@Component({
selector: "app-capability-request",
......@@ -40,9 +41,21 @@ export class CapabilityRequestComponent implements OnInit, OnDestroy {
public capability: Capability;
public capabilityExecution: CapabilityExecution;
public currentVersion: CapabilityVersion;
// public capabilityVersions: Array<CapabilityVersion> = [];
// TODO: for mockup only; IRL use capabilityVersions
public versionNumbers: Array<number> = [2, 1];
private ngUnsubscribe = new Subject(); // to signal when all subscribers should unsubscribe (triggered in tear down)
form = new FormGroup({
version: new FormControl('', Validators.required)
});
get f(){
return this.form.controls;
}
// Observer for capability request objects
private capabilityRequestObserver = {
next: (request) => {
......
<p>versions works!</p>
/*
* Copyright (C) 2021 Associated Universities, Inc. Washington DC, USA.
*
* This file is part of NRAO Workspaces.
*
* Workspaces is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Workspaces is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Workspaces. If not, see <https://www.gnu.org/licenses/>.
*/
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { VersionsComponent } from './versions.component';
describe('VersionsComponent', () => {
let component: VersionsComponent;
let fixture: ComponentFixture<VersionsComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ VersionsComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(VersionsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
/*
* Copyright (C) 2021 Associated Universities, Inc. Washington DC, USA.
*
* This file is part of NRAO Workspaces.
*
* Workspaces is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Workspaces is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Workspaces. If not, see <https://www.gnu.org/licenses/>.
*/
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-versions',
templateUrl: './versions.component.html',
styleUrls: ['./versions.component.scss']
})
export class VersionsComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment