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

Commit

Permalink
TTOOLS-426 Mods to utilize connection schema
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrillin committed May 16, 2018
1 parent bcfa0a1 commit 97a07f3
Show file tree
Hide file tree
Showing 47 changed files with 1,258 additions and 1,696 deletions.
1 change: 1 addition & 0 deletions ngapp/package.json
Expand Up @@ -24,6 +24,7 @@
"@angular/platform-browser": "^4.4.6",
"@angular/platform-browser-dynamic": "^4.4.6",
"@angular/router": "^4.4.6",
"angular-tree-component": "^7.1.0",
"core-js": "^2.5.3",
"express": "^4.16.2",
"file-saver": "1.3.3",
Expand Down

This file was deleted.

89 changes: 0 additions & 89 deletions ngapp/src/app/connections/shared/connection-table.model.ts

This file was deleted.

14 changes: 7 additions & 7 deletions ngapp/src/app/connections/shared/connection.service.ts
Expand Up @@ -18,10 +18,10 @@
import { Injectable } from "@angular/core";
import { Http, RequestOptions } from "@angular/http";
import { ConnectionStatus } from "@connections/shared/connection-status";
import { ConnectionTable } from "@connections/shared/connection-table.model";
import { ConnectionType } from "@connections/shared/connection-type.model";
import { ConnectionsConstants } from "@connections/shared/connections-constants";
import { NewConnection } from "@connections/shared/new-connection.model";
import { SchemaNode } from "@connections/shared/schema-node.model";
import { ServiceCatalogSource } from "@connections/shared/service-catalog-source.model";
import { ApiService } from "@core/api.service";
import { AppSettingsService } from "@core/app-settings.service";
Expand Down Expand Up @@ -213,18 +213,18 @@ export class ConnectionService extends ApiService {
}

/**
* Get the tables for the specified connection. The connection must be ACTIVE, otherwise the tables
* Get the schema for the specified connection. The connection must be ACTIVE, otherwise the schema
* will be empty.
* @param {string} connectionId the connection id
* @returns {Observable<ConnectionTable[]>}
* @returns {Observable<SchemaNode[]>}
*/
public getConnectionTables(connectionId: string): Observable<ConnectionTable[]> {
public getConnectionSchema(connectionId: string): Observable<SchemaNode[]> {
return this.http
.get( environment.komodoWorkspaceUrl + ConnectionsConstants.connectionsRootPath
+ "/" + connectionId + "/tables", this.getAuthRequestOptions())
+ "/" + connectionId + "/schema", this.getAuthRequestOptions())
.map((response) => {
const connTables = response.json();
return connTables.map((connTable) => ConnectionTable.create( connTable ));
const schemaNodes = response.json();
return schemaNodes.map((schemaNode) => SchemaNode.create( schemaNode ));
})
.catch( ( error ) => this.handleError( error ) );
}
Expand Down
2 changes: 2 additions & 0 deletions ngapp/src/app/connections/shared/connections-constants.ts
Expand Up @@ -36,6 +36,8 @@ export class ConnectionsConstants {
public static readonly connectionTypeDescription_mongodb = "MongoDB database";
public static readonly connectionTypeDescription_mariadb = "MariaDB database";

public static readonly schemaNodeType_connection = "connection";

public static readonly includeConnectionParameter = "include-connection";
public static readonly includeSchemaStatusParameter = "include-schema-status";

Expand Down
105 changes: 0 additions & 105 deletions ngapp/src/app/connections/shared/jdbc-table-filter.model.ts

This file was deleted.

14 changes: 7 additions & 7 deletions ngapp/src/app/connections/shared/mock-connection.service.ts
Expand Up @@ -17,10 +17,10 @@

import { Injectable, ReflectiveInjector } from "@angular/core";
import { Http } from "@angular/http";
import { ConnectionTable } from "@connections/shared/connection-table.model";
import { Connection } from "@connections/shared/connection.model";
import { ConnectionService } from "@connections/shared/connection.service";
import { NewConnection } from "@connections/shared/new-connection.model";
import { SchemaNode } from "@connections/shared/schema-node.model";
import { ServiceCatalogSource } from "@connections/shared/service-catalog-source.model";
import { AppSettingsService } from "@core/app-settings.service";
import { LoggerService } from "@core/logger.service";
Expand All @@ -39,7 +39,7 @@ export class MockConnectionService extends ConnectionService {

private connections: Connection[];
private readonly serviceCatalogSources: ServiceCatalogSource[];
private connectionTableMap = new Map<string, ConnectionTable[]>();
private connectionSchemaMap = new Map<string, SchemaNode[]>();
private testDataService: TestDataService;

constructor( http: Http, vdbService: VdbService, notifierService: NotifierService,
Expand All @@ -58,7 +58,7 @@ export class MockConnectionService extends ConnectionService {
}
this.connections = conns;
this.serviceCatalogSources = this.testDataService.getServiceCatalogSources();
this.connectionTableMap = this.testDataService.getConnectionTableMap();
this.connectionSchemaMap = this.testDataService.getConnectionSchemaMap();
}

public isValidName( name: string ): Observable< string > {
Expand Down Expand Up @@ -120,12 +120,12 @@ export class MockConnectionService extends ConnectionService {
}

/**
* Get the tables for the specified Connection
* Get the root SchemaNodes for the specified Connection
* @param {string} connectionName the connection name
* @returns {Observable<ConnectionTable[]>}
* @returns {Observable<SchemaNode[]>}
*/
public getConnectionTables( connectionName: string ): Observable< ConnectionTable[] > {
return Observable.of( this.connectionTableMap.get( connectionName ) );
public getConnectionSchema( connectionName: string ): Observable< SchemaNode[] > {
return Observable.of( this.connectionSchemaMap.get( connectionName ) );
}

/**
Expand Down

0 comments on commit 97a07f3

Please sign in to comment.