Upgraded to bazel 3.7.2 and rules_nodejs 2.3.2
Change-Id: If53686f2475c4f367909de577b4da95de8e16768
(cherry picked from commit 436c60a1f65d3c7dbdbd664c7b0e65f5362ef24d)
diff --git a/web/gui2-fw-lib/BUILD.bazel b/web/gui2-fw-lib/BUILD.bazel
index 30df3be..cbf7358 100644
--- a/web/gui2-fw-lib/BUILD.bazel
+++ b/web/gui2-fw-lib/BUILD.bazel
@@ -14,9 +14,8 @@
limitations under the License.
"""
-load("@npm_angular_bazel//:index.bzl", "ng_module", "ng_package")
-load("@npm_bazel_typescript//:index.bzl", "ts_library")
-load("@npm_bazel_karma//:index.bzl", "karma_web_test")
+load("@npm//@bazel/typescript:index.bzl", "ts_library")
+load("@npm//@bazel/karma:index.bzl", "karma_web_test")
package(default_visibility = ["//:__subpackages__"])
@@ -28,7 +27,7 @@
"@npm//@angular/forms",
]
-ng_module(
+ts_library(
name = "gui2-fw-lib",
srcs = glob(
include = [
@@ -39,17 +38,22 @@
"**/*.spec.ts",
],
),
- assets = glob([
+ angular_assets = glob([
"lib/**/*.css",
"lib/**/*.html",
]),
- entry_point = ":public_api.ts",
+ module_name = "org_onosproject_onos/web/gui2-fw-lib",
+ # entry_point = ":public_api.ts",
tsconfig = "//web/gui2:tsconfig.json",
+ use_angular_plugin = True,
deps = [
"@npm//@angular/animations",
"@npm//@angular/common",
+ "@npm//@angular/compiler-cli",
+ "@npm//@angular/core",
"@npm//@angular/platform-browser",
"@npm//@angular/router",
+ "@npm//@bazel/typescript",
"@npm//d3",
"@npm//rxjs",
],
@@ -105,18 +109,12 @@
],
)
-# bazel run //web/gui2-fw-lib:npm_package.pack to create a tgz
-ng_package(
- name = "npm_package",
- srcs = ["package.json"],
- data = glob([
- "**/*.css",
- "**/*.html",
- ]),
- entry_point = ":public_api.ts",
- include_devmode_srcs = False,
- readme_md = ":README.md",
- deps = [
- ":gui2-fw-lib",
+filegroup(
+ name = "extra_css",
+ srcs = [
+ "lib/widget/panel.css",
+ "lib/widget/panel-theme.css",
+ "lib/widget/table.css",
+ "lib/widget/table.theme.css",
],
)
diff --git a/web/gui2-fw-lib/lib/remote/websocket.service.ts b/web/gui2-fw-lib/lib/remote/websocket.service.ts
index 93020f0..c45e23f 100644
--- a/web/gui2-fw-lib/lib/remote/websocket.service.ts
+++ b/web/gui2-fw-lib/lib/remote/websocket.service.ts
@@ -187,7 +187,7 @@
let ev: EventType;
let h;
try {
- ev = JSON.parse(msgEvent.data);
+ ev = JSON.parse(msgEvent.data.toString()) as EventType;
} catch (e) {
this.log.error('Message.data is not valid JSON', msgEvent.data, e);
return null;
diff --git a/web/gui2-fw-lib/lib/widget/detailspanel.base.ts b/web/gui2-fw-lib/lib/widget/detailspanel.base.ts
index 97efee6..e61b1f2 100644
--- a/web/gui2-fw-lib/lib/widget/detailspanel.base.ts
+++ b/web/gui2-fw-lib/lib/widget/detailspanel.base.ts
@@ -18,7 +18,7 @@
import { WebSocketService } from '../remote/websocket.service';
import { PanelBaseImpl } from './panel.base';
-import { Output, EventEmitter, Input } from '@angular/core';
+import { InjectionToken, Inject, Component, Output, EventEmitter, Input } from '@angular/core';
/**
* A generic model of the data returned from the *DetailsResponse
@@ -27,6 +27,8 @@
details: any;
}
+export const TAG = new InjectionToken<string>('tag');
+
/**
* Extends the PanelBase abstract class specifically for showing details
*
@@ -35,6 +37,9 @@
*
* This replaces the detailspanel service in the old gui
*/
+@Component({
+ template: ''
+})
export abstract class DetailsPanelBaseImpl extends PanelBaseImpl {
@Input() id: string;
@@ -51,7 +56,7 @@
protected fs: FnService,
protected log: LogService,
protected wss: WebSocketService,
- protected tag: string,
+ @Inject(TAG) protected tag: string,
) {
super(fs, log);
this.root = tag + 's';