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

Commit

Permalink
Changed dataservice list detail to match connection list detail. Also…
Browse files Browse the repository at this point in the history
… refactored dataservice detail from basic content.
  • Loading branch information
tejones committed Apr 2, 2018
1 parent bc1f500 commit 7041554
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 56 deletions.
@@ -1,4 +1,3 @@
<div class="object-card-body-title">Properties</div>
<pfng-list
class="properties-group"
[config]="listConfig"
Expand Down

This file was deleted.

This file was deleted.

@@ -0,0 +1,12 @@
<pfng-list
class="properties-group"
[config]="listConfig"
[itemTemplate]="itemTemplate"
[items]="properties">
<ng-template #itemTemplate let-item="item">
<div class="dataservices-details-properties">
<div class="property-name">{{ item[ 0 ] }}</div>
<div class="property-value">{{ item[ 1 ] }}</div>
</div>
</ng-template>
</pfng-list>
@@ -0,0 +1,59 @@
/**
* @license
* Copyright 2017 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Component, Input, OnInit, ViewEncapsulation } from "@angular/core";
import { Dataservice } from "@dataservices/shared/dataservice.model";
import { ListConfig } from "patternfly-ng";
import { DataservicesConstants } from "../shared/dataservices-constants";

@Component({
encapsulation: ViewEncapsulation.None,
selector: "app-dataservices-details",
templateUrl: "dataservices-details.component.html"
})
export class DataservicesDetailsComponent implements OnInit {
@Input() public item: Dataservice;

public listConfig: ListConfig;

constructor() {
// nothing to do
}

public ngOnInit(): void {
this.listConfig = {
dblClick: false,
multiSelect: false,
selectItems: false,
showCheckbox: false,
useExpandItems: false
};
}

/**
* @returns {string[][]} the properties of a dataservice
*/
public get properties(): string[][] {
const props = [
[ DataservicesConstants.dataserviceNameLabel, this.item.getId() ],
[ DataservicesConstants.descriptionLabel, this.item.getDescription() ]
];

return props;
}

}
Expand Up @@ -31,3 +31,8 @@ a.list-pf-title.view-name {
color: var(--card-body-color);
margin-left: 10px !important;
}

.dataservices-details-properties {
padding-left: 40px;
}

Expand Up @@ -75,7 +75,7 @@
</pfng-action>
</ng-template>
<ng-template #expandTemplate let-item="item" let-index="index">
<app-basic-content [item]="item" *ngIf="item.expandId === undefined"></app-basic-content>
<app-dataservices-details class="dataservices-details-properties" [item]="item" *ngIf="item.expandId === undefined"></app-dataservices-details>
<app-views-content [item]="item" *ngIf="item.expandId === 'views'"></app-views-content>
</ng-template>
</pfng-list>
Expand Down
@@ -1,7 +1,7 @@
import { async, ComponentFixture, TestBed } from "@angular/core/testing";
import { RouterTestingModule } from "@angular/router/testing";
import { LoggerService } from "@core/logger.service";
import { BasicContentComponent } from "@dataservices/dataservices-list/basic-content.component";
import { DataservicesDetailsComponent } from "@dataservices/dataservices-list/dataservices-details.component";
import { DataservicesListComponent } from "@dataservices/dataservices-list/dataservices-list.component";
import { ViewsContentComponent } from "@dataservices/dataservices-list/views-content.component";
import { PatternFlyNgModule } from "patternfly-ng";
Expand All @@ -13,7 +13,7 @@ describe("DataservicesListComponent", () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ PatternFlyNgModule, RouterTestingModule ],
declarations: [ BasicContentComponent, DataservicesListComponent, ViewsContentComponent ],
declarations: [ DataservicesDetailsComponent, DataservicesListComponent, ViewsContentComponent ],
providers: [ LoggerService ]
})
.compileComponents().then(() => {
Expand Down
4 changes: 2 additions & 2 deletions ngapp/src/app/dataservices/dataservices.component.spec.ts
Expand Up @@ -10,7 +10,7 @@ import { CoreModule } from "@core/core.module";
import { MockAppSettingsService } from "@core/mock-app-settings.service";
import { DataserviceCardComponent } from "@dataservices/dataservices-cards/dataservice-card/dataservice-card.component";
import { DataservicesCardsComponent } from "@dataservices/dataservices-cards/dataservices-cards.component";
import { BasicContentComponent } from "@dataservices/dataservices-list/basic-content.component";
import { DataservicesDetailsComponent } from "@dataservices/dataservices-list/dataservices-details.component";
import { DataservicesListComponent } from "@dataservices/dataservices-list/dataservices-list.component";
import { ViewsContentComponent } from "@dataservices/dataservices-list/views-content.component";
import { DataservicesComponent } from "@dataservices/dataservices.component";
Expand All @@ -34,7 +34,7 @@ describe("DataservicesComponent", () => {
TestBed.configureTestingModule({
imports: [ CoreModule, FormsModule, HttpModule, ModalModule.forRoot(), PatternFlyNgModule,
RouterTestingModule, SharedModule, CodemirrorModule ],
declarations: [ BasicContentComponent,
declarations: [ DataservicesDetailsComponent,
DataservicesComponent,
DataservicesListComponent,
DataservicesCardsComponent,
Expand Down
4 changes: 2 additions & 2 deletions ngapp/src/app/dataservices/dataservices.module.ts
Expand Up @@ -24,7 +24,7 @@ import { AppSettingsService } from "@core/app-settings.service";
import { CoreModule } from "@core/core.module";
import { LoggerService } from "@core/logger.service";
import { DataservicesCardsComponent } from "@dataservices/dataservices-cards/dataservices-cards.component";
import { BasicContentComponent } from "@dataservices/dataservices-list/basic-content.component";
import { DataservicesDetailsComponent } from "@dataservices/dataservices-list/dataservices-details.component";
import { DataservicesListComponent } from "@dataservices/dataservices-list/dataservices-list.component";
import { ViewsContentComponent } from "@dataservices/dataservices-list/views-content.component";
import { DataservicesRoutingModule } from "@dataservices/dataservices-routing.module";
Expand Down Expand Up @@ -61,7 +61,7 @@ import { TestDataserviceComponent } from "./test-dataservice/test-dataservice.co
CodemirrorModule
],
declarations: [
BasicContentComponent,
DataservicesDetailsComponent,
ViewsContentComponent,
DataservicesCardsComponent,
DataservicesComponent,
Expand Down
3 changes: 3 additions & 0 deletions ngapp/src/app/dataservices/shared/dataservices-constants.ts
Expand Up @@ -29,6 +29,9 @@ export class DataservicesConstants {
public static readonly testDataserviceRoute = DataservicesConstants.dataservicesRootRoute + "/test-dataservice";
public static readonly testDataservicePath = DataservicesConstants.dataservicesRootPath + "/test-dataservice";

public static dataserviceNameLabel = "Name";
public static descriptionLabel = "Description";

public static readonly dataservicesNavItem: NavigationItemConfig = {
title: "Data Services",
iconStyleClass: "fa fa-fw fa-table",
Expand Down

0 comments on commit 7041554

Please sign in to comment.