Merge "Document cleanup & remove authguard token error message"
This commit is contained in:
commit
b443f72924
@ -102,6 +102,9 @@ export class AppComponent implements OnInit, WSReceiver {
|
||||
this.updateDashboards(message.dashboards);
|
||||
}
|
||||
break;
|
||||
case 'keepalive':
|
||||
Log.Debug(new LogMessage('Keepalive message received in app', this.className, message));
|
||||
break;
|
||||
default:
|
||||
Log.Debug(new LogMessage('Uncategorized message received in app', this.className, message));
|
||||
break;
|
||||
|
@ -12,3 +12,20 @@
|
||||
# limitations under the License.
|
||||
*/
|
||||
|
||||
/* add border & center the table */
|
||||
.documentBorder {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
border-spacing: 10px;
|
||||
border:1px gray solid;
|
||||
border-radius: 5px;
|
||||
align-self: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Document Pull">
|
||||
<br>
|
||||
<button type="button" class="btn btn-info" id="DocPullBtn" (click)="documentPull()" style="width: 150px;">Document Pull</button>
|
||||
<p>Response to Pull: {{statusMsg}}</p>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
<h1>Airship Document Operations</h1>
|
||||
<div class="container">
|
||||
<div class="documentBorder">
|
||||
<button type="button" class="btn btn-info" id="DocPullBtn" (click)="documentPull()">Document Pull</button> Response: {{statusMsg}}
|
||||
</div>
|
||||
</div>
|
@ -14,10 +14,7 @@
|
||||
|
||||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import {DocumentComponent} from './document.component';
|
||||
import {MatTabsModule} from '@angular/material/tabs';
|
||||
import {MatButtonModule} from '@angular/material/button';
|
||||
import { ToastrModule } from 'ngx-toastr';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
describe('DocumentComponent', () => {
|
||||
let component: DocumentComponent;
|
||||
@ -26,10 +23,7 @@ describe('DocumentComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
MatTabsModule,
|
||||
MatButtonModule,
|
||||
ToastrModule.forRoot(),
|
||||
BrowserAnimationsModule
|
||||
],
|
||||
declarations: [DocumentComponent]
|
||||
})
|
||||
|
@ -41,8 +41,10 @@ export class DocumentComponent implements WSReceiver {
|
||||
this.websocketService.printIfToast(message);
|
||||
} else {
|
||||
switch (message.subComponent) {
|
||||
case 'docPull':
|
||||
this.statusMsg = 'Message pull was a ' + message.message;
|
||||
case 'pull':
|
||||
this.statusMsg = 'Document pull was a ' + message.message;
|
||||
const button = (document.getElementById('DocPullBtn') as HTMLInputElement);
|
||||
button.removeAttribute('disabled');
|
||||
break;
|
||||
default:
|
||||
Log.Error(new LogMessage('Document message sub component not handled', this.className, message));
|
||||
@ -52,6 +54,9 @@ export class DocumentComponent implements WSReceiver {
|
||||
}
|
||||
|
||||
documentPull(): void {
|
||||
this.statusMsg = '';
|
||||
this.websocketService.sendMessage(new WebsocketMessage(this.type, this.component, 'pull'));
|
||||
const button = (document.getElementById('DocPullBtn') as HTMLInputElement);
|
||||
button.setAttribute('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
|
@ -13,17 +13,13 @@
|
||||
*/
|
||||
|
||||
import {NgModule} from '@angular/core';
|
||||
import {MatTabsModule} from '@angular/material/tabs';
|
||||
import {DocumentComponent} from './document.component';
|
||||
import {MatButtonModule} from '@angular/material/button';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
DocumentComponent,
|
||||
],
|
||||
imports: [
|
||||
MatTabsModule,
|
||||
MatButtonModule,
|
||||
],
|
||||
providers: [],
|
||||
})
|
||||
|
@ -73,7 +73,6 @@ export class AuthGuard implements WSReceiver, CanActivate {
|
||||
async receiver(message: WebsocketMessage): Promise<void> {
|
||||
if (message.hasOwnProperty('error')) {
|
||||
Log.Error(new LogMessage('Error received in AuthGuard', this.className, message));
|
||||
this.websocketService.printIfToast(message);
|
||||
AuthGuard.logout();
|
||||
} else {
|
||||
switch (message.subComponent) {
|
||||
|
@ -67,7 +67,7 @@ func (c *Client) docPull() (*string, error) {
|
||||
// so setting to false
|
||||
err := pull.Pull(cfgFactory, false)
|
||||
if err == nil {
|
||||
s := fmt.Sprintf("Success")
|
||||
s := "Success"
|
||||
message = &s
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user