renombrado de archivos parte 1

This commit is contained in:
Dani Herrero 2017-05-31 09:46:05 +02:00
parent 74a0eedb47
commit 11c3b2de2d
49 changed files with 143 additions and 123 deletions

View File

@ -1,3 +1,3 @@
import './ngModule';
import './config';
import './login/index';
import './login/login';

View File

View File

@ -76,6 +76,6 @@ export default class Controller {
Controller.$inject = ['$element', '$scope', '$window', '$http'];
ngModule.component('vnLogin', {
template: require('./index.html'),
template: require('./login.html'),
controller: Controller
});

View File

@ -19,7 +19,7 @@ Controller.$inject = ['$scope', '$state'];
export const NAME = 'vnAddressCreate';
export const COMPONENT = {
template: require('./index.html'),
template: require('./address-create.html'),
controller: Controller
};
module.component(NAME, COMPONENT);

View File

@ -11,7 +11,7 @@ Controller.$inject = ['$stateParams'];
export const NAME = 'vnAddressEdit';
export const COMPONENT = {
template: require('./index.html'),
template: require('./address-edit.html'),
controllerAs: 'addressData',
controller: Controller
};

View File

@ -1,6 +1,6 @@
import {module} from '../module';
export const component = {
template: require('./index.html')
template: require('./addresses.html')
};
module.component('vnClientAddresses', component);

View File

@ -1,7 +1,7 @@
import {module} from '../module';
export const component = {
template: require('./index.html'),
template: require('./basic-data.html'),
bindings: {
client: '<'
}

View File

@ -2,7 +2,7 @@ import {module} from '../module';
export const NAME = 'vnClientBillingData';
export const COMPONENT = {
template: require('./index.html'),
template: require('./billing-data.html'),
controllerAs: 'bill',
bindings: {
client: '<'

View File

@ -11,7 +11,7 @@ export default class vnClientCard {
module.component(NAME, {
template: require('./index.html'),
template: require('./card.html'),
controllerAs: 'card',
controller: vnClientCard
});

View File

@ -1,27 +1,27 @@
export * from './module';
export {NAME as CLIENT_CARD,
COMPONENT as CLIENT_CARD_COMPONENT} from './card/index';
COMPONENT as CLIENT_CARD_COMPONENT} from './card/card';
export {NAME as CLIENTS,
COMPONENT as CLIENTS_COMPONENT} from './index/index';
export {NAME as CLIENT_FISCAL_DATA_INDEX,
COMPONENT as CLIENT_FISCAL_DATA_INDEX_COMPONENT} from './fiscal-data/index';
COMPONENT as CLIENT_FISCAL_DATA_INDEX_COMPONENT} from './fiscal-data/fiscal-data';
export {NAME as CLIENT_BILLING_DATA_INDEX,
COMPONENT as CLIENT_BILLINGL_DATA_INDEX_COMPONENT} from './billing-data/index';
COMPONENT as CLIENT_BILLINGL_DATA_INDEX_COMPONENT} from './billing-data/billing-data';
export {NAME as CLIENT_DESCRIPTOR,
COMPONENT as CLIENT_DESCRIPTOR_COMPONENT} from './descriptor/index';
COMPONENT as CLIENT_DESCRIPTOR_COMPONENT} from './descriptor/descriptor';
export {NAME as CLIENT_NOTES,
COMPONENT as CLIENT_NOTES_COMPONENT} from './notes/index';
COMPONENT as CLIENT_NOTES_COMPONENT} from './notes/notes';
export {NAME as CLIENT_SEARCH_PANEL,
COMPONENT as CLIENT_SEARCH_PANEL_COMPONENT} from './search-panel/index';
COMPONENT as CLIENT_SEARCH_PANEL_COMPONENT} from './search-panel/search-panel';
export {NAME as CLIENT_CREATE,
COMPONENT as CLIENT_CREATE_COMPONENT} from './create/index';
COMPONENT as CLIENT_CREATE_COMPONENT} from './create/create';
export {NAME as CLIENT_ADDRESS_EDIT_INDEX,
COMPONENT as CLIENT_ADDRESS_EDIT_INDEX_COMPONENT} from './address-edit/index';
COMPONENT as CLIENT_ADDRESS_EDIT_INDEX_COMPONENT} from './address-edit/address-edit';
export {NAME as NEW_NOTE_INDEX,
COMPONENT as NEW_NOTE_INDEX_COMPONENT} from './new-note/index';
COMPONENT as NEW_NOTE_INDEX_COMPONENT} from './new-note/new-note';
import './addresses/index';
import './address-create/index';
import './basic-data/index';
import './web-access/index';
import './addresses/addresses';
import './address-create/address-create';
import './basic-data/basic-data';
import './web-access/web-access';

View File

@ -17,7 +17,7 @@ class Controller {
Controller.$inject = ['$scope', '$state'];
export const component = {
template: require('./index.html'),
template: require('./create.html'),
controller: Controller
};
module.component('vnClientCreate', component);

View File

@ -3,7 +3,7 @@ import './style.css';
export const NAME = 'vnDescriptor';
export const COMPONENT = {
template: require('./index.html'),
template: require('./descriptor.html'),
controllerAs: 'descriptor',
bindings: {
client: '<',

View File

@ -2,7 +2,7 @@ import {module} from '../module';
export const NAME = 'vnClientFiscalData';
export const COMPONENT = {
template: require('./index.html'),
template: require('./fiscal-data.html'),
controllerAs: 'fiscal',
bindings: {
client: '<'

View File

@ -1,4 +1,4 @@
import template from './index.html';
import template from './new-note.html';
import {module} from '../module';
class Controller {

View File

@ -1,5 +1,5 @@
import './style.css';
import template from './index.html';
import template from './notes.html';
import {module} from '../module';
export const NAME = 'vnClientNotes';

View File

@ -2,7 +2,7 @@ import {module} from '../module';
export const NAME = 'vnClientSearchPanel';
export const COMPONENT = {
template: require('./index.html'),
template: require('./search-panel.html'),
controller: function($scope, $window) {
this.filter = {id: null, fi: null, name: null, socialName: null, city: null, postcode: null, email: null, phone: null};
this.formVisibility = true;

View File

@ -1,48 +0,0 @@
import {module} from '../module';
class Controller {
constructor($scope, $http, vnAppLogger) {
this.$scope = $scope;
this.$http = $http;
this.vnAppLogger = vnAppLogger;
}
$onChanges() {
if(this.client)
this.account = this.client.account;
}
onPassOpen() {
this.newPassword = '';
this.repeatPassword = '';
this.$scope.$apply();
}
onPassChange(response) {
if(response == 'ACCEPT')
try {
if(!this.newPassword)
throw new Error(`Passwords can't be empty`);
if(this.newPassword != this.repeatPassword)
throw new Error(`Passwords don't match`);
let account = {
password: this.newPassword
};
this.$http.put(`/client/api/Accounts/${this.client.id}`, account);
}
catch(e) {
this.vnAppLogger.showError(e.message);
return false;
}
return true;
}
}
Controller.$inject = ['$scope', '$http', 'vnAppLogger'];
module.component('vnClientWebAccess', {
template: require('./index.html'),
bindings: {
client: '<'
},
controller: Controller
});

View File

@ -0,0 +1,46 @@
import {module} from '../module';
class Controller {
constructor($scope, $http, vnAppLogger) {
this.$scope = $scope;
this.$http = $http;
this.vnAppLogger = vnAppLogger;
}
$onChanges() {
if (this.client)
this.account = this.client.account;
}
onPassOpen() {
this.newPassword = '';
this.repeatPassword = '';
this.$scope.$apply();
}
onPassChange(response) {
if (response == 'ACCEPT')
try {
if (!this.newPassword)
throw new Error(`Passwords can't be empty`);
if (this.newPassword != this.repeatPassword)
throw new Error(`Passwords don't match`);
let account = {
password: this.newPassword
};
this.$http.put(`/client/api/Accounts/${this.client.id}`, account);
} catch (e) {
this.vnAppLogger.showError(e.message);
return false;
}
return true;
}
}
Controller.$inject = ['$scope', '$http', 'vnAppLogger'];
module.component('vnClientWebAccess', {
template: require('./web-access.html'),
bindings: {
client: '<'
},
controller: Controller
});

View File

@ -400,7 +400,7 @@ export default class Autocomplete extends Component {
Autocomplete.$inject = ['$element', '$scope', '$http', 'vnPopover', '$transclude'];
module.component('vnAutocomplete', {
template: require('./index.html'),
template: require('./autocomplete.html'),
bindings: {
url: '@',
showField: '@?',

View File

@ -4,11 +4,12 @@ import './styles/fonts/mdi-override.css';
import './textfield/index';
import './watcher/index';
import './paging/index';
import './icon/index';
import './autocomplete/index';
import './icon/icon';
import './autocomplete/autocomplete';
import './popover/index';
import './dialog/index';
import './confirm/index';
import './dialog/dialog';
import './confirm/confirm';
import './title/index';
import './subtitle/index';
import './spinner/index';

View File

@ -1,12 +1,12 @@
import {module} from '../module';
import Dialog from '../dialog/index';
import Dialog from '../dialog/dialog';
import './style.css';
export default class Confirm extends Dialog {}
Dialog.$inject = ['$element'];
module.component('vnConfirm', {
template: require('./index.html'),
template: require('./confirm.html'),
bindings: {
onResponse: '&',
question: '@',

View File

@ -98,7 +98,7 @@ export default class Dialog extends Component {
Dialog.$inject = ['$element'];
module.component('vnDialog', {
template: require('./index.html'),
template: require('./dialog.html'),
transclude: {
tplBody: 'tplBody',
tplButtons: 'tplButtons'

View File

@ -1,5 +1,5 @@
import {module} from '../module';
import Dialog from '../dialog/index';
import Dialog from '../dialog/dialog';
import {kebabToCamel} from '../lib/string';
/**

View File

@ -1,5 +1,5 @@
import {module} from '../module';
import './index.mdl';
import './icon.mdl';
import './style.css';
import * as resolveFactory from '../lib/resolveDefaultComponents';

View File

@ -1,5 +1,5 @@
import {module} from '../module';
import template from './index.mdl.html';
import template from './icon.mdl.html';
export const NAME = 'vnIconMdlFactory';
export function factory() {

View File

@ -1,10 +1,14 @@
import ngModule from './module';
function aclService() {
this.roles = window.Salix.acl.roles;
aclService.$inject = ['aclConstant'];
function aclService(aclConstant) {
this.roles = aclConstant.roles || undefined;
this.routeHasPermission = function(route) {
let hasPermission;
if (!route.acl)
if (!this.roles)
hasPermission = false;
else if (!route.acl)
hasPermission = true;
else if (!this.roles || !Object.keys(this.roles).length)
hasPermission = false;

View File

@ -1,5 +1,5 @@
import {ng} from 'vendor';
import './module';
import appName from './module';
export const bootstrap = () => {
const selector = 'selector';
@ -13,5 +13,5 @@ export const bootstrap = () => {
if (!_element) {
throw new Error('Element is not defined');
}
ng.bootstrap(_element, ['salix']);
ng.bootstrap(_element, [appName]);
};

View File

@ -1,4 +1,4 @@
import ngModule from '../../module';
import ngModule, {appName} from '../../module';
import './style.scss';
export const NAME = 'vnApp';
@ -76,4 +76,6 @@ function interceptorConfig($httpProvider) {
}
ngModule.config(interceptorConfig);
var acl = window[appName] ? window[appName].acl : {};
ngModule.constant('aclConstant', acl);

View File

@ -1,8 +1,8 @@
import ngModule from './module';
import ngModule, {appName} from './module';
config.$inject = ['$translatePartialLoaderProvider'];
export function config($translatePartialLoaderProvider) {
$translatePartialLoaderProvider.addPart('salix');
$translatePartialLoaderProvider.addPart(appName);
}
ngModule.config(config);

View File

@ -1,5 +1,6 @@
import {ng} from 'vendor';
import 'core';
const ngModule = ng.module('salix', ['vnCore']);
export const appName = 'salix';
const ngModule = ng.module(appName, ['vnCore']);
export default ngModule;

View File

@ -1,43 +1,57 @@
[
{
"relation": "salesPerson",
"scope":{
"fields": {
"id": true, "name": true
}
"relation": "salesPerson",
"scope": {
"fields": [
"id",
"name"
]
}
},
{
"relation": "contactChannel",
"scope":{
"fields": {
"id": true, "name": true
}
"relation": "contactChannel",
"scope": {
"fields": [
"id",
"name"
]
}
},
{
"relation": "province",
"scope":{
"fields": {
"id": true, "name": true
}
"relation": "province",
"scope": {
"fields": [
"id",
"name"
]
}
},
{
"relation": "country",
"scope":{
"fields": {
"id": true, "name": true
}
"relation": "country",
"scope": {
"fields": [
"id",
"name"
]
}
},
{
"relation": "payMethod",
"scope":{
"fields": {
"id": true, "name": true
}
"relation": "payMethod",
"scope": {
"fields": [
"id",
"name"
]
}
},
{
"relation": "account",
"scope": {
"fields": [
"id",
"name",
"active"
]
}
}
]
]

View File

@ -113,7 +113,7 @@ module.exports = function (app) {
function sendACL(res, acl){
let aclStr = JSON.stringify(acl);
res.header('Content-Type', 'application/javascript; charset=UTF-8');
res.send(`(function(window){window.Salix = window.Salix || {}; window.Salix.acl = window.Salix.acl || {}; window.Salix.acl = ${aclStr}; })(window)`);
res.send(`(function(window){window.salix = window.salix || {}; window.salix.acl = window.salix.acl || {}; window.salix.acl = ${aclStr}; })(window)`);
}
};