Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

Commit

Permalink
TTOOLS-500
Browse files Browse the repository at this point in the history
  • Loading branch information
blafond committed Oct 22, 2018
1 parent 2fd02d0 commit 5b0dcd0
Show file tree
Hide file tree
Showing 15 changed files with 691 additions and 587 deletions.
4 changes: 3 additions & 1 deletion src/main/ngapp/src/app/dataservices/dataservices.module.ts
Expand Up @@ -77,6 +77,7 @@ import { CreateViewsDialogComponent } from './create-views-dialog/create-views-d
import { SetDescriptionDialogComponent } from "@dataservices/set-description-dialog/set-description-dialog.component";
import { PropertyEditorComponent } from './virtualization/view-editor/view-property-editors/property-editor/property-editor.component';
import { ProjectedColumnsEditorComponent } from './virtualization/view-editor/view-property-editors/projected-columns-editor/projected-columns-editor.component';
import { ViewsListComponent} from './virtualization/view-editor/views-list/views-list.component';

@NgModule({
imports: [
Expand Down Expand Up @@ -133,7 +134,8 @@ import { ProjectedColumnsEditorComponent } from './virtualization/view-editor/vi
CreateViewsDialogComponent,
SetDescriptionDialogComponent,
PropertyEditorComponent,
ProjectedColumnsEditorComponent
ProjectedColumnsEditorComponent,
ViewsListComponent
],
providers: [
{
Expand Down
Expand Up @@ -171,6 +171,8 @@ export class CanvasService {
}

public clear(): void {
if (this.canvasGraph == null)
return;
this.canvasGraph.clear();
}

Expand Down
Expand Up @@ -4,8 +4,8 @@
#view-editor-canvas-editor {
display: grid;
grid-template-areas:
"canvas-editor properties-editor";
grid-template-columns: 50fr 50fr;
"views-list-panel canvas-editor properties-editor";
grid-template-columns: 20fr 50fr 30fr;
height: 100%;
}

Expand All @@ -17,6 +17,13 @@
grid-area: canvas-editor;
}

/*
* Views List Panel
*/
#views-list-container {
grid-area: views-list-panel;
}

/*
* Configures the alert when view has no sources.
*/
Expand Down
@@ -1,5 +1,10 @@
<div id="view-editor-canvas-editor">

<div class="view-editor-area"
id="views-list-container">
<app-views-list></app-views-list>
</div>

<!-- ============================ -->
<!-- ========== Canvas ========== -->
<!-- ============================ -->
Expand Down
Expand Up @@ -21,12 +21,15 @@ import { VdbService } from "@dataservices/shared/vdb.service";
import { MockVdbService } from "@dataservices/shared/mock-vdb.service";
import { NotifierService } from "@dataservices/shared/notifier.service";
import { ViewPropertyEditorsComponent } from "@dataservices/virtualization/view-editor/view-property-editors/view-property-editors.component";
import { TabsModule } from "ngx-bootstrap";
import { TabsModule} from "ngx-bootstrap";
import { GraphVisualComponent, LinkVisualComponent, NodeVisualComponent } from "@dataservices/virtualization/view-editor/view-canvas/visuals";
import { CanvasService } from "@dataservices/virtualization/view-editor/view-canvas/canvas.service";
import { SelectionService } from "@core/selection.service";
import { PropertyEditorComponent } from "@dataservices/virtualization/view-editor/view-property-editors/property-editor/property-editor.component";
import { ProjectedColumnsEditorComponent } from "@dataservices/virtualization/view-editor/view-property-editors/projected-columns-editor/projected-columns-editor.component";
import { ViewsListComponent } from "@dataservices/virtualization/view-editor/views-list/views-list.component";
import { BsModalService } from "ngx-bootstrap";
import { Dataservice } from "@dataservices/shared/dataservice.model";

describe('ViewCanvasComponent', () => {
let component: ViewCanvasComponent;
Expand Down Expand Up @@ -54,9 +57,11 @@ describe('ViewCanvasComponent', () => {
ProjectedColumnsEditorComponent,
PropertyEditorComponent,
ViewCanvasComponent,
ViewPropertyEditorsComponent
ViewPropertyEditorsComponent,
ViewsListComponent
],
providers: [
BsModalService,
{ provide: AppSettingsService, useClass: MockAppSettingsService },
{ provide: DataserviceService, useClass: MockDataserviceService },
CanvasService,
Expand All @@ -75,6 +80,14 @@ describe('ViewCanvasComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(ViewCanvasComponent);
component = fixture.componentInstance;

const selService = TestBed.get( SelectionService );
const ds: Dataservice = new Dataservice();
ds.setId("testDs");
ds.setServiceVdbName("testDsVdb");
// noinspection JSUnusedAssignment
selService.setSelectedVirtualization( ds );

fixture.detectChanges();
});

Expand Down
Expand Up @@ -77,7 +77,7 @@ export class NodeVisualComponent {

public get icon(): string {
if (this.node.type === CanvasConstants.SOURCE_TYPE)
return "/assets/graphicsfuel/database-64.png";
return "/assets/table.png";
else if (this.node.type === CanvasConstants.COMPOSITION_TYPE)
return "/assets/composition.png";

Expand Down
@@ -1,110 +1,7 @@
/*
* The view description textarea.
*/
#view-editor-header-description-input {
max-width: max-content;
min-height: 20px;
min-width: 400px;
vertical-align: top;
}

.list-pf-container {
-ms-flex-align: start;
align-items: flex-start;
display: -ms-flexbox;
display: flex;
padding: 0;
}

.view-table-div {
padding-left: 0;
padding-right: 0;
margin-bottom: 5px;
min-height: 70px;
max-height: 70px;
border: 1px inset grey;
overflow-y: auto;
}

.view-editor-header-name-input {
padding-left: 0;
padding-right: 5px;
}

.view-editor-header-create-button {
margin-left: 0;
padding-left: 0;
padding-top: 8px;
}

.view-editor-header-delete-button {
padding-left: 0;
padding-top: 8px;
}

.view-editor-header-description-area {
padding-left: 0;
margin-left: 0;
}

/*
* A div containing an input field in the header.
*/
.view-editor-header-input-div {
margin: 1px;
padding: 1px;
}

/*
* A type for the header title
*/
.view-editor-header-title {
margin-left: 10px;
}

/*
* A type for vertically aligned labels in the header.
*/
.view-editor-header-label {
margin: 2px;
padding: 2px;
}

/*
* The checkbox that shows/hides the virtualization description.
*/
#view-editor-header-show-description {
margin-right: 4px;
}

/*
* The label for the checkbox that shows/hides the view description.
*/
#view-editor-header-show-description-label {
margin-top: 2px;
text-align: left;
}

/*
* The label where the virtualization name is the content.
*/
#view-editor-header-virtualization-name {
text-align: left;
}

/*
* Style the empty state component so that it is centered and extends the entire width.
*/
#view-editor-header-table .blank-slate-pf {
background-color: inherit;
min-width: 200px;
border: none;
padding: 0;
}

/*
* Style text in blank slate for table
*/
#view-editor-header-table h1, .h1 {
font-size: 14px;
}
Expand Up @@ -4,57 +4,7 @@
<!-- Virtualization name -->
<!-- =================== -->
<div class="view-editor-header-title">
<h4>Virtualization Name: '{{virtualizationName}}'</h4>
</div>

<!-- ========= -->
<!-- View name -->
<!-- ========= -->
<div class="form-group">
<div class="col-sm-1">
<span class="pull-right"><strong>Views:</strong></span>
</div>
<div class="col-sm-2 view-table-div" id="view-editor-header-table" [hidden]="viewsLoading">
<pfng-table
[columns]="tableColumns"
[config]="tableConfig"
[dataTableConfig]="ngxTableConfig"
(onSelect)="viewSelectionChanged($event)"
[rows]="tableRows">
</pfng-table>
</div>
<!-- Show spinner while fetching views -->
<div class="col-sm-2" [hidden]="!viewsLoading">
<div class="spinner spinner-inline"></div>
</div>

<div class="col-sm-1">
<div class="col-sm-12 pull-left view-editor-header-create-button">
<button i18n="@@viewEditorHeader.addText" class="btn btn-primary btn-sm" (click)="onCreateView()">Create</button>
</div>
<div class="col-sm-12 pull-left view-editor-header-delete-button">
<button i18n="@@viewEditorHeader.deleteText" class="btn btn-danger btn-sm"
(click)="onDeleteView()" [disabled]="!deleteViewButtonEnabled">Delete</button>
</div>
</div>

<!-- ================ -->
<!-- View description -->
<!-- ================ -->
<div class="col-sm-6 pull-left view-editor-header-description-area">
<span>{{viewDescriptionLabel}}</span>
<textarea class="form-control"
id="view-editor-header-description-input"
name="view-editor-header-description-input"
placeholder={{viewDescriptionPlaceholder}}
[(ngModel)]="viewDescription"
[readonly]="readOnly"
(input)="viewDescriptionChanged($event.target.value)"
rows="1"
maxlength="256"
title="">
</textarea>
</div>
<h4>Virtualization Name: <strong>{{virtualizationName}}</strong></h4>
</div>

</form>

0 comments on commit 5b0dcd0

Please sign in to comment.