浏览代码

HUE-9460 [ui] HiveQueryPlan - Split Vue component and web-component wrapper (sree)

sreenaths 5 年之前
父节点
当前提交
307cdec392

+ 1 - 1
desktop/core/src/desktop/js/apps/jobBrowser/app.js

@@ -15,7 +15,7 @@
 // limitations under the License.
 
 import huePubSub from 'utils/huePubSub';
-import './components/hiveQueryPlan.vue';
+import './components/hiveQueryPlan/webcomp';
 
 huePubSub.subscribe('app.dom.loaded', app => {
   if (app !== 'jobbrowser') {

+ 0 - 26
desktop/core/src/desktop/js/apps/jobBrowser/components/hiveQueryPlan.vue

@@ -1,26 +0,0 @@
-<template>
-  <div class="query-plan">
-    {{ title }}
-  </div>
-</template>
-
-<script lang="ts">
-  import Vue from 'vue';
-  import { wrap } from 'vue/webComponentWrapper';
-  import Component from 'vue-class-component';
-
-  export const HIVE_QUERY_PLAN_COMPONENT = 'hive-query-plan';
-
-  @Component
-  export default class HiveQueryPlan extends Vue {
-    title: string = 'Web Component';
-  }
-
-  wrap(HIVE_QUERY_PLAN_COMPONENT, HiveQueryPlan);
-</script>
-
-<style lang="scss" scoped>
-  .query-plan {
-    color: #0a78a3;
-  }
-</style>

+ 39 - 0
desktop/core/src/desktop/js/apps/jobBrowser/components/hiveQueryPlan/HiveQueryPlan.vue

@@ -0,0 +1,39 @@
+<!--
+  Licensed to Cloudera, Inc. under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  Cloudera, Inc. 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.
+-->
+
+<template>
+  <div class="query-plan">
+    {{ title }}
+  </div>
+</template>
+
+<script lang="ts">
+  import Vue from 'vue';
+  import Component from 'vue-class-component';
+
+  @Component
+  export default class HiveQueryPlan extends Vue {
+    title: string = 'Web Component';
+  }
+</script>
+
+<style lang="scss" scoped>
+  .query-plan {
+    color: #0a78a3;
+  }
+</style>

+ 24 - 0
desktop/core/src/desktop/js/apps/jobBrowser/components/hiveQueryPlan/webcomp.ts

@@ -0,0 +1,24 @@
+/**
+ * Licensed to Cloudera, Inc. under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  Cloudera, Inc. 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 { wrap } from 'vue/webComponentWrapper';
+import HiveQueryPlan from './HiveQueryPlan.vue';
+
+export const HIVE_QUERY_PLAN_COMPONENT = 'hive-query-plan';
+
+wrap(HIVE_QUERY_PLAN_COMPONENT, HiveQueryPlan);

+ 6 - 6
package-lock.json

@@ -9889,9 +9889,9 @@
       }
     },
     "eslint-plugin-vue": {
-      "version": "7.0.0-beta.0",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.0.0-beta.0.tgz",
-      "integrity": "sha512-EVF6d1wOJKHNFHA2LQoq21YrPmi/YgHAT593ek8k47kUl2GkJLA/1CHa2TBzpy/0k9iwBLxp7oaIbxsZg/4Yfg==",
+      "version": "7.0.0-beta.3",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.0.0-beta.3.tgz",
+      "integrity": "sha512-/p23IRPN9gFNN7dzesrctt06Kvs9E3VRB8BGIAPSEaQNk5yhlKUzntPARjUpsTWW+DQg0mqglZptfkUJK4+4EQ==",
       "dev": true,
       "requires": {
         "eslint-utils": "^2.1.0",
@@ -21810,9 +21810,9 @@
       },
       "dependencies": {
         "acorn": {
-          "version": "7.3.1",
-          "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz",
-          "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==",
+          "version": "7.4.0",
+          "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz",
+          "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==",
           "dev": true
         },
         "debug": {