@sofit/view-locale 0.3.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,22 @@
1
- <testsuites name="Sofit view locale tests" tests="8" failures="0" time="2.569">
2
- <testsuite name="Joi tests" errors="0" failures="0" skipped="0" timestamp="2018-08-13T13:48:05" time="1.416" tests="4">
3
- <testcase classname="Joi tests should return default message" name="Joi tests should return default message" time="0.007">
1
+ <testsuites name="Sofit view locale tests" tests="8" failures="0" time="3.482">
2
+ <testsuite name="Vehicle locale test" errors="0" failures="0" skipped="0" timestamp="2018-08-21T11:21:30" time="1.962" tests="4">
3
+ <testcase classname="Vehicle locale test Should get translations with reach" name="Vehicle locale test Should get translations with reach" time="0.011">
4
4
  </testcase>
5
- <testcase classname="Joi tests should return non label message" name="Joi tests should return non label message" time="0.001">
5
+ <testcase classname="Vehicle locale test Should replace correctly with reach" name="Vehicle locale test Should replace correctly with reach" time="0.001">
6
6
  </testcase>
7
- <testcase classname="Joi tests should return translated label message" name="Joi tests should return translated label message" time="0">
7
+ <testcase classname="Vehicle locale test Should get translations with raw" name="Vehicle locale test Should get translations with raw" time="0.001">
8
8
  </testcase>
9
- <testcase classname="Joi tests should return translated label index" name="Joi tests should return translated label index" time="0.001">
9
+ <testcase classname="Vehicle locale test Should replace correctly with raw" name="Vehicle locale test Should replace correctly with raw" time="0.001">
10
10
  </testcase>
11
11
  </testsuite>
12
- <testsuite name="Vehicle locale test" errors="0" failures="0" skipped="0" timestamp="2018-08-13T13:48:05" time="1.479" tests="4">
13
- <testcase classname="Vehicle locale test Should get translations with reach" name="Vehicle locale test Should get translations with reach" time="0.006">
12
+ <testsuite name="Joi tests" errors="0" failures="0" skipped="0" timestamp="2018-08-21T11:21:30" time="1.998" tests="4">
13
+ <testcase classname="Joi tests should return default message" name="Joi tests should return default message" time="0.01">
14
14
  </testcase>
15
- <testcase classname="Vehicle locale test Should replace correctly with reach" name="Vehicle locale test Should replace correctly with reach" time="0.001">
15
+ <testcase classname="Joi tests should return non label message" name="Joi tests should return non label message" time="0.002">
16
16
  </testcase>
17
- <testcase classname="Vehicle locale test Should get translations with raw" name="Vehicle locale test Should get translations with raw" time="0">
17
+ <testcase classname="Joi tests should return translated label message" name="Joi tests should return translated label message" time="0.001">
18
18
  </testcase>
19
- <testcase classname="Vehicle locale test Should replace correctly with raw" name="Vehicle locale test Should replace correctly with raw" time="0.001">
19
+ <testcase classname="Joi tests should return translated label index" name="Joi tests should return translated label index" time="0.001">
20
20
  </testcase>
21
21
  </testsuite>
22
22
  </testsuites>
@@ -0,0 +1,10 @@
1
+ export declare const ENTITY_COMMON: {
2
+ name: {
3
+ ptBR: string;
4
+ es: string;
5
+ };
6
+ external_id: {
7
+ ptBR: string;
8
+ es: string;
9
+ };
10
+ };
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gate = {
3
+ exports.ENTITY_COMMON = {
4
4
  name: {
5
5
  ptBR: 'Nome',
6
6
  es: 'Nombre'
7
+ },
8
+ external_id: {
9
+ ptBR: 'Chave externa',
10
+ es: 'Clave externa'
7
11
  }
8
12
  };
@@ -6,16 +6,16 @@ exports.joi = {
6
6
  es: '{{index}}er valor de {{path}}'
7
7
  },
8
8
  'string.base': {
9
- ptBR: '{{label}} precisa ser um texto.',
10
- es: '{{label}} debe se uno texto.'
9
+ ptBR: '{{label}} precisa ser do tipo texto.',
10
+ es: '{{label}} debe se del tipo texto.'
11
11
  },
12
12
  'string.email': {
13
13
  ptBR: '{{label}} precisa ser um email válido.',
14
14
  es: '{{label}}'
15
15
  },
16
16
  'number.base': {
17
- ptBR: '{{label}} precisa ser numérico.',
18
- es: '{{label}} debe ser numérico.'
17
+ ptBR: '{{label}} precisa ser do tipo numérico.',
18
+ es: '{{label}} debe ser del tipo numérico.'
19
19
  },
20
20
  'number.min': {
21
21
  ptBR: '{{label}} precisa ter no mínimo {{limit}}.',
@@ -1,5 +1,6 @@
1
- export { gate } from './modules/gate/gate';
2
- export { button } from './common/buttons';
1
+ import * as company from './modules/company';
2
+ import * as gate from './modules/gate';
3
+ import * as warehouse from './modules/warehouse';
3
4
  export { joi } from './common/joi';
4
5
  export { databaseErrors } from './common/database-errors';
5
- export { company } from './modules/company/company';
6
+ export { gate, company, warehouse };
@@ -1,12 +1,19 @@
1
1
  "use strict";
2
+ var __importStar = (this && this.__importStar) || function (mod) {
3
+ if (mod && mod.__esModule) return mod;
4
+ var result = {};
5
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
+ result["default"] = mod;
7
+ return result;
8
+ };
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var gate_1 = require("./modules/gate/gate");
4
- exports.gate = gate_1.gate;
5
- var buttons_1 = require("./common/buttons");
6
- exports.button = buttons_1.button;
10
+ const company = __importStar(require("./modules/company"));
11
+ exports.company = company;
12
+ const gate = __importStar(require("./modules/gate"));
13
+ exports.gate = gate;
14
+ const warehouse = __importStar(require("./modules/warehouse"));
15
+ exports.warehouse = warehouse;
7
16
  var joi_1 = require("./common/joi");
8
17
  exports.joi = joi_1.joi;
9
18
  var database_errors_1 = require("./common/database-errors");
10
19
  exports.databaseErrors = database_errors_1.databaseErrors;
11
- var company_1 = require("./modules/company/company");
12
- exports.company = company_1.company;
@@ -1,8 +1,4 @@
1
- export declare const company: {
2
- name: {
3
- ptBR: string;
4
- es: string;
5
- };
1
+ export declare const fields: {
6
2
  cnpj: {
7
3
  ptBR: string;
8
4
  es: string;
@@ -51,15 +47,19 @@ export declare const company: {
51
47
  ptBR: string;
52
48
  es: string;
53
49
  };
54
- external_id: {
50
+ alert_emails: {
55
51
  ptBR: string;
56
52
  es: string;
57
53
  };
58
- alert_emails: {
54
+ alert_users: {
59
55
  ptBR: string;
60
56
  es: string;
61
57
  };
62
- alert_users: {
58
+ name: {
59
+ ptBR: string;
60
+ es: string;
61
+ };
62
+ external_id: {
63
63
  ptBR: string;
64
64
  es: string;
65
65
  };
@@ -1,68 +1,46 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.company = {
4
- name: {
5
- ptBR: 'Nome',
6
- es: 'Nombre'
7
- },
8
- cnpj: {
3
+ const entity_1 = require("../common/entity");
4
+ exports.fields = Object.assign({}, entity_1.ENTITY_COMMON, { cnpj: {
9
5
  ptBR: 'CNPJ/CPF',
10
6
  es: 'CNPJ/CPF'
11
- },
12
- address: {
7
+ }, address: {
13
8
  ptBR: 'Endereço',
14
9
  es: 'Dirección'
15
- },
16
- address_num: {
10
+ }, address_num: {
17
11
  ptBR: 'Nº',
18
12
  es: 'Nº'
19
- },
20
- address_neighborhood: {
13
+ }, address_neighborhood: {
21
14
  ptBR: 'Bairro',
22
15
  es: 'Bario'
23
- },
24
- address_state_id: {
16
+ }, address_state_id: {
25
17
  ptBR: 'UF',
26
18
  es: 'Provincia'
27
- },
28
- address_city_id: {
19
+ }, address_city_id: {
29
20
  ptBR: 'Cidade',
30
21
  es: 'Ciudad'
31
- },
32
- address_complementary: {
22
+ }, address_complementary: {
33
23
  ptBR: 'Complemento',
34
24
  es: 'Complemento'
35
- },
36
- postal_code: {
25
+ }, postal_code: {
37
26
  ptBR: 'CEP',
38
27
  es: 'Codico postal'
39
- },
40
- responsible: {
28
+ }, responsible: {
41
29
  ptBR: 'Responsável',
42
30
  es: 'Responsable'
43
- },
44
- cnae: {
31
+ }, cnae: {
45
32
  ptBR: 'CNAE',
46
33
  es: 'CNAE'
47
- },
48
- cnae_description: {
34
+ }, cnae_description: {
49
35
  ptBR: 'Descrição do CNAE',
50
36
  es: 'Descrición del CNAE'
51
- },
52
- secondary_cnae: {
37
+ }, secondary_cnae: {
53
38
  ptBR: 'CNAE Secundário',
54
39
  es: 'CNAE Segundario'
55
- },
56
- external_id: {
57
- ptBR: 'Chave externa',
58
- es: 'Clave externa'
59
- },
60
- alert_emails: {
40
+ }, alert_emails: {
61
41
  ptBR: 'Emails para recebimento de alerta',
62
42
  es: 'Emails para recebimiento de alerta'
63
- },
64
- alert_users: {
43
+ }, alert_users: {
65
44
  ptBR: 'Usuários para recebimento de alertas',
66
45
  es: 'Usuarios para recebimento de alertas'
67
- }
68
- };
46
+ } });
@@ -0,0 +1,10 @@
1
+ export declare const fields: {
2
+ name: {
3
+ ptBR: string;
4
+ es: string;
5
+ };
6
+ external_id: {
7
+ ptBR: string;
8
+ es: string;
9
+ };
10
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const entity_1 = require("../common/entity");
4
+ exports.fields = Object.assign({}, entity_1.ENTITY_COMMON);
@@ -0,0 +1,24 @@
1
+ export declare const fields: {
2
+ subsidiary_id: {
3
+ ptBR: string;
4
+ es: string;
5
+ };
6
+ active: {
7
+ ptBR: string;
8
+ es: string;
9
+ };
10
+ name: {
11
+ ptBR: string;
12
+ es: string;
13
+ };
14
+ external_id: {
15
+ ptBR: string;
16
+ es: string;
17
+ };
18
+ };
19
+ export declare const messages: {
20
+ cant_be_disabled: {
21
+ ptBR: string;
22
+ es: string;
23
+ };
24
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const entity_1 = require("../common/entity");
4
+ exports.fields = Object.assign({}, entity_1.ENTITY_COMMON, { subsidiary_id: {
5
+ ptBR: 'Filial',
6
+ es: 'Filial'
7
+ }, active: {
8
+ ptBR: 'Ativo',
9
+ es: 'Activo'
10
+ } });
11
+ exports.messages = {
12
+ cant_be_disabled: {
13
+ ptBR: 'O depósito ainda contém itens e não pode ser desativado!',
14
+ es: 'El depósito todavía contiene elementos y no se puede deshabilitar!'
15
+ }
16
+ };
@@ -7,10 +7,10 @@ describe('Vehicle locale test', () => {
7
7
 
8
8
  it('Should get translations with reach', () => {
9
9
 
10
- expect(localeptBR.reach(i18n.gate.name))
11
- .toEqual(i18n.gate.name.ptBR);
12
- expect(localeES.reach(i18n.gate.name))
13
- .toEqual(i18n.gate.name.es);
10
+ expect(localeptBR.reach(i18n.gate.fields.name))
11
+ .toEqual(i18n.gate.fields.name.ptBR);
12
+ expect(localeES.reach(i18n.gate.fields.name))
13
+ .toEqual(i18n.gate.fields.name.es);
14
14
  });
15
15
 
16
16
  it('Should replace correctly with reach', () => {
@@ -25,14 +25,14 @@ describe('Joi tests', () => {
25
25
  key: 'cf_1',
26
26
  label: 'mararaia'
27
27
  }
28
- } as any)).toEqual('mararaia precisa ser um texto.');
28
+ } as any)).toEqual('mararaia precisa ser do tipo texto.');
29
29
  expect(localeptES.joi({
30
30
  type: 'string.base',
31
31
  context: {
32
32
  key: 'cf_1',
33
33
  label: 'mararaia'
34
34
  }
35
- } as any)).toEqual('mararaia debe se uno texto.');
35
+ } as any)).toEqual('mararaia debe se del tipo texto.');
36
36
  });
37
37
 
38
38
  it('should return translated label message', () => {
@@ -41,16 +41,16 @@ describe('Joi tests', () => {
41
41
  type: 'string.base',
42
42
  context: {
43
43
  key: 'otra',
44
- label: 'gate.name'
44
+ label: 'gate.fields.name'
45
45
  }
46
- } as any)).toEqual('Nome precisa ser um texto.');
46
+ } as any)).toEqual('Nome precisa ser do tipo texto.');
47
47
  expect(localeptES.joi({
48
48
  type: 'string.base',
49
49
  context: {
50
50
  key: 'otra',
51
- label: 'gate.name'
51
+ label: 'gate.fields.name'
52
52
  }
53
- } as any)).toEqual('Nombre debe se uno texto.');
53
+ } as any)).toEqual('Nombre debe se del tipo texto.');
54
54
  });
55
55
 
56
56
  it('should return translated label index', () => {
@@ -62,7 +62,7 @@ describe('Joi tests', () => {
62
62
  key: 0,
63
63
  label: 0
64
64
  }
65
- } as any)).toEqual('1º valor de path precisa ser um texto.');
65
+ } as any)).toEqual('1º valor de path precisa ser do tipo texto.');
66
66
  expect(localeptES.joi({
67
67
  type: 'string.base',
68
68
  path: ['path'],
@@ -70,6 +70,6 @@ describe('Joi tests', () => {
70
70
  key: 0,
71
71
  label: 0
72
72
  }
73
- } as any)).toEqual('1er valor de path debe se uno texto.');
73
+ } as any)).toEqual('1er valor de path debe se del tipo texto.');
74
74
  });
75
75
  });
@@ -0,0 +1,10 @@
1
+ export const ENTITY_COMMON = {
2
+ name: {
3
+ ptBR: 'Nome',
4
+ es: 'Nombre'
5
+ },
6
+ external_id: {
7
+ ptBR: 'Chave externa',
8
+ es: 'Clave externa'
9
+ }
10
+ };
@@ -6,16 +6,16 @@ export const joi: ITranslation = {
6
6
  es: '{{index}}er valor de {{path}}'
7
7
  },
8
8
  'string.base': {
9
- ptBR: '{{label}} precisa ser um texto.',
10
- es: '{{label}} debe se uno texto.'
9
+ ptBR: '{{label}} precisa ser do tipo texto.',
10
+ es: '{{label}} debe se del tipo texto.'
11
11
  },
12
12
  'string.email': {
13
13
  ptBR: '{{label}} precisa ser um email válido.',
14
14
  es: '{{label}}'
15
15
  },
16
16
  'number.base': {
17
- ptBR: '{{label}} precisa ser numérico.',
18
- es: '{{label}} debe ser numérico.'
17
+ ptBR: '{{label}} precisa ser do tipo numérico.',
18
+ es: '{{label}} debe ser del tipo numérico.'
19
19
  },
20
20
  'number.min': {
21
21
  ptBR: '{{label}} precisa ter no mínimo {{limit}}.',
@@ -1,5 +1,12 @@
1
- export { gate } from './modules/gate/gate';
2
- export { button } from './common/buttons';
1
+ import * as company from './modules/company';
2
+ import * as gate from './modules/gate';
3
+ import * as warehouse from './modules/warehouse';
4
+
3
5
  export { joi } from './common/joi';
4
6
  export { databaseErrors } from './common/database-errors';
5
- export { company } from './modules/company/company';
7
+
8
+ export {
9
+ gate,
10
+ company,
11
+ warehouse
12
+ };
@@ -1,8 +1,7 @@
1
- export const company = {
2
- name: {
3
- ptBR: 'Nome',
4
- es: 'Nombre'
5
- },
1
+ import { ENTITY_COMMON } from '../common/entity';
2
+
3
+ export const fields = {
4
+ ...ENTITY_COMMON,
6
5
  cnpj: {
7
6
  ptBR: 'CNPJ/CPF',
8
7
  es: 'CNPJ/CPF'
@@ -51,10 +50,6 @@ export const company = {
51
50
  ptBR: 'CNAE Secundário',
52
51
  es: 'CNAE Segundario'
53
52
  },
54
- external_id: {
55
- ptBR: 'Chave externa',
56
- es: 'Clave externa'
57
- },
58
53
  alert_emails: {
59
54
  ptBR: 'Emails para recebimento de alerta',
60
55
  es: 'Emails para recebimiento de alerta'
@@ -0,0 +1,5 @@
1
+ import { ENTITY_COMMON } from '../common/entity';
2
+
3
+ export const fields = {
4
+ ...ENTITY_COMMON
5
+ };
@@ -0,0 +1,20 @@
1
+ import { ENTITY_COMMON } from '../common/entity';
2
+
3
+ export const fields = {
4
+ ...ENTITY_COMMON,
5
+ subsidiary_id: {
6
+ ptBR: 'Filial',
7
+ es: 'Filial'
8
+ },
9
+ active: {
10
+ ptBR: 'Ativo',
11
+ es: 'Activo'
12
+ }
13
+ };
14
+
15
+ export const messages = {
16
+ cant_be_disabled: {
17
+ ptBR: 'O depósito ainda contém itens e não pode ser desativado!',
18
+ es: 'El depósito todavía contiene elementos y no se puede deshabilitar!'
19
+ }
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sofit/view-locale",
3
- "version": "0.3.1",
3
+ "version": "1.0.0",
4
4
  "description": "Traduções do Sofit View",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,2 +0,0 @@
1
- import { ITranslation } from '../translation.interface';
2
- export declare const button: ITranslation;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.button = {
4
- maria: {
5
- ptBR: 'maira',
6
- es: 'pedro'
7
- }
8
- };
@@ -1,2 +0,0 @@
1
- import { ITranslation } from '../../translation.interface';
2
- export declare const gate: ITranslation;
@@ -1,8 +0,0 @@
1
- import { ITranslation } from '../translation.interface';
2
-
3
- export const button: ITranslation = {
4
- maria: {
5
- ptBR: 'maira',
6
- es: 'pedro'
7
- }
8
- };
@@ -1,8 +0,0 @@
1
- import { ITranslation } from '../../translation.interface';
2
-
3
- export const gate: ITranslation = {
4
- name: {
5
- ptBR: 'Nome',
6
- es: 'Nombre'
7
- }
8
- };