Final fixes

This commit is contained in:
Juan Ferrer 2019-11-14 14:37:18 +01:00
parent 4436acec10
commit 64124376f0
58 changed files with 416 additions and 347 deletions

2
.gitignore vendored
View File

@ -1,6 +1,6 @@
coverage
node_modules
dist/*
dist
e2e/dms/*/
!e2e/dms/c4c
!e2e/dms/c81

View File

@ -1,10 +1,12 @@
USE `vn`;
DROP procedure IF EXISTS `zone_getEvents`;
DROP PROCEDURE IF EXISTS `vn`.`zone_getEvents`;
DELIMITER $$
CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`zone_getEvents`(
vAgencyModeFk INT,
USE `vn`$$
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getEvents`(
vProvinceFk INT,
vPostCode VARCHAR(255))
vPostCode VARCHAR(255),
vAgencyModeFk INT)
BEGIN
/**
* Returns available events for the passed province/postcode and agency.
@ -29,9 +31,11 @@ BEGIN
CALL zone_getFromGeo(vGeoFk);
IF vAgencyModeFk IS NOT NULL THEN
DELETE t FROM tmp.zone t
JOIN zone z ON z.id = t.id
WHERE z.agencyModeFk != vAgencyModeFk;
END IF;
SELECT e.`from`, e.`to`, e.weekDays
FROM tmp.zone t
@ -43,5 +47,6 @@ BEGIN
DROP TEMPORARY TABLE tmp.zone;
END$$
DELIMITER ;

View File

@ -45,11 +45,12 @@ let actions = {
login: async function(userName) {
if (currentUser !== userName) {
let logoutClicked = await this.clickIfExists('#logout');
let accountClicked = await this.clickIfExists('#user');
if (logoutClicked) {
if (accountClicked) {
let buttonSelector = '.vn-dialog.shown button[response=accept]';
await this.wait(buttonSelector => {
await this.waitToClick('#logout')
.wait(buttonSelector => {
return document.querySelector(buttonSelector) != null
|| location.hash == '#!/login';
}, buttonSelector);

View File

@ -30,7 +30,7 @@ describe('Login path', () => {
it('should log in', async() => {
const url = await nightmare
.doLogin('employee', null)
.wait('#logout')
.wait('#user')
.parsedUrl();
expect(url.hash).toEqual('#!/');

View File

@ -394,7 +394,7 @@ export default class DropDown extends Popover {
let filter = {
order,
limit: this.limit || 8
limit: this.limit || 30
};
if (model instanceof CrudModel) {

View File

@ -2,7 +2,7 @@
vn-searchbar {
display: block;
max-width: 30em;
max-width: 35em;
margin: 0 auto;
.search-params {
@ -10,7 +10,7 @@ vn-searchbar {
margin: .05em 0;
overflow: visible;
display: flex;
max-width: 16em;
max-width: 24em;
& > .search-param {
color: rgba(0, 0, 0, .6);
@ -19,7 +19,7 @@ vn-searchbar {
margin-left: .2em;
display: inline-block;
border-radius: .8em;
max-width: 18em;
max-width: 12em;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;

View File

@ -36,11 +36,11 @@ $color-font-bg-marginal: rgba(0, 0, 0, .4);
$color-font-bg-dark: rgba(255, 255, 255, .7);
$color-font-bg-dark-marginal: rgba(255, 255, 255, .4);
$color-header: darken($color-primary, 5%);
$color-header: #3d3d3d;
$color-menu-header: #3d3d3d;
$color-bg: #e5e5e5;
$color-bg-dark: #3d3d3d;
$color-active: $color-primary;
$color-active: #3d3d3d;
$color-active-font: $color-font-dark;
$color-bg-panel: white;
$color-main: $color-primary;

View File

@ -5,7 +5,6 @@ import './home/home';
import './layout';
import './left-menu/left-menu';
import './login/login';
import './main-menu/main-menu';
import './module-card';
import './module-main';
import './side-menu/side-menu';

View File

@ -1,4 +1,4 @@
import './main-menu.js';
import './index.js';
describe('Component vnMainMenu', () => {
let $httpBackend;
@ -14,8 +14,7 @@ describe('Component vnMainMenu', () => {
describe('getCurrentUserName()', () => {
it(`should set the user name property in the controller`, () => {
$httpBackend.when('GET', `Accounts/getCurrentUserData`).respond({name: 'batman'});
$httpBackend.expect('GET', `Accounts/getCurrentUserData`);
$httpBackend.expect('GET', `Accounts/getUserData`).respond({name: 'batman'});
controller.getCurrentUserName();
$httpBackend.flush();

View File

@ -5,7 +5,10 @@
ng-if="$ctrl.leftMenu"
ng-click="$ctrl.leftMenu.show()">
</vn-icon-button>
<div class="start">
<div class="side start">
<a class="logo" ui-sref="home" title="{{'Home' | translate}}">
<img src="./logo.svg" alt=""></img>
</a>
<div class="main-title" translate>
{{$ctrl.$state.current.description}}
</div>
@ -15,7 +18,7 @@
</vn-spinner>
</div>
<vn-slot name="topbar"></vn-slot>
<div class="end">
<div class="side end">
<vn-icon-button
id="apps"
icon="apps"
@ -28,9 +31,19 @@
ng-if="$ctrl.rightMenu"
ng-click="$ctrl.rightMenu.show()">
</vn-icon-button>
<vn-icon-button
id="user"
icon="account_circle"
ng-click="userPopover.show($event)"
translate-attr="{title: 'Account'}">
</vn-icon-button>
</div>
<vn-menu vn-id="apps-menu">
<ul class="modules-menu vn-pa-sm">
<li ui-sref="home">
<vn-icon icon="home"></vn-icon>
<span translate>Home</span>
</li>
<li
ng-repeat="mod in ::$ctrl.modules"
ui-sref="{{::mod.route.state}}">
@ -39,16 +52,11 @@
</li>
</ul>
</vn-menu>
<vn-user-popover
vn-id="user-popover">
</vn-user-popover>
</vn-topbar>
<vn-side-menu side="left">
<div class="header">
<a class="logo" ui-sref="home" title="{{'Home' | translate}}">
<img src="./logo.svg" alt="Logo"></img>
</a>
<vn-main-menu
class="vn-pt-md">
</vn-main-menu>
</div>
<vn-slot name="menu"></vn-slot>
</vn-side-menu>
<vn-portal slot="menu">

View File

@ -7,6 +7,17 @@ export class Layout extends Component {
super($element, $);
this.modules = vnModules.get();
}
$onInit() {
this.getUserData();
}
getUserData() {
this.$http.get('Accounts/getCurrentUserData').then(json => {
this.$.$root.user = json.data;
window.localStorage.currentUserWorkerId = json.data.workerId;
});
}
}
Layout.$inject = ['$element', '$scope', 'vnModules'];

View File

@ -0,0 +1,25 @@
import './index.js';
describe('Component vnLayout', () => {
let $httpBackend;
let controller;
beforeEach(ngModule('salix'));
beforeEach(angular.mock.inject(($componentController, _$httpBackend_) => {
let vnModules = {get: () => {}};
$httpBackend = _$httpBackend_;
let $element = angular.element('<div></div>');
controller = $componentController('vnLayout', {$element, vnModules});
}));
describe('getUserData()', () => {
it(`should set the user name property in the controller`, () => {
$httpBackend.expect('GET', `Accounts/getCurrentUserData`).respond({name: 'batman'});
controller.getUserData();
$httpBackend.flush();
expect(controller.$.$root.user.name).toEqual('batman');
});
});
});

View File

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="336.95386"
height="30"
viewBox="0 0 336.95386 29.999999"
enable-background="new 0 0 960 119.621"
xml:space="preserve"
sodipodi:docname="logo.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1016"
id="namedview39"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="3.3298328"
inkscape:cx="168.47693"
inkscape:cy="15"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><g
id="g36"
transform="matrix(0.36896285,0,0,0.36896285,-6.8501643,-7.1527138)"><g
id="g22"><path
d="M 45.55,97.917 18.566,19.388 h 21.328 l 11.035,40.357 0.901,3.306 c 1.351,4.833 2.377,8.887 3.086,12.155 0.391,-1.601 0.871,-3.484 1.436,-5.65 0.568,-2.167 1.365,-5.012 2.396,-8.532 L 70.321,19.388 h 21.214 l -27.2,78.529 z"
id="path2"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
d="m 595.5,97.917 h -19.315 c 0.043,-0.92 0.123,-1.879 0.242,-2.873 l 0.413,-3.086 c -3.414,2.66 -6.809,4.625 -10.173,5.902 -3.365,1.278 -6.845,1.916 -10.44,1.916 -5.589,0 -9.583,-1.537 -11.98,-4.605 -2.396,-3.075 -2.865,-7.225 -1.405,-12.445 1.344,-4.797 3.707,-8.697 7.092,-11.698 3.383,-2.999 7.821,-5.104 13.315,-6.313 3.029,-0.637 6.846,-1.33 11.438,-2.08 6.85,-1.065 10.568,-2.629 11.144,-4.689 l 0.394,-1.394 c 0.473,-1.688 0.199,-2.969 -0.822,-3.846 -1.017,-0.878 -2.772,-1.315 -5.265,-1.315 -2.705,0 -5.008,0.555 -6.904,1.666 -1.896,1.109 -3.337,2.739 -4.33,4.89 h -17.48 c 2.762,-6.555 6.839,-11.432 12.233,-14.638 5.396,-3.203 12.236,-4.806 20.521,-4.806 5.155,0 9.33,0.622 12.519,1.871 3.191,1.244 5.427,3.132 6.711,5.658 0.877,1.815 1.25,3.978 1.116,6.487 -0.132,2.511 -0.977,6.54 -2.531,12.093 l -6.151,21.973 c -0.735,2.623 -1.076,4.692 -1.025,6.201 0.049,1.51 0.481,2.491 1.298,2.955 z M 582.277,70.635 c -1.723,0.922 -4.527,1.778 -8.419,2.563 -1.882,0.353 -3.326,0.654 -4.319,0.905 -2.463,0.639 -4.305,1.457 -5.528,2.451 -1.226,0.992 -2.066,2.328 -2.534,4 -0.58,2.063 -0.404,3.724 0.523,4.988 0.935,1.261 2.448,1.894 4.556,1.894 3.246,0 6.149,-0.938 8.727,-2.806 2.571,-1.861 4.279,-4.311 5.125,-7.33 z"
id="path4"
inkscape:connector-curvature="0"
style="fill:#95d600" /><path
d="m 499.566,97.917 16.242,-57.998 h 18.256 l -2.842,10.15 c 3.144,-3.981 6.479,-6.888 10.017,-8.72 3.536,-1.828 7.645,-2.779 12.325,-2.85 l -5.259,18.779 c -0.789,-0.104 -1.577,-0.188 -2.363,-0.239 -0.786,-0.054 -1.532,-0.08 -2.243,-0.08 -2.916,0 -5.448,0.436 -7.597,1.305 -2.146,0.872 -4.043,2.214 -5.688,4.029 -1.052,1.207 -2.048,2.941 -2.979,5.199 -0.935,2.258 -2.106,5.907 -3.524,10.959 l -5.449,19.465 h -18.896 z"
id="path6"
inkscape:connector-curvature="0"
style="fill:#95d600" /><path
d="m 506.521,39.92 -16.236,57.998 h -18.583 l 2.241,-7.99 c -3.177,3.226 -6.415,5.603 -9.706,7.129 -3.286,1.521 -6.799,2.283 -10.535,2.283 -6.399,0 -10.756,-1.641 -13.072,-4.926 -2.318,-3.279 -2.571,-8.154 -0.764,-14.615 l 11.166,-39.878 h 19.007 l -9.088,32.455 c -1.333,4.771 -1.66,8.055 -0.968,9.854 0.683,1.794 2.5,2.693 5.449,2.693 3.305,0 6.019,-1.094 8.143,-3.279 2.118,-2.191 3.875,-5.757 5.256,-10.705 l 8.685,-31.017 h 19.005 z"
id="path8"
inkscape:connector-curvature="0"
style="fill:#95d600" /><path
d="m 406.931,51.388 3.211,-11.468 h 7.755 l 4.592,-16.383 h 19.001 l -4.586,16.383 h 9.724 l -3.212,11.468 h -9.723 l -7.035,25.128 c -1.073,3.844 -1.29,6.386 -0.641,7.63 0.648,1.244 2.346,1.868 5.087,1.868 l 1.424,-0.028 1.011,-0.08 -3.394,12.117 c -2.101,0.382 -4.134,0.684 -6.098,0.893 -1.964,0.207 -3.836,0.314 -5.612,0.314 -6.585,0 -10.644,-1.607 -12.163,-4.825 -1.519,-3.218 -0.81,-10.067 2.124,-20.554 l 6.29,-22.463 z"
id="path10"
inkscape:connector-curvature="0"
style="fill:#95d600" /><path
d="m 393.925,97.917 h -19.316 c 0.043,-0.92 0.123,-1.879 0.245,-2.873 l 0.41,-3.086 c -3.414,2.66 -6.809,4.625 -10.174,5.902 -3.364,1.278 -6.847,1.916 -10.438,1.916 -5.595,0 -9.589,-1.537 -11.983,-4.605 -2.395,-3.075 -2.866,-7.225 -1.4,-12.445 1.341,-4.797 3.707,-8.697 7.086,-11.698 3.388,-2.999 7.824,-5.104 13.321,-6.313 3.026,-0.637 6.836,-1.33 11.432,-2.08 6.85,-1.065 10.567,-2.629 11.146,-4.689 l 0.394,-1.394 c 0.47,-1.688 0.199,-2.969 -0.823,-3.846 -1.017,-0.878 -2.773,-1.315 -5.267,-1.315 -2.708,0 -5.006,0.555 -6.904,1.666 -1.895,1.109 -3.34,2.739 -4.333,4.89 h -17.477 c 2.763,-6.555 6.84,-11.432 12.234,-14.638 5.396,-3.203 12.234,-4.806 20.522,-4.806 5.155,0 9.326,0.622 12.516,1.871 3.188,1.244 5.429,3.132 6.71,5.658 0.88,1.815 1.255,3.978 1.119,6.487 -0.136,2.511 -0.974,6.54 -2.534,12.093 l -6.15,21.973 c -0.736,2.623 -1.081,4.692 -1.026,6.201 0.051,1.51 0.487,2.491 1.304,2.955 z M 380.703,70.635 c -1.725,0.922 -4.532,1.778 -8.422,2.563 -1.882,0.353 -3.319,0.654 -4.319,0.905 -2.462,0.639 -4.305,1.457 -5.525,2.451 -1.226,0.992 -2.07,2.328 -2.537,4 -0.581,2.063 -0.401,3.724 0.53,4.988 0.928,1.261 2.447,1.894 4.549,1.894 3.246,0 6.156,-0.938 8.727,-2.806 2.574,-1.861 4.282,-4.311 5.13,-7.33 z"
id="path12"
inkscape:connector-curvature="0"
style="fill:#95d600" /><path
d="m 268.557,19.386 -21.994,78.531 h -19.001 l 2.138,-7.621 c -3.022,3.158 -6.141,5.49 -9.353,6.998 -3.218,1.51 -6.69,2.267 -10.43,2.267 -7.254,0 -12.355,-2.801 -15.312,-8.401 -2.947,-5.604 -3.152,-12.935 -0.615,-22 2.56,-9.14 6.91,-16.586 13.061,-22.349 6.149,-5.757 12.764,-8.64 19.841,-8.64 3.804,0 6.98,0.768 9.523,2.299 2.539,1.533 4.354,3.795 5.436,6.787 l 7.807,-27.871 z m -58.639,48.942 c -1.455,5.188 -1.6,9.159 -0.433,11.916 1.167,2.752 3.563,4.133 7.186,4.133 3.623,0 6.75,-1.359 9.378,-4.078 2.628,-2.721 4.676,-6.711 6.146,-11.971 1.364,-4.867 1.443,-8.635 0.229,-11.3 -1.206,-2.668 -3.604,-4.001 -7.19,-4.001 -3.377,0 -6.443,1.368 -9.199,4.107 -2.755,2.736 -4.793,6.468 -6.117,11.194"
id="path14"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
d="m 138.98,97.917 16.24,-57.998 h 18.255 l -2.842,10.15 c 3.146,-3.981 6.486,-6.888 10.017,-8.72 3.539,-1.828 15.585,-2.779 20.266,-2.85 l -5.261,18.779 c -0.786,-0.104 -1.572,-0.188 -2.36,-0.239 -0.782,-0.054 -1.531,-0.08 -2.247,-0.08 -2.916,0 -13.381,0.436 -15.53,1.305 -2.149,0.872 -4.04,2.214 -5.688,4.029 -1.051,1.207 -2.044,2.941 -2.975,5.199 -0.935,2.258 -2.11,5.907 -3.525,10.959 l -5.452,19.465 H 138.98 Z"
id="path16"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
d="m 119.113,79.677 h 18.238 c -3.485,6.363 -8.214,11.283 -14.188,14.765 -5.968,3.488 -12.649,5.228 -20.046,5.228 -8.994,0 -15.34,-2.732 -19.042,-8.188 C 80.38,86.024 79.85,78.58 82.487,69.157 c 2.69,-9.6 7.448,-17.199 14.278,-22.801 6.83,-5.597 14.708,-8.4 23.634,-8.4 9.208,0 15.646,2.847 19.309,8.543 3.67,5.692 4.101,13.555 1.287,23.59 l -0.612,2.109 -0.436,1.256 h -39.219 c -1.14,4.077 -1.13,7.191 0.031,9.342 1.155,2.145 3.447,3.221 6.86,3.221 2.528,0 4.758,-0.535 6.691,-1.598 1.939,-1.066 3.539,-2.647 4.803,-4.742 m -15.918,-16.929 21.629,-0.052 c 0.971,-3.717 0.797,-6.626 -0.521,-8.716 -1.318,-2.09 -3.628,-3.137 -6.938,-3.137 -3.132,0 -5.919,1.027 -8.365,3.083 -2.442,2.054 -4.373,4.995 -5.805,8.822"
id="path18"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
d="m 310.952,98.755 -16.59,-48.276 -16.718,48.276 h -18.791 l 24.774,-78.532 h 21.218 l 11.481,40.356 0.906,3.308 c 1.347,4.832 2.377,8.886 3.086,12.157 l 1.438,-5.654 c 0.567,-2.168 1.364,-5.012 2.396,-8.531 l 11.574,-41.636 h 21.216 L 329.74,98.755 Z"
id="path20"
inkscape:connector-curvature="0"
style="fill:#95d600" /></g><g
enable-background="new "
id="g34"><path
d="m 687.35,32.291 c -2.915,-3.214 -6.131,-5.476 -9.644,-6.785 -3.516,-1.307 -7.626,-1.962 -12.336,-1.962 -8.449,0 -14.578,1.608 -18.391,4.822 -3.813,3.215 -5.72,7.513 -5.72,12.896 0,2.691 0.466,4.954 1.401,6.785 0.935,1.832 2.373,3.383 4.318,4.653 1.943,1.272 4.447,2.338 7.514,3.196 3.064,0.86 6.728,1.738 10.989,2.635 4.335,0.897 8.26,1.87 11.774,2.916 3.514,1.048 6.504,2.374 8.971,3.981 2.468,1.608 4.374,3.607 5.72,5.999 1.346,2.394 2.019,5.346 2.019,8.859 0,3.364 -0.655,6.318 -1.963,8.858 -1.309,2.543 -3.195,4.674 -5.662,6.393 -2.467,1.721 -5.439,3.01 -8.916,3.869 -3.477,0.858 -7.345,1.289 -11.605,1.289 -6.355,0 -12.075,-0.99 -17.158,-2.972 -5.085,-1.979 -9.795,-5.027 -14.129,-9.14 l 2.354,-2.803 c 3.738,3.813 8,6.691 12.785,8.635 4.783,1.944 10.205,2.915 16.26,2.915 7.475,0 13.362,-1.363 17.662,-4.093 4.299,-2.729 6.448,-6.896 6.448,-12.504 0,-2.84 -0.524,-5.251 -1.569,-7.233 -1.049,-1.979 -2.636,-3.662 -4.767,-5.046 -2.131,-1.383 -4.822,-2.579 -8.074,-3.589 -3.252,-1.009 -7.084,-1.962 -11.494,-2.859 -4.337,-0.896 -8.169,-1.831 -11.495,-2.804 -3.326,-0.971 -6.131,-2.204 -8.41,-3.7 -2.281,-1.495 -4,-3.326 -5.158,-5.495 -1.16,-2.167 -1.738,-4.896 -1.738,-8.187 0,-3.513 0.673,-6.634 2.019,-9.363 1.346,-2.729 3.233,-5.008 5.663,-6.841 2.429,-1.831 5.363,-3.232 8.803,-4.205 3.438,-0.971 7.251,-1.458 11.438,-1.458 5.159,0 9.681,0.748 13.569,2.243 3.887,1.496 7.438,3.888 10.653,7.177 z"
id="path24"
inkscape:connector-curvature="0"
style="fill:#ff9300" /><path
d="m 732.767,20.515 h 3.365 l 34.202,79.62 h -4.149 L 754.411,72.66 h -39.922 l -11.774,27.475 h -4.262 z M 753.177,69.296 734.45,25.45 715.61,69.297 h 37.567 z"
id="path26"
inkscape:connector-curvature="0"
style="fill:#ff9300" /><path
d="m 783.117,100.135 v -79.62 h 3.926 v 76.031 h 48.781 v 3.589 z"
id="path28"
inkscape:connector-curvature="0"
style="fill:#ff9300" /><path
d="m 848.158,100.135 v -79.62 h 3.924 v 79.62 z"
id="path30"
inkscape:connector-curvature="0"
style="fill:#ff9300" /><path
d="m 868.566,20.515 29.381,37.455 29.381,-37.455 h 4.484 l -31.735,40.371 30.839,39.249 h -4.486 l -28.482,-36.333 -28.484,36.333 h -4.71 L 895.593,60.886 863.857,20.515 Z"
id="path32"
inkscape:connector-curvature="0"
style="fill:#ff9300" /></g></g></svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
@ -9,106 +9,72 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="40mm"
height="40mm"
viewBox="0 0 40 40"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="336.95386"
height="30"
viewBox="0 0 336.95386 29.999999"
enable-background="new 0 0 960 119.621"
xml:space="preserve"
sodipodi:docname="logo.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
id="svg823"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="logo.svg">
<defs
id="defs817" />
<sodipodi:namedview
id="base"
pagecolor="#2f2f2f"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1016"
id="namedview39"
inkscape:zoom="5.635625"
inkscape:cx="70.551181"
inkscape:cy="75.590551"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="3.3298328"
inkscape:cx="168.47693"
inkscape:cy="15"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><g
id="g36"
transform="matrix(0.36896285,0,0,0.36896285,-6.8501643,-7.1527138)"><g
id="g22"><path
d="M 45.55,97.917 18.566,19.388 h 21.328 l 11.035,40.357 0.901,3.306 c 1.351,4.833 2.377,8.887 3.086,12.155 0.391,-1.601 0.871,-3.484 1.436,-5.65 0.568,-2.167 1.365,-5.012 2.396,-8.532 L 70.321,19.388 h 21.214 l -27.2,78.529 z"
id="path2"
inkscape:window-width="1920"
inkscape:window-height="1043"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata820">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-257)">
<path
style="fill:#88bd32;stroke-width:0.83333331"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
d="m 595.5,97.917 h -19.315 c 0.043,-0.92 0.123,-1.879 0.242,-2.873 l 0.413,-3.086 c -3.414,2.66 -6.809,4.625 -10.173,5.902 -3.365,1.278 -6.845,1.916 -10.44,1.916 -5.589,0 -9.583,-1.537 -11.98,-4.605 -2.396,-3.075 -2.865,-7.225 -1.405,-12.445 1.344,-4.797 3.707,-8.697 7.092,-11.698 3.383,-2.999 7.821,-5.104 13.315,-6.313 3.029,-0.637 6.846,-1.33 11.438,-2.08 6.85,-1.065 10.568,-2.629 11.144,-4.689 l 0.394,-1.394 c 0.473,-1.688 0.199,-2.969 -0.822,-3.846 -1.017,-0.878 -2.772,-1.315 -5.265,-1.315 -2.705,0 -5.008,0.555 -6.904,1.666 -1.896,1.109 -3.337,2.739 -4.33,4.89 h -17.48 c 2.762,-6.555 6.839,-11.432 12.233,-14.638 5.396,-3.203 12.236,-4.806 20.521,-4.806 5.155,0 9.33,0.622 12.519,1.871 3.191,1.244 5.427,3.132 6.711,5.658 0.877,1.815 1.25,3.978 1.116,6.487 -0.132,2.511 -0.977,6.54 -2.531,12.093 l -6.151,21.973 c -0.735,2.623 -1.076,4.692 -1.025,6.201 0.049,1.51 0.481,2.491 1.298,2.955 z M 582.277,70.635 c -1.723,0.922 -4.527,1.778 -8.419,2.563 -1.882,0.353 -3.326,0.654 -4.319,0.905 -2.463,0.639 -4.305,1.457 -5.528,2.451 -1.226,0.992 -2.066,2.328 -2.534,4 -0.58,2.063 -0.404,3.724 0.523,4.988 0.935,1.261 2.448,1.894 4.556,1.894 3.246,0 6.149,-0.938 8.727,-2.806 2.571,-1.861 4.279,-4.311 5.125,-7.33 z"
id="path4"
d="m 27.583333,261.08333 c 0.25,-0.0833 0.5,-0.16666 0.75,-0.16666 L 39,259.5 l -0.166667,6.08333 c -0.166666,5 -3.083333,9.5 -6.666666,10.5 -0.25,0.0833 -0.5,0.16667 -0.75,0.16667 L 20.75,277.66667 l 0.166667,-6.08334 c 0.166666,-5.08333 3.083333,-9.5 6.666666,-10.5 z"
class="st0" />
<path
style="fill:#88bd32;stroke-width:0.83333331"
inkscape:connector-curvature="0"
style="fill:#95d600" /><path
d="m 499.566,97.917 16.242,-57.998 h 18.256 l -2.842,10.15 c 3.144,-3.981 6.479,-6.888 10.017,-8.72 3.536,-1.828 7.645,-2.779 12.325,-2.85 l -5.259,18.779 c -0.789,-0.104 -1.577,-0.188 -2.363,-0.239 -0.786,-0.054 -1.532,-0.08 -2.243,-0.08 -2.916,0 -5.448,0.436 -7.597,1.305 -2.146,0.872 -4.043,2.214 -5.688,4.029 -1.052,1.207 -2.048,2.941 -2.979,5.199 -0.935,2.258 -2.106,5.907 -3.524,10.959 l -5.449,19.465 h -18.896 z"
id="path6"
d="m 5.9166667,281.91667 c 0.1666667,-0.0833 0.4166667,-0.0833 0.5833334,-0.0833 L 14.25,280.75 14.16667,285.08333 C 14.08334,288.75 11.91667,292 9.3333364,292.75 c -0.25,0.0833 -0.4166667,0.0833 -0.5833334,0.0833 L 1.0000001,293.91667 1.0833334,289.5 c 0.1666667,-3.58333 2.25,-6.91667 4.8333333,-7.58333 z"
class="st0" />
<g
id="g10"
style="fill:#f7931e;fill-opacity:1;stroke:none;stroke-opacity:1"
transform="matrix(0.83333333,0,0,0.83333333,8.0000002e-8,257)">
<path
style="fill:#f7931e;fill-opacity:1;stroke:none;stroke-opacity:1"
inkscape:connector-curvature="0"
style="fill:#95d600" /><path
d="m 506.521,39.92 -16.236,57.998 h -18.583 l 2.241,-7.99 c -3.177,3.226 -6.415,5.603 -9.706,7.129 -3.286,1.521 -6.799,2.283 -10.535,2.283 -6.399,0 -10.756,-1.641 -13.072,-4.926 -2.318,-3.279 -2.571,-8.154 -0.764,-14.615 l 11.166,-39.878 h 19.007 l -9.088,32.455 c -1.333,4.771 -1.66,8.055 -0.968,9.854 0.683,1.794 2.5,2.693 5.449,2.693 3.305,0 6.019,-1.094 8.143,-3.279 2.118,-2.191 3.875,-5.757 5.256,-10.705 l 8.685,-31.017 h 19.005 z"
id="path8"
inkscape:connector-curvature="0"
style="fill:#95d600" /><path
d="m 406.931,51.388 3.211,-11.468 h 7.755 l 4.592,-16.383 h 19.001 l -4.586,16.383 h 9.724 l -3.212,11.468 h -9.723 l -7.035,25.128 c -1.073,3.844 -1.29,6.386 -0.641,7.63 0.648,1.244 2.346,1.868 5.087,1.868 l 1.424,-0.028 1.011,-0.08 -3.394,12.117 c -2.101,0.382 -4.134,0.684 -6.098,0.893 -1.964,0.207 -3.836,0.314 -5.612,0.314 -6.585,0 -10.644,-1.607 -12.163,-4.825 -1.519,-3.218 -0.81,-10.067 2.124,-20.554 l 6.29,-22.463 z"
id="path10"
inkscape:connector-curvature="0"
style="fill:#95d600" /><path
d="m 393.925,97.917 h -19.316 c 0.043,-0.92 0.123,-1.879 0.245,-2.873 l 0.41,-3.086 c -3.414,2.66 -6.809,4.625 -10.174,5.902 -3.364,1.278 -6.847,1.916 -10.438,1.916 -5.595,0 -9.589,-1.537 -11.983,-4.605 -2.395,-3.075 -2.866,-7.225 -1.4,-12.445 1.341,-4.797 3.707,-8.697 7.086,-11.698 3.388,-2.999 7.824,-5.104 13.321,-6.313 3.026,-0.637 6.836,-1.33 11.432,-2.08 6.85,-1.065 10.567,-2.629 11.146,-4.689 l 0.394,-1.394 c 0.47,-1.688 0.199,-2.969 -0.823,-3.846 -1.017,-0.878 -2.773,-1.315 -5.267,-1.315 -2.708,0 -5.006,0.555 -6.904,1.666 -1.895,1.109 -3.34,2.739 -4.333,4.89 h -17.477 c 2.763,-6.555 6.84,-11.432 12.234,-14.638 5.396,-3.203 12.234,-4.806 20.522,-4.806 5.155,0 9.326,0.622 12.516,1.871 3.188,1.244 5.429,3.132 6.71,5.658 0.88,1.815 1.255,3.978 1.119,6.487 -0.136,2.511 -0.974,6.54 -2.534,12.093 l -6.15,21.973 c -0.736,2.623 -1.081,4.692 -1.026,6.201 0.051,1.51 0.487,2.491 1.304,2.955 z M 380.703,70.635 c -1.725,0.922 -4.532,1.778 -8.422,2.563 -1.882,0.353 -3.319,0.654 -4.319,0.905 -2.462,0.639 -4.305,1.457 -5.525,2.451 -1.226,0.992 -2.07,2.328 -2.537,4 -0.581,2.063 -0.401,3.724 0.53,4.988 0.928,1.261 2.447,1.894 4.549,1.894 3.246,0 6.156,-0.938 8.727,-2.806 2.574,-1.861 4.282,-4.311 5.13,-7.33 z"
id="path12"
inkscape:connector-curvature="0"
style="fill:#95d600" /><path
d="m 268.557,19.386 -21.994,78.531 h -19.001 l 2.138,-7.621 c -3.022,3.158 -6.141,5.49 -9.353,6.998 -3.218,1.51 -6.69,2.267 -10.43,2.267 -7.254,0 -12.355,-2.801 -15.312,-8.401 -2.947,-5.604 -3.152,-12.935 -0.615,-22 2.56,-9.14 6.91,-16.586 13.061,-22.349 6.149,-5.757 12.764,-8.64 19.841,-8.64 3.804,0 6.98,0.768 9.523,2.299 2.539,1.533 4.354,3.795 5.436,6.787 l 7.807,-27.871 z m -58.639,48.942 c -1.455,5.188 -1.6,9.159 -0.433,11.916 1.167,2.752 3.563,4.133 7.186,4.133 3.623,0 6.75,-1.359 9.378,-4.078 2.628,-2.721 4.676,-6.711 6.146,-11.971 1.364,-4.867 1.443,-8.635 0.229,-11.3 -1.206,-2.668 -3.604,-4.001 -7.19,-4.001 -3.377,0 -6.443,1.368 -9.199,4.107 -2.755,2.736 -4.793,6.468 -6.117,11.194"
id="path14"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
d="m 138.98,97.917 16.24,-57.998 h 18.255 l -2.842,10.15 c 3.146,-3.981 6.486,-6.888 10.017,-8.72 3.539,-1.828 15.585,-2.779 20.266,-2.85 l -5.261,18.779 c -0.786,-0.104 -1.572,-0.188 -2.36,-0.239 -0.782,-0.054 -1.531,-0.08 -2.247,-0.08 -2.916,0 -13.381,0.436 -15.53,1.305 -2.149,0.872 -4.04,2.214 -5.688,4.029 -1.051,1.207 -2.044,2.941 -2.975,5.199 -0.935,2.258 -2.11,5.907 -3.525,10.959 l -5.452,19.465 H 138.98 Z"
id="path16"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
d="m 119.113,79.677 h 18.238 c -3.485,6.363 -8.214,11.283 -14.188,14.765 -5.968,3.488 -12.649,5.228 -20.046,5.228 -8.994,0 -15.34,-2.732 -19.042,-8.188 C 80.38,86.024 79.85,78.58 82.487,69.157 c 2.69,-9.6 7.448,-17.199 14.278,-22.801 6.83,-5.597 14.708,-8.4 23.634,-8.4 9.208,0 15.646,2.847 19.309,8.543 3.67,5.692 4.101,13.555 1.287,23.59 l -0.612,2.109 -0.436,1.256 h -39.219 c -1.14,4.077 -1.13,7.191 0.031,9.342 1.155,2.145 3.447,3.221 6.86,3.221 2.528,0 4.758,-0.535 6.691,-1.598 1.939,-1.066 3.539,-2.647 4.803,-4.742 m -15.918,-16.929 21.629,-0.052 c 0.971,-3.717 0.797,-6.626 -0.521,-8.716 -1.318,-2.09 -3.628,-3.137 -6.938,-3.137 -3.132,0 -5.919,1.027 -8.365,3.083 -2.442,2.054 -4.373,4.995 -5.805,8.822"
id="path18"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
d="m 310.952,98.755 -16.59,-48.276 -16.718,48.276 h -18.791 l 24.774,-78.532 h 21.218 l 11.481,40.356 0.906,3.308 c 1.347,4.832 2.377,8.886 3.086,12.157 l 1.438,-5.654 c 0.567,-2.168 1.364,-5.012 2.396,-8.531 l 11.574,-41.636 h 21.216 L 329.74,98.755 Z"
id="path20"
inkscape:connector-curvature="0"
style="fill:#95d600" /></g><g
enable-background="new "
id="g34"><path
d="m 687.35,32.291 c -2.915,-3.214 -6.131,-5.476 -9.644,-6.785 -3.516,-1.307 -7.626,-1.962 -12.336,-1.962 -8.449,0 -14.578,1.608 -18.391,4.822 -3.813,3.215 -5.72,7.513 -5.72,12.896 0,2.691 0.466,4.954 1.401,6.785 0.935,1.832 2.373,3.383 4.318,4.653 1.943,1.272 4.447,2.338 7.514,3.196 3.064,0.86 6.728,1.738 10.989,2.635 4.335,0.897 8.26,1.87 11.774,2.916 3.514,1.048 6.504,2.374 8.971,3.981 2.468,1.608 4.374,3.607 5.72,5.999 1.346,2.394 2.019,5.346 2.019,8.859 0,3.364 -0.655,6.318 -1.963,8.858 -1.309,2.543 -3.195,4.674 -5.662,6.393 -2.467,1.721 -5.439,3.01 -8.916,3.869 -3.477,0.858 -7.345,1.289 -11.605,1.289 -6.355,0 -12.075,-0.99 -17.158,-2.972 -5.085,-1.979 -9.795,-5.027 -14.129,-9.14 l 2.354,-2.803 c 3.738,3.813 8,6.691 12.785,8.635 4.783,1.944 10.205,2.915 16.26,2.915 7.475,0 13.362,-1.363 17.662,-4.093 4.299,-2.729 6.448,-6.896 6.448,-12.504 0,-2.84 -0.524,-5.251 -1.569,-7.233 -1.049,-1.979 -2.636,-3.662 -4.767,-5.046 -2.131,-1.383 -4.822,-2.579 -8.074,-3.589 -3.252,-1.009 -7.084,-1.962 -11.494,-2.859 -4.337,-0.896 -8.169,-1.831 -11.495,-2.804 -3.326,-0.971 -6.131,-2.204 -8.41,-3.7 -2.281,-1.495 -4,-3.326 -5.158,-5.495 -1.16,-2.167 -1.738,-4.896 -1.738,-8.187 0,-3.513 0.673,-6.634 2.019,-9.363 1.346,-2.729 3.233,-5.008 5.663,-6.841 2.429,-1.831 5.363,-3.232 8.803,-4.205 3.438,-0.971 7.251,-1.458 11.438,-1.458 5.159,0 9.681,0.748 13.569,2.243 3.887,1.496 7.438,3.888 10.653,7.177 z"
id="path24"
inkscape:connector-curvature="0"
style="fill:#ff9300" /><path
d="m 732.767,20.515 h 3.365 l 34.202,79.62 h -4.149 L 754.411,72.66 h -39.922 l -11.774,27.475 h -4.262 z M 753.177,69.296 734.45,25.45 715.61,69.297 h 37.567 z"
id="path26"
inkscape:connector-curvature="0"
style="fill:#ff9300" /><path
d="m 783.117,100.135 v -79.62 h 3.926 v 76.031 h 48.781 v 3.589 z"
id="path28"
inkscape:connector-curvature="0"
style="fill:#ff9300" /><path
d="m 848.158,100.135 v -79.62 h 3.924 v 79.62 z"
id="path30"
inkscape:connector-curvature="0"
style="fill:#ff9300" /><path
d="m 868.566,20.515 29.381,37.455 29.381,-37.455 h 4.484 l -31.735,40.371 30.839,39.249 h -4.486 l -28.482,-36.333 -28.484,36.333 h -4.71 L 895.593,60.886 863.857,20.515 Z"
id="path32"
inkscape:connector-curvature="0"
style="fill:#ff9300" /></g></g></svg>
d="m 12,48 c -0.4,0 -0.7,-0.3 -0.7,-0.6 0,-0.4 0.2,-0.7 0.6,-0.8 0,0 3,-0.3 5.5,-3.4 3,-3.8 4.1,-10.1 3,-18.4 C 19.3,16.3 20.6,9.7 24.1,5.3 27.8,0.6 32.5,0 32.7,0 c 0.4,0 0.7,0.2 0.8,0.6 0,0.4 -0.2,0.7 -0.6,0.8 0,0 -4.3,0.6 -7.6,4.7 -3.3,4.2 -4.4,10.4 -3.4,18.5 1.1,8.8 0,15.4 -3.4,19.5 -2.8,3.5 -6.2,3.9 -6.5,3.9 0.1,0 0.1,0 0,0 z"
class="st1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -1,4 +1,4 @@
@import "variables";
@import "effects";
vn-layout {
& > vn-topbar {
@ -12,13 +12,21 @@ vn-layout {
padding: 0 1em;
justify-content: space-between;
& > .start {
flex: 1;
& > .side {
flex: auto;
display: flex;
align-items: center;
overflow: hidden;
width: 5em;
transition: width 200ms;
}
& > .start {
padding-right: 1em;
overflow: hidden;
& > .logo > img {
height: 2em;
display: block;
}
& > .main-title {
font-size: 1.6em;
text-overflow: ellipsis;
@ -28,57 +36,46 @@ vn-layout {
}
& > vn-spinner {
padding: 0 .4em;
color: $color-font-dark;
}
}
& > vn-slot {
flex: auto;
}
& > .end {
flex: 1;
padding-left: 1em;
align-items: center;
justify-content: flex-end;
display: flex;
}
.show-menu {
display: none;
}
.vn-button {
color: inherit;
font-size: 1.05em;
padding: 0;
}
.show-menu {
display: none;
}
}
& > vn-side-menu > .menu {
display: flex;
flex-direction: column;
align-items: stretch;
& > .header {
background-color: $color-menu-header;
padding: $spacing-md;
color: $color-font-dark;
& > .logo > img {
width: 100%;
display: block;
}
}
& > vn-slot {
flex: 1;
overflow: auto;
}
}
&.left-menu {
& > vn-topbar {
left: $menu-width;
& > vn-topbar > .start {
width: 5em + $menu-width;
}
& > .main-view {
padding-left: $menu-width;
}
}
&.right-menu {
& > vn-topbar > .end {
width: 5em + $menu-width;
}
& > .main-view {
padding-right: $menu-width;
}
@ -104,6 +101,12 @@ vn-layout {
}
@media screen and (max-width: $mobile-width) {
& > vn-topbar {
& > .start > .logo {
display: none;
}
& > .side {
flex: 1;
}
.show-menu {
display: block;
}
@ -127,3 +130,30 @@ vn-layout {
}
}
}
.vn-popover .modules-menu {
list-style-type: none;
margin: 0;
color: $color-font-dark;
& > li {
@extend %clickable-light;
background-color: $color-main;
margin-bottom: .6em;
padding: .8em;
border-radius: .1em;
min-width: 8em;
white-space: nowrap;
&:last-child {
margin-bottom: 0;
}
& > vn-icon {
padding-right: .3em;
vertical-align: middle;
}
}
}
#user {
font-size: 1.5em;
height: auto;
}

View File

@ -1,15 +0,0 @@
<div
ng-click="userPopover.show($event)"
id="user"
class="unselectable">
{{$root.user.nickname}}
</div>
<vn-icon-button
id="logout"
icon="exit_to_app"
translate-attr="{title: 'Logout'}"
ng-click="$ctrl.vnAuth.logout()">
</vn-icon-button>
<vn-user-popover
vn-id="user-popover">
</vn-user-popover>

View File

@ -1,29 +0,0 @@
import ngModule from '../../module';
import './style.scss';
export default class MainMenu {
constructor($, $http, vnAuth) {
Object.assign(this, {
$,
$http,
vnAuth
});
}
$onInit() {
this.getCurrentUserName();
}
getCurrentUserName() {
this.$http.get('Accounts/getCurrentUserData').then(json => {
this.$.$root.user = json.data;
window.localStorage.currentUserWorkerId = json.data.workerId;
});
}
}
MainMenu.$inject = ['$scope', '$http', 'vnAuth'];
ngModule.component('vnMainMenu', {
template: require('./main-menu.html'),
controller: MainMenu
});

View File

@ -1,56 +0,0 @@
@import "effects";
@import "variables";
vn-main-menu {
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
& > * {
transition: color 250ms ease-out;
}
& > #user {
flex: 1;
vertical-align: middle;
font-weight: bold;
margin-right: .2em;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
}
& > .vn-button {
height: initial;
color: inherit;
padding: 0;
}
& > :hover {
color: $color-main;
opacity: 1;
}
}
.vn-popover .modules-menu {
list-style-type: none;
margin: 0;
color: $color-font-dark;
& > li {
@extend %clickable-light;
background-color: $color-main;
margin-bottom: .6em;
padding: .8em;
border-radius: .1em;
min-width: 8em;
white-space: nowrap;
&:last-child {
margin-bottom: 0;
}
& > vn-icon {
padding-right: .3em;
vertical-align: middle;
}
}
}

View File

@ -13,19 +13,19 @@ vn-side-menu > .menu {
background-color: $color-bg-panel;
box-shadow: 0 .1em .2em $color-shadow;
overflow: auto;
top: $topbar-height;
&.left {
left: 0;
top: 0;
}
&.right {
right: 0;
top: $topbar-height;
}
@media screen and (max-width: $mobile-width) {
transition: transform 200ms ease-out;
z-index: 15;
top: 0;
&.left {
transform: translateZ(0) translateX(-$menu-width);

View File

@ -13,18 +13,33 @@
<vn-popover vn-id="popover">
<vn-vertical class="user-popover vn-pa-md">
<div class="profile-card vn-pb-md">
<vn-icon icon="person"></vn-icon>
<div class="vn-pl-md">
<vn-icon icon="account_circle"></vn-icon>
<div class="vn-pl-sm">
<div>
<div class="user">
<div class="ellipsize">
<div
class="ellipsize"
title="{{::$root.user.nickname}}">
{{$root.user.nickname}}
</div>
<div class="text-secondary text-caption ellipsize">
<div
class="text-secondary text-caption ellipsize"
title="{{::$root.user.name}}">
{{::$root.user.name}}
</div>
</div>
<a ui-sref="worker.card.summary({id: $root.user.workerId})">
<vn-button label="My account"> </vn-button>
<vn-icon-button
id="logout"
icon="exit_to_app"
translate-attr="{title: 'Logout'}"
ng-click="$ctrl.vnAuth.logout()">
</vn-icon-button>
</div>
<a
ui-sref="worker.card.summary({id: $root.user.workerId})"
class="vn-button colored"
translate>
My account
</a>
</div>
</div>

View File

@ -12,11 +12,12 @@ let languages = {
};
class Controller {
constructor($, $translate, vnConfig) {
constructor($, $translate, vnConfig, vnAuth) {
Object.assign(this, {
$,
$translate,
vnConfig,
vnAuth,
lang: $translate.use(),
langs: []
});
@ -86,7 +87,7 @@ class Controller {
this.$.popover.show(event.target);
}
}
Controller.$inject = ['$scope', '$translate', 'vnConfig'];
Controller.$inject = ['$scope', '$translate', 'vnConfig', 'vnAuth'];
ngModule.component('vnUserPopover', {
template: require('./index.html'),

View File

@ -8,11 +8,8 @@
align-items: center;
& > vn-icon {
font-size: 60px;
border-radius: 50%;
color: $color-font-dark;
background: $color-marginal;
padding: .1em;
font-size: 80px;
color: $color-font-bg-marginal;
}
& > div {
display: flex;
@ -20,10 +17,21 @@
justify-content: space-between;
flex: 1;
& > .user {
max-width: 10em;
& > div {
display: flex;
padding-bottom: .5em;
& > .user {
flex: 1;
max-width: 8em;
}
}
}
}
}
#logout {
float: right;
height: initial;
vertical-align: middle;
font-size: 1em;
}

View File

@ -1,4 +1,5 @@
Applications: Aplicaciones
Account: Cuenta
Language: Idioma
Change language: Cambiar idioma
Data saved!: ¡Datos guardados!

View File

@ -4,19 +4,18 @@ module.exports = Self => {
description: 'Returns delivery days for a postcode',
accepts: [
{
arg: 'agencyModeFk',
type: 'Number',
description: 'The agency mode id',
required: true
}, {
arg: 'provinceFk',
type: 'Number',
description: 'The province id',
required: true
}, {
arg: 'postCode',
arg: 'search',
type: 'String',
description: 'The postcode'
}, {
arg: 'agencyModeFk',
type: 'Number',
description: 'The agency mode id'
}
],
returns: {
@ -29,12 +28,11 @@ module.exports = Self => {
}
});
Self.getEvents = async(agencyModeFk, provinceFk, postCode) => {
Self.getEvents = async(provinceFk, postCode, agencyModeFk) => {
let [events, exclusions] = await Self.rawSql(
`CALL zone_getEvents(?, ?, ?)`,
[agencyModeFk, provinceFk, postCode]
[provinceFk, postCode, agencyModeFk]
);
return {events, exclusions};
};
};

View File

@ -1,26 +1,19 @@
<div class="vn-w-md">
<form ng-submit="$ctrl.onSubmit()">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-zone-calendar
data="data">
</vn-zone-calendar>
</div>
<vn-side-menu side="right">
<form ng-submit="$ctrl.onSubmit()" class="vn-pa-md">
<vn-autocomplete
vn-one
label="Agency"
ng-model="$ctrl.params.agencyModeFk"
url="AgencyModes/isActive">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
label="Province"
ng-model="$ctrl.params.provinceFk"
ng-model="params.provinceFk"
url="Provinces"
fields="['countryFk']"
include="'country'"
style="margin-right: .5em;">
include="'country'">
<tpl-item>
<div>{{name}}</div>
<div style="font-size: .9em; color: gray; line-height: .8em;">
<div class="text-caption text-secondary">
{{country.country}}
</div>
</tpl-item>
@ -28,19 +21,13 @@
<vn-textfield
vn-one
label="Postcode"
ng-model="$ctrl.params.postCode">
ng-model="params.postCode">
</vn-textfield>
</vn-horizontal>
</vn-card>
<vn-submit
icon="search"
vn-tooltip="Query"
class="round"
fixed-bottom-right>
</vn-submit>
<vn-autocomplete
label="Agency"
ng-model="params.agencyModeFk"
url="AgencyModes/isActive">
</vn-autocomplete>
<vn-submit label="Query" class="vn-mt-sm"></vn-submit>
</form>
<vn-zone-calendar
data="data"
class="vn-mt-md">
</vn-zone-calendar>
</div>
</vn-side-menu>

View File

@ -1,20 +1,17 @@
import ngModule from '../module';
import Section from 'salix/components/section';
import './style.scss';
class Controller {
constructor($, $http) {
Object.assign(this, {
$,
$http
});
class Controller extends Section {
$onInit() {
this.$.params = {};
}
onSubmit() {
this.$http.get(`Zones/getEvents`, {params: this.params})
this.$http.get(`Zones/getEvents`, {params: this.$.params})
.then(res => this.$.data = res.data);
}
}
Controller.$inject = ['$scope', '$http'];
ngModule.component('vnZoneDeliveryDays', {
template: require('./index.html'),

View File

@ -9,4 +9,8 @@ vn-zone-delivery-days {
min-width: 16.5em;
}
}
form {
display: flex;
flex-direction: column;
}
}

View File

@ -29,7 +29,7 @@
"component": "vn-zone-index",
"description": "Zones"
}, {
"url": "/delivery-days",
"url": "/delivery-days?q",
"state": "zone.deliveryDays",
"component": "vn-zone-delivery-days",
"description": "Delivery days"