Explorar el Código

HUE-8926 [frontend] Add the new app switcher

Johan Ahlen hace 6 años
padre
commit
0cd648a73e

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 31 - 76
desktop/core/src/desktop/js/ko/components/ko.appSwitcher.js


+ 6 - 1
desktop/core/src/desktop/js/ko/components/ko.sidebar.js

@@ -29,7 +29,12 @@ const TEMPLATE = `
     </a></div>
   </script>
 
+  <!-- ko if: window.DISPLAY_APP_SWITCHER -->
+  <!-- ko component: { name: 'hue-app-switcher' } --><!-- /ko -->
+  <!-- /ko -->
+  <!-- ko ifnot: window.DISPLAY_APP_SWITCHER -->
   <div class="hue-sidebar-header"></div>
+  <!-- /ko -->
   <div class="hue-sidebar-body">
     <!-- ko foreach: {data: items, as: 'item'} -->
       <!-- ko if: item.isCategory -->
@@ -207,7 +212,7 @@ class Sidebar {
     const updateActive = () => {
       this.items().forEach(item => {
         item.children.forEach(child => {
-          child.active(location.href.indexOf(child.url) !== -1)
+          child.active(location.href.indexOf(child.url) !== -1);
         });
       });
     };

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue-embedded.css


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue.css


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue3-extra.css


+ 67 - 0
desktop/core/src/desktop/static/desktop/less/components/hue-app-switcher.less

@@ -0,0 +1,67 @@
+/*
+ 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.
+*/
+
+@sidebar-width: 248px;
+
+.hue-app-switcher {
+  position: fixed;
+  z-index: 1010;
+  top: 0;
+  bottom: 0;
+  left: -@sidebar-width;
+  width: @sidebar-width;
+  white-space: nowrap;
+  overflow: hidden;
+  transition: all 0.2s ease 0s;
+  background: @cui-white;
+
+  &.open {
+    left: 0;
+    box-shadow: rgba(0, 0, 0, 0.28) 0 0 16px;
+  }
+
+  h3 {
+    font-size: 18px;
+    font-weight: 300;
+    font-style: normal;
+    font-stretch: normal;
+    color: rgb(51, 62, 71);
+    padding: 24px 24px 0;
+    margin: 0;
+  }
+
+  ul {
+    list-style: none;
+    padding: 24px;
+    margin: 0;
+
+    li a {
+      .display-flex;
+
+      height: 48px;
+      .flex-align-items(center);
+
+      span {
+        display: inline-block;
+        margin-left: 16px;
+        font-size: 16px;
+        color: rgb(90, 101, 109);
+      }
+    }
+  }
+}

+ 1 - 0
desktop/core/src/desktop/static/desktop/less/hue-cross-version.less

@@ -17,6 +17,7 @@
 */
 @import (reference) "cui/colors.less";
 @import (reference) "hue-mixins.less";
+@import "components/hue-app-switcher.less";
 @import "components/hue-breadcrumbs.less";
 @import "components/hue-catalog-entries-table.less";
 @import "components/hue-demi-modal.less";

+ 4 - 0
desktop/core/src/desktop/templates/hue_icons.mako

@@ -23,6 +23,10 @@
     <symbol id="hi-empty" viewBox="0 0 640 640">
     </symbol>
 
+    <symbol id="hi-app-picker" viewBox="0 0 24 24">
+      <path fill="#fff" fill-rule="evenodd" d="M16 8.001h4.001V4H16v4.001zm-6 0h4V4h-4v4.001zm-6 0h4V4H4v4.001zm12 6h4.001v-4H16v4zm-6 0h4v-4h-4v4zm-6 0h4v-4H4v4zm12 6h4.001v-4H16v4zm-6 0h4v-4h-4v4zm-6 0h4v-4H4v4z"></path>
+    </symbol>
+
     <symbol id="hi-adls" viewBox="0 0 640 640">
       <path d="M542.2,54.52c-13-11.14-31.29-21-54.21-29.26C442.87,9,383.21,0,320,0S197.13,9,152,25.26c-22.93,8.28-41.17,18.12-54.21,29.26C87,63.74,74.13,78.93,74.13,99V541c0,20,12.87,35.24,23.67,44.45,13,11.14,31.29,21,54.21,29.26C197.13,631,256.79,640,320,640s122.87-9,168-25.26c22.93-8.28,41.17-18.12,54.21-29.26,10.8-9.22,23.67-24.41,23.67-44.45V99C565.87,78.93,553,63.74,542.2,54.52ZM106.05,149.81c12.11,8.54,27.51,16.22,46,22.88,45.12,16.29,104.78,25.26,168,25.26s122.87-9,168-25.26c18.44-6.66,33.84-14.33,46-22.88V367.13c-16.11,15.9-38.31,23.74-61.57,21.58-25.4-2.36-48.18-16.14-60.93-36.86l-13.31-21.63-13.72,21.37c-15.57,24.25-40.54,37.93-68.66,37.55-27.52-.38-52.21-14.28-66-37.18L236.49,330l-13.85,21.54c-13.82,21.5-35.36,35.1-59.08,37.3a74.87,74.87,0,0,1-57.51-19.55Zm56.8-94.52C204.58,40.22,260.39,31.92,320,31.92s115.42,8.3,157.15,23.37,56.8,32.48,56.8,43.69-14.92,28.57-56.8,43.69S379.61,166,320,166s-115.42-8.3-157.15-23.37-56.8-32.48-56.8-43.69S121,70.41,162.85,55.29Zm314.3,529.43c-41.73,15.07-97.54,23.37-157.15,23.37s-115.42-8.3-157.15-23.37-56.8-32.48-56.8-43.69V408.24a105.82,105.82,0,0,0,50.58,12.89q4.92,0,9.89-.46c26.43-2.46,50.81-14.7,69.33-34.36C256,408,284.41,420.63,315.32,421.06h1.55a111.11,111.11,0,0,0,80.9-35,113.6,113.6,0,0,0,71.65,34.39,109.43,109.43,0,0,0,64.52-13.64V541C533.95,552.23,519,569.59,477.15,584.71Z"></path>
       <ellipse cx="320" cy="98.97" rx="178.78" ry="47.62"></ellipse>

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio