Skip to content

Commit

Permalink
#95 ui and backend skeleton implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
martonsagi committed Apr 1, 2021
1 parent 9c63793 commit a35ce17
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 8 deletions.
12 changes: 12 additions & 0 deletions vscode-extension/src/Services/WebPanelCommandService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,17 @@ export class WebPanelCommandService {
await this.excelService.export(entries);
WebPanel.postMessage(null);
}

async GetConfigurationCommand(message: IMessageBase) {
// TODO
let setting = false;
WebPanel.postMessage({ Command: 'GetConfiguration', setting});
}

async SetConfigurationCommand(message: IMessageBase) {
// TODO
//let setting = message.Data as boolean;
//
WebPanel.postMessage({Command: 'SetConfiguration', Data: null});
}
}
18 changes: 14 additions & 4 deletions web-ui/src/resources/elements/toolbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,22 @@
<i class="fas fa-minus"></i> <span class="d-none d-lg-inline">Scenario</span></button>
</li>
<li>
<button class="btn btn-outline-secondary my-2 my-sm-0">
<i class="fas fa-play"></i> <span class="d-none d-lg-inline" title="Run Tests">Run Tests</span></button>
<button class="btn btn-outline-secondary my-2 my-sm-0" title="Run Tests">
<i class="fas fa-play"></i> <span class="d-none d-lg-inline">Run Tests</span></button>
</li>
<li>
<button class="btn btn-outline-secondary my-2 my-sm-0" click.delegate="sendCommand('Export')">
<i class="fas fa-file-excel"></i> <span class="d-none d-lg-inline" title="Export to Excel">Export</span></button>
<button class="btn btn-outline-secondary my-2 my-sm-0" click.delegate="sendCommand('Export')" title="Export to Excel">
<i class="fas fa-file-excel"></i> <span class="d-none d-lg-inline">Export</span></button>
</li>
<li>
<div class="btn-group-toggle my-2 my-sm-0" data-toggle="buttons" title="No Confirmation">
<label class="btn ${(noConfirmations ? 'btn-outline-success' : 'btn-outline-secondary')}">
<span show.bind="noConfirmations"><i class="fas fa-check-square"></i></span>
<span show.bind="!noConfirmations"><i class="far fa-square"></i></span>
<span class="d-none d-lg-inline">No Confirmation</span>
<input type="checkbox" value.bind="noConfirmations" checked.bind="noConfirmations">
</label>
</div>
</li>
</ul>
<a class="navbar-brand" href="#">ATDD.TestScriptor</a>
Expand Down
31 changes: 27 additions & 4 deletions web-ui/src/resources/elements/toolbar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { EventAggregator } from 'aurelia-event-aggregator';
import { CommandHandlerService } from "backend/CommandHandlerService";
import { BackendService } from 'services/backend-service';
import { autoinject, bindable } from "aurelia-framework";

@autoinject()
Expand All @@ -8,10 +7,34 @@ export class Toolbar {
@bindable()
searchValue: string;

constructor(private commandHandlerService: CommandHandlerService) {
@bindable()
noConfirmations: boolean = false;

loaded: boolean = false;

constructor(private backendService: BackendService) {
}

async attached() {
try {
let currentSetting = await this.sendCommand('GetConfiguration');
this.noConfirmations = currentSetting;
} catch {
console.log('GetConfiguration call is not yet implemented');
}

this.loaded = true;
}

async sendCommand(command: string, data?: any) {
await this.commandHandlerService.dispatch(command, data);
return await this.backendService.send({ Command: command, Data: data });
}

noConfirmationsChanged(newValue: boolean) {
if (this.loaded !== true) {
return;
}

this.sendCommand('SetConfiguration', newValue);
}
}

0 comments on commit a35ce17

Please sign in to comment.