dmencu 2.0.19 → 2.0.20

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.
Files changed (63) hide show
  1. package/dist/client/unlogged/css/bootstrap.min.css +6 -6
  2. package/dist/client/unlogged/tsconfig.json +14 -14
  3. package/dist/server/server/app-dmencu.js +16 -3
  4. package/dist/server/server/{table-comunas copy.d.ts → table-barrios.d.ts} +1 -1
  5. package/dist/server/server/table-barrios.js +35 -0
  6. package/dist/server/server/table-comunas.js +4 -1
  7. package/dist/server/server/table-encuestadores.js +7 -7
  8. package/dist/server/server/table-fracciones.d.ts +2 -0
  9. package/dist/server/server/table-fracciones.js +37 -0
  10. package/dist/server/server/table-hogares.js +1 -1
  11. package/dist/server/server/table-hogares_sup.js +1 -1
  12. package/dist/server/server/table-manzanas.d.ts +2 -0
  13. package/dist/server/server/table-manzanas.js +39 -0
  14. package/dist/server/server/table-parametros.js +1 -1
  15. package/dist/server/server/table-personal.js +7 -7
  16. package/dist/server/server/table-personal_rol.js +7 -7
  17. package/dist/server/server/table-personas.js +1 -1
  18. package/dist/server/server/table-personas_sup.js +1 -1
  19. package/dist/server/server/table-radios.d.ts +2 -0
  20. package/dist/server/server/table-radios.js +37 -0
  21. package/dist/server/server/table-recepcionistas.js +1 -1
  22. package/dist/server/server/table-visitas.js +1 -1
  23. package/dist/server/server/table-visitas_sup.js +1 -1
  24. package/dist/server/server/table-viviendas.js +1 -1
  25. package/dist/unlogged/unlogged/css/bootstrap.min.css +6 -6
  26. package/dist/unlogged/unlogged/tsconfig.json +14 -14
  27. package/install/actualizar-2023-05-14.sql +38 -38
  28. package/install/actualizar_inconvar.sql +28 -28
  29. package/install/agregados_tem.sql +4 -4
  30. package/install/asignar_desasignar_tareas_tem_trg.sql +43 -43
  31. package/install/metadatos/permisos.tab +11 -11
  32. package/install/metadatos/roles.tab +10 -10
  33. package/install/metadatos/roles_permisos.tab +94 -94
  34. package/install/metadatos/tipovar.tab +9 -9
  35. package/install/sincro_tareas_areas_tareas_tem_trg.sql +29 -29
  36. package/install/usuarios_trg.sql +41 -41
  37. package/install/validar_tareas_tem_trg.sql +67 -67
  38. package/package.json +91 -91
  39. package/dist/client/server/table-tem.d.ts +0 -3
  40. package/dist/client/server/table-tem.js +0 -239
  41. package/dist/client/server/types-dmencu.d.ts +0 -48
  42. package/dist/client/server/types-dmencu.js +0 -33
  43. package/dist/server/server/table-comunas copy.js +0 -28
  44. package/dist/unlogged/unlogged/server/table-tem.d.ts +0 -3
  45. package/dist/unlogged/unlogged/server/table-tem.js +0 -239
  46. package/dist/unlogged/unlogged/server/types-dmencu.d.ts +0 -48
  47. package/dist/unlogged/unlogged/server/types-dmencu.js +0 -33
  48. package/dist/unlogged/unlogged/unlogged/abrir-formulario.d.ts +0 -13
  49. package/dist/unlogged/unlogged/unlogged/abrir-formulario.js +0 -109
  50. package/dist/unlogged/unlogged/unlogged/adapt.d.ts +0 -0
  51. package/dist/unlogged/unlogged/unlogged/adapt.js +0 -8
  52. package/dist/unlogged/unlogged/unlogged/bypass-formulario.d.ts +0 -202
  53. package/dist/unlogged/unlogged/unlogged/bypass-formulario.js +0 -1100
  54. package/dist/unlogged/unlogged/unlogged/redux-formulario.d.ts +0 -349
  55. package/dist/unlogged/unlogged/unlogged/redux-formulario.js +0 -318
  56. package/dist/unlogged/unlogged/unlogged/render-formulario.d.ts +0 -86
  57. package/dist/unlogged/unlogged/unlogged/render-formulario.js +0 -1692
  58. package/dist/unlogged/unlogged/unlogged/render-general.d.ts +0 -127
  59. package/dist/unlogged/unlogged/unlogged/render-general.js +0 -176
  60. package/dist/unlogged/unlogged/unlogged/tipos.d.ts +0 -486
  61. package/dist/unlogged/unlogged/unlogged/tipos.js +0 -22
  62. package/dist/unlogged/unlogged/unlogged/unlogged.d.ts +0 -1
  63. package/dist/unlogged/unlogged/unlogged/unlogged.js +0 -180
@@ -1,41 +1,41 @@
1
- --set role dmencu_owner;
2
- set role to ut2023_muleto_owner;
3
- set search_path=base;
4
-
5
- DROP FUNCTION if exists usuarios_trg();
6
- set search_path = base;
7
-
8
- CREATE OR REPLACE FUNCTION usuarios_trg()
9
- RETURNS trigger
10
- LANGUAGE 'plpgsql'
11
- AS $BODY$
12
- declare
13
- v_rol_usuario_actual text;
14
- v_puede_asignar_rol boolean;
15
- begin
16
- if new.rol is distinct from old.rol then
17
- select rol
18
- into v_rol_usuario_actual
19
- from usuarios
20
- where usuario = split_part(current_setting('application_name'),' ',1);
21
- select true
22
- into v_puede_asignar_rol
23
- from roles_subordinados
24
- where rol = v_rol_usuario_actual and rol_subordinado = new.rol;
25
- if v_puede_asignar_rol or v_rol_usuario_actual = 'admin' then
26
- null;
27
- else
28
- raise exception 'No se peude asignar el rol %', new.rol;
29
- end if;
30
- end if;
31
- return new;
32
- end;
33
- $BODY$;
34
-
35
- DROP TRIGGER IF EXISTS usuarios_trg ON usuarios;
36
- CREATE TRIGGER usuarios_trg
37
- BEFORE UPDATE OR INSERT
38
- ON usuarios
39
- FOR EACH ROW
40
- EXECUTE PROCEDURE usuarios_trg();
41
-
1
+ --set role dmencu_owner;
2
+ set role to ut2023_muleto_owner;
3
+ set search_path=base;
4
+
5
+ DROP FUNCTION if exists usuarios_trg();
6
+ set search_path = base;
7
+
8
+ CREATE OR REPLACE FUNCTION usuarios_trg()
9
+ RETURNS trigger
10
+ LANGUAGE 'plpgsql'
11
+ AS $BODY$
12
+ declare
13
+ v_rol_usuario_actual text;
14
+ v_puede_asignar_rol boolean;
15
+ begin
16
+ if new.rol is distinct from old.rol then
17
+ select rol
18
+ into v_rol_usuario_actual
19
+ from usuarios
20
+ where usuario = split_part(current_setting('application_name'),' ',1);
21
+ select true
22
+ into v_puede_asignar_rol
23
+ from roles_subordinados
24
+ where rol = v_rol_usuario_actual and rol_subordinado = new.rol;
25
+ if v_puede_asignar_rol or v_rol_usuario_actual = 'admin' then
26
+ null;
27
+ else
28
+ raise exception 'No se peude asignar el rol %', new.rol;
29
+ end if;
30
+ end if;
31
+ return new;
32
+ end;
33
+ $BODY$;
34
+
35
+ DROP TRIGGER IF EXISTS usuarios_trg ON usuarios;
36
+ CREATE TRIGGER usuarios_trg
37
+ BEFORE UPDATE OR INSERT
38
+ ON usuarios
39
+ FOR EACH ROW
40
+ EXECUTE PROCEDURE usuarios_trg();
41
+
@@ -1,67 +1,67 @@
1
- --set role dmencu_owner;
2
- --set search_path=base;
3
-
4
- DROP FUNCTION if exists validar_tareas_tem_trg();
5
- set search_path = base;
6
-
7
- CREATE OR REPLACE FUNCTION validar_tareas_tem_trg()
8
- RETURNS trigger
9
- LANGUAGE 'plpgsql'
10
- AS $BODY$
11
- declare
12
- v_habilitada boolean;
13
- v_tarea_actual text;
14
- v_permite_asignar boolean;
15
- v_estado_al_asignar text;
16
- v_tarea_inicial text;
17
- begin
18
- select tarea_actual, habilitada into v_tarea_actual, v_habilitada
19
- from tem
20
- where operativo = new.operativo and enc = new.enc;
21
- select permite_asignar, estado_al_asignar into v_permite_asignar, v_estado_al_asignar
22
- from estados
23
- where operativo = new.operativo and estado = new.estado;
24
- select tarea into v_tarea_inicial
25
- from tareas
26
- where operativo = new.operativo and es_inicial;
27
- if v_habilitada then
28
- if old.asignado is distinct from new.asignado then
29
- if not v_permite_asignar then
30
- raise exception 'Error: no es posible asignar en la encuesta % del operativo % ya que su estado no lo permite', new.enc, new.operativo;
31
- end if;
32
- if new.recepcionista is null then
33
- raise exception 'Error: no es posible asignar en la encuesta % del operativo % ya que no se indicó un/a recepcionista', new.enc, new.operativo;
34
- end if;
35
- if not (new.tarea = coalesce(v_tarea_actual,'nulo') or new.tarea = v_tarea_inicial) then
36
- raise exception 'Error: no es posible modificar la encuesta % del operativo % ya que la tarea actual definida en TEM no coincide con la tarea %', new.enc, new.operativo, new.tarea;
37
- end if;
38
- end if;
39
- if old.recepcionista is distinct from new.recepcionista then
40
- if new.recepcionista is null and new.asignado is not null then
41
- raise exception 'Error: no es posible quitar el recepcionista de la encuesta % del operativo % ya que se la misma se encuentra asignada', new.enc, new.operativo;
42
- end if;
43
- end if;
44
- if old.asignado is distinct from new.asignado then
45
- if new.asignado is null then
46
- new.estado = '0D';
47
- else
48
- --if v_tarea_actual is distinct from new.tarea then
49
- if v_estado_al_asignar is not null then
50
- new.estado = v_estado_al_asignar;
51
- end if;
52
- --end if;
53
- end if;
54
- end if;
55
- else
56
- raise exception 'Error: la encuesta % del operativo % se encuentra deshabilitada', new.enc, new.operativo;
57
- end if;
58
- return new;
59
- end;
60
- $BODY$;
61
-
62
- DROP TRIGGER IF EXISTS validar_tareas_tem_trg ON tareas_tem;
63
- CREATE TRIGGER validar_tareas_tem_trg
64
- BEFORE UPDATE
65
- ON tareas_tem
66
- FOR EACH ROW
67
- EXECUTE PROCEDURE validar_tareas_tem_trg();
1
+ --set role dmencu_owner;
2
+ --set search_path=base;
3
+
4
+ DROP FUNCTION if exists validar_tareas_tem_trg();
5
+ set search_path = base;
6
+
7
+ CREATE OR REPLACE FUNCTION validar_tareas_tem_trg()
8
+ RETURNS trigger
9
+ LANGUAGE 'plpgsql'
10
+ AS $BODY$
11
+ declare
12
+ v_habilitada boolean;
13
+ v_tarea_actual text;
14
+ v_permite_asignar boolean;
15
+ v_estado_al_asignar text;
16
+ v_tarea_inicial text;
17
+ begin
18
+ select tarea_actual, habilitada into v_tarea_actual, v_habilitada
19
+ from tem
20
+ where operativo = new.operativo and enc = new.enc;
21
+ select permite_asignar, estado_al_asignar into v_permite_asignar, v_estado_al_asignar
22
+ from estados
23
+ where operativo = new.operativo and estado = new.estado;
24
+ select tarea into v_tarea_inicial
25
+ from tareas
26
+ where operativo = new.operativo and es_inicial;
27
+ if v_habilitada then
28
+ if old.asignado is distinct from new.asignado then
29
+ if not v_permite_asignar then
30
+ raise exception 'Error: no es posible asignar en la encuesta % del operativo % ya que su estado no lo permite', new.enc, new.operativo;
31
+ end if;
32
+ if new.recepcionista is null then
33
+ raise exception 'Error: no es posible asignar en la encuesta % del operativo % ya que no se indicó un/a recepcionista', new.enc, new.operativo;
34
+ end if;
35
+ if not (new.tarea = coalesce(v_tarea_actual,'nulo') or new.tarea = v_tarea_inicial) then
36
+ raise exception 'Error: no es posible modificar la encuesta % del operativo % ya que la tarea actual definida en TEM no coincide con la tarea %', new.enc, new.operativo, new.tarea;
37
+ end if;
38
+ end if;
39
+ if old.recepcionista is distinct from new.recepcionista then
40
+ if new.recepcionista is null and new.asignado is not null then
41
+ raise exception 'Error: no es posible quitar el recepcionista de la encuesta % del operativo % ya que se la misma se encuentra asignada', new.enc, new.operativo;
42
+ end if;
43
+ end if;
44
+ if old.asignado is distinct from new.asignado then
45
+ if new.asignado is null then
46
+ new.estado = '0D';
47
+ else
48
+ --if v_tarea_actual is distinct from new.tarea then
49
+ if v_estado_al_asignar is not null then
50
+ new.estado = v_estado_al_asignar;
51
+ end if;
52
+ --end if;
53
+ end if;
54
+ end if;
55
+ else
56
+ raise exception 'Error: la encuesta % del operativo % se encuentra deshabilitada', new.enc, new.operativo;
57
+ end if;
58
+ return new;
59
+ end;
60
+ $BODY$;
61
+
62
+ DROP TRIGGER IF EXISTS validar_tareas_tem_trg ON tareas_tem;
63
+ CREATE TRIGGER validar_tareas_tem_trg
64
+ BEFORE UPDATE
65
+ ON tareas_tem
66
+ FOR EACH ROW
67
+ EXECUTE PROCEDURE validar_tareas_tem_trg();
package/package.json CHANGED
@@ -1,91 +1,91 @@
1
- {
2
- "name": "dmencu",
3
- "description": "DM Encu - Encuestas en dispositivo móvil",
4
- "version": "2.0.19",
5
- "author": "Codenautas <codenautas@googlegroups.com>",
6
- "license": "MIT",
7
- "main": "dist/server/server/app-dmencu.js",
8
- "types": "dist/server/server/app-dmencu.d.ts",
9
- "files": [
10
- "dist",
11
- "install"
12
- ],
13
- "dependencies": {
14
- "@mui/material": "^5.16.7",
15
- "memoize-one": "~6.0.0",
16
- "meta-enc": "^1.4.16",
17
- "procesamiento": "^2.0.10",
18
- "backend-plus": "^2.5.2-betha.4",
19
- "qrcode": "^1.5.3",
20
- "react": "~17.0.2",
21
- "react-dom": "~17.0.2",
22
- "react-redux": "~7.2.6",
23
- "redux": "~4.1.2",
24
- "redux-typed-reducer": "~0.1.1",
25
- "service-worker-admin": "^0.2.1",
26
- "yazl": "~2.5.1",
27
- "row-validator": "^1.0.0-rc1",
28
- "like-ar": "^0.3.9"
29
- },
30
- "dependencias provisorias: las que se pongan en dependencias ponerlas acá y sacarlas juntas": {},
31
- "devDependencies": {
32
- "@types/mocha": "^10.0.1",
33
- "@types/node": "^20.3.0",
34
- "@types/qrcode": "^1.5.0",
35
- "@types/react": "^17.0.38",
36
- "@types/react-dom": "^17.0.11",
37
- "@types/react-redux": "^7.1.22",
38
- "@types/yazl": "~2.4.2",
39
- "mixin-patch": "~0.4.1",
40
- "pg-triggers": "~0.3.2",
41
- "types.d.ts": "~0.6.15",
42
- "typescript": "^5.1.3"
43
- },
44
- "engines": {
45
- "node": ">= 16.18.0"
46
- },
47
- "scripts": {
48
- "prepare": "npm run build",
49
- "build": "(tsc -p src/server || echo \"continue w/error\") && (tsc -p src/unlogged || echo \"continue w/error\") && (tsc -p src/client || echo \"continue w/error\") && mixin-patch",
50
- "build-client": "(tsc -p src/client || echo \"continue w/error\") && mixin-patch",
51
- "build-unlogged": "(tsc -p src/unlogged || echo \"continue w/error\") && mixin-patch",
52
- "mixin-patch": "mixin-patch",
53
- "watch:buildC": "(tsc -p src/client --watch || echo \"continue w/error\")",
54
- "watch:buildS": "(tsc -p src/server --watch || echo \"continue w/error\")",
55
- "watch:buildU": "(tsc -p src/unlogged --watch || echo \"continue w/error\")",
56
- "test": "mocha --reporter spec --bail --check-leaks test/",
57
- "start": "node dist/server/server/server-dmencu.js",
58
- "dump": "npm start -- --dump-db",
59
- "bdump": "npm run build && npm run dump",
60
- "git-commit": "git add package.json && (git commit -m \"upgrading stack dependencies\" || true)",
61
- "push-publish": "npm version patch && npm run git-commit && npm publish && git push"
62
- },
63
- "config": {
64
- "stackFolder": "../../codenautas"
65
- },
66
- "qa-control": {
67
- "package-version": "0.3.0",
68
- "coverage": 90,
69
- "run-in": "server",
70
- "stability": "extending",
71
- "type": "app",
72
- "ecmaVersion": 6
73
- },
74
- "mixin-patch": {
75
- "patch": false,
76
- "copy": [
77
- {
78
- "from": "src/client",
79
- "to": "dist/client/client"
80
- },
81
- {
82
- "from": "src/unlogged",
83
- "to": "dist/unlogged/unlogged"
84
- },
85
- {
86
- "from": "src/unlogged",
87
- "to": "dist/client/unlogged"
88
- }
89
- ]
90
- }
91
- }
1
+ {
2
+ "name": "dmencu",
3
+ "description": "DM Encu - Encuestas en dispositivo móvil",
4
+ "version": "2.0.20",
5
+ "author": "Codenautas <codenautas@googlegroups.com>",
6
+ "license": "MIT",
7
+ "main": "dist/server/server/app-dmencu.js",
8
+ "types": "dist/server/server/app-dmencu.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "install"
12
+ ],
13
+ "dependencies": {
14
+ "@mui/material": "^5.16.7",
15
+ "memoize-one": "~6.0.0",
16
+ "meta-enc": "^1.4.16",
17
+ "procesamiento": "^2.0.10",
18
+ "backend-plus": "^2.5.2-betha.4",
19
+ "qrcode": "^1.5.3",
20
+ "react": "~17.0.2",
21
+ "react-dom": "~17.0.2",
22
+ "react-redux": "~7.2.6",
23
+ "redux": "~4.1.2",
24
+ "redux-typed-reducer": "~0.1.1",
25
+ "service-worker-admin": "^0.2.1",
26
+ "yazl": "~2.5.1",
27
+ "row-validator": "^1.0.0-rc1",
28
+ "like-ar": "^0.3.9"
29
+ },
30
+ "dependencias provisorias: las que se pongan en dependencias ponerlas acá y sacarlas juntas": {},
31
+ "devDependencies": {
32
+ "@types/mocha": "^10.0.1",
33
+ "@types/node": "^20.3.0",
34
+ "@types/qrcode": "^1.5.0",
35
+ "@types/react": "^17.0.38",
36
+ "@types/react-dom": "^17.0.11",
37
+ "@types/react-redux": "^7.1.22",
38
+ "@types/yazl": "~2.4.2",
39
+ "mixin-patch": "~0.4.1",
40
+ "pg-triggers": "~0.3.2",
41
+ "types.d.ts": "~0.6.15",
42
+ "typescript": "^5.1.3"
43
+ },
44
+ "engines": {
45
+ "node": ">= 16.18.0"
46
+ },
47
+ "scripts": {
48
+ "prepare": "npm run build",
49
+ "build": "(tsc -p src/server || echo \"continue w/error\") && (tsc -p src/unlogged || echo \"continue w/error\") && (tsc -p src/client || echo \"continue w/error\") && mixin-patch",
50
+ "build-client": "(tsc -p src/client || echo \"continue w/error\") && mixin-patch",
51
+ "build-unlogged": "(tsc -p src/unlogged || echo \"continue w/error\") && mixin-patch",
52
+ "mixin-patch": "mixin-patch",
53
+ "watch:buildC": "(tsc -p src/client --watch || echo \"continue w/error\")",
54
+ "watch:buildS": "(tsc -p src/server --watch || echo \"continue w/error\")",
55
+ "watch:buildU": "(tsc -p src/unlogged --watch || echo \"continue w/error\")",
56
+ "test": "mocha --reporter spec --bail --check-leaks test/",
57
+ "start": "node dist/server/server/server-dmencu.js",
58
+ "dump": "npm start -- --dump-db",
59
+ "bdump": "npm run build && npm run dump",
60
+ "git-commit": "git add package.json && (git commit -m \"upgrading stack dependencies\" || true)",
61
+ "push-publish": "npm version patch && npm run git-commit && npm publish && git push"
62
+ },
63
+ "config": {
64
+ "stackFolder": "../../codenautas"
65
+ },
66
+ "qa-control": {
67
+ "package-version": "0.3.0",
68
+ "coverage": 90,
69
+ "run-in": "server",
70
+ "stability": "extending",
71
+ "type": "app",
72
+ "ecmaVersion": 6
73
+ },
74
+ "mixin-patch": {
75
+ "patch": false,
76
+ "copy": [
77
+ {
78
+ "from": "src/client",
79
+ "to": "dist/client/client"
80
+ },
81
+ {
82
+ "from": "src/unlogged",
83
+ "to": "dist/unlogged/unlogged"
84
+ },
85
+ {
86
+ "from": "src/unlogged",
87
+ "to": "dist/client/unlogged"
88
+ }
89
+ ]
90
+ }
91
+ }
@@ -1,3 +0,0 @@
1
- import { TableDefinition, ContextForDump, FieldDefinition } from "./types-dmencu";
2
- export declare var getDomicilioFields: () => FieldDefinition[];
3
- export declare function tem(context: ContextForDump, opts?: any): TableDefinition;