You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2017/06/22 13:16:29 UTC

[02/21] ambari git commit: AMBARI-21310 Log Search UI: Provide ability to use mocked data for api calls (akovalenko)

AMBARI-21310 Log Search UI: Provide ability to use mocked data for api calls (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4ce2f2c5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4ce2f2c5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4ce2f2c5

Branch: refs/heads/branch-feature-logsearch-ui
Commit: 4ce2f2c528c62a7f2651381df17630a86e104c1b
Parents: da6ea9f
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Tue Apr 11 14:01:25 2017 +0300
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Thu Jun 22 14:53:24 2017 +0300

----------------------------------------------------------------------
 .../ambari-logsearch-web-new/.angular-cli.json  |  3 +-
 .../ambari-logsearch-web-new/package.json       |  3 ++
 .../src/app/app.component.html                  | 17 +++++++++
 .../src/app/app.component.less                  | 16 +++++++++
 .../src/app/app.component.spec.ts               | 18 ++++++++++
 .../src/app/app.component.ts                    | 21 ++++++++++-
 .../src/app/app.module.ts                       | 38 ++++++++++++++++----
 .../src/app/mock-api-data.service.ts            | 25 +++++++++++++
 .../src/environments/environment.prod.ts        | 18 ++++++++++
 .../src/environments/environment.ts             | 21 ++++++++---
 .../ambari-logsearch-web-new/src/styles.less    | 18 +++++++++-
 11 files changed, 184 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce2f2c5/ambari-logsearch/ambari-logsearch-web-new/.angular-cli.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/.angular-cli.json b/ambari-logsearch/ambari-logsearch-web-new/.angular-cli.json
index 7b5c13b..03c5382 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/.angular-cli.json
+++ b/ambari-logsearch/ambari-logsearch-web-new/.angular-cli.json
@@ -19,7 +19,8 @@
       "testTsconfig": "tsconfig.spec.json",
       "prefix": "app",
       "styles": [
-        "styles.less"
+        "styles.less",
+        "../node_modules/bootstrap/dist/css/bootstrap.min.css"
       ],
       "scripts": [],
       "environmentSource": "environments/environment.ts",

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce2f2c5/ambari-logsearch/ambari-logsearch-web-new/package.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/package.json b/ambari-logsearch/ambari-logsearch-web-new/package.json
index f13d358..01ac4be 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/package.json
+++ b/ambari-logsearch/ambari-logsearch-web-new/package.json
@@ -19,7 +19,9 @@
     "@angular/platform-browser": "^4.0.0",
     "@angular/platform-browser-dynamic": "^4.0.0",
     "@angular/router": "^4.0.0",
+    "bootstrap": "^3.3.7",
     "core-js": "^2.4.1",
+    "ngx-bootstrap": "^1.6.6",
     "rxjs": "^5.1.0",
     "zone.js": "^0.8.4"
   },
@@ -28,6 +30,7 @@
     "@angular/compiler-cli": "^4.0.0",
     "@types/jasmine": "2.5.38",
     "@types/node": "~6.0.60",
+    "angular-in-memory-web-api": "^0.3.1",
     "codelyzer": "~2.0.0",
     "jasmine-core": "~2.5.2",
     "jasmine-spec-reporter": "~3.2.0",

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce2f2c5/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.html b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.html
index b6931b5..85b96dc 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.html
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.html
@@ -1,3 +1,20 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+
 <h1>
   {{title}}
 </h1>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce2f2c5/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.less b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.less
index e69de29..2944f98 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.less
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.less
@@ -0,0 +1,16 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce2f2c5/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.spec.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.spec.ts
index c740bcd..d57f9c4 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.spec.ts
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 { TestBed, async } from '@angular/core/testing';
 
 import { AppComponent } from './app.component';

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce2f2c5/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.ts
index 3ffdc2e..5f59b8e 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.ts
@@ -1,10 +1,29 @@
-import { Component } from '@angular/core';
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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} from '@angular/core';
 
 @Component({
   selector: 'app-root',
   templateUrl: './app.component.html',
   styleUrls: ['./app.component.less']
 })
+
 export class AppComponent {
   title = 'Ambari Log Search';
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce2f2c5/ambari-logsearch/ambari-logsearch-web-new/src/app/app.module.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.module.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.module.ts
index 67ae491..34b7978 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.module.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.module.ts
@@ -1,9 +1,30 @@
-import { BrowserModule } from '@angular/platform-browser';
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { HttpModule } from '@angular/http';
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 { AppComponent } from './app.component';
+import {BrowserModule} from '@angular/platform-browser';
+import {NgModule} from '@angular/core';
+import {FormsModule} from '@angular/forms';
+import {HttpModule} from '@angular/http';
+import {InMemoryWebApiModule} from 'angular-in-memory-web-api';
+import {mockApiDataService} from './mock-api-data.service'
+import {AlertModule} from 'ngx-bootstrap';
+
+import {AppComponent} from './app.component';
 
 @NgModule({
   declarations: [
@@ -12,9 +33,12 @@ import { AppComponent } from './app.component';
   imports: [
     BrowserModule,
     FormsModule,
-    HttpModule
+    HttpModule,
+    InMemoryWebApiModule.forRoot(mockApiDataService),
+    AlertModule.forRoot()
   ],
   providers: [],
   bootstrap: [AppComponent]
 })
-export class AppModule { }
+export class AppModule {
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce2f2c5/ambari-logsearch/ambari-logsearch-web-new/src/app/mock-api-data.service.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/mock-api-data.service.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/mock-api-data.service.ts
new file mode 100644
index 0000000..da32c7e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/mock-api-data.service.ts
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 {InMemoryDbService} from 'angular-in-memory-web-api';
+
+export class mockApiDataService implements InMemoryDbService {
+  createDb() {
+    return {};
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce2f2c5/ambari-logsearch/ambari-logsearch-web-new/src/environments/environment.prod.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/environments/environment.prod.ts b/ambari-logsearch/ambari-logsearch-web-new/src/environments/environment.prod.ts
index 3612073..690ddb1 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/environments/environment.prod.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/environments/environment.prod.ts
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
 export const environment = {
   production: true
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce2f2c5/ambari-logsearch/ambari-logsearch-web-new/src/environments/environment.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/environments/environment.ts b/ambari-logsearch/ambari-logsearch-web-new/src/environments/environment.ts
index b7f639a..e34c67c 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/environments/environment.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/environments/environment.ts
@@ -1,7 +1,20 @@
-// The file contents for the current environment will overwrite these during build.
-// The build system defaults to the dev environment which uses `environment.ts`, but if you do
-// `ng build --env=prod` then `environment.prod.ts` will be used instead.
-// The list of which env maps to which file can be found in `.angular-cli.json`.
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
 
 export const environment = {
   production: false

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce2f2c5/ambari-logsearch/ambari-logsearch-web-new/src/styles.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/styles.less b/ambari-logsearch/ambari-logsearch-web-new/src/styles.less
index 90d4ee0..5d5f1e3 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/styles.less
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/styles.less
@@ -1 +1,17 @@
-/* You can add global styles to this file, and also import other style files */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */