Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 94299200CAF for ; Thu, 22 Jun 2017 15:16:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 90798160C00; Thu, 22 Jun 2017 13:16:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 68925160BE7 for ; Thu, 22 Jun 2017 15:16:29 +0200 (CEST) Received: (qmail 85165 invoked by uid 500); 22 Jun 2017 13:16:28 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 85149 invoked by uid 99); 22 Jun 2017 13:16:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2017 13:16:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 71B7EDFE8B; Thu, 22 Jun 2017 13:16:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ababiichuk@apache.org To: commits@ambari.apache.org Date: Thu, 22 Jun 2017 13:16:29 -0000 Message-Id: <29c0b8a6d93f48c4bc9d3510ffd1deea@git.apache.org> In-Reply-To: <5b3766cfe9e640b39d908db741ebdc83@git.apache.org> References: <5b3766cfe9e640b39d908db741ebdc83@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/21] ambari git commit: AMBARI-21310 Log Search UI: Provide ability to use mocked data for api calls (akovalenko) archived-at: Thu, 22 Jun 2017 13:16:30 -0000 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 Authored: Tue Apr 11 14:01:25 2017 +0300 Committer: ababiichuk 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 @@ + +

{{title}}

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. + */