Compare commits
1175 Commits
warning_de
...
dev
Author | SHA1 | Date |
---|---|---|
|
f8b41101d3 | |
|
d060e88ebb | |
|
b75578b6fb | |
|
8380808ffa | |
|
b1f0cc7f1d | |
|
94849d0cdf | |
|
0692de7bfb | |
|
f01e5b824e | |
|
d9897b3ea2 | |
|
de6020626f | |
|
05f6e1ec20 | |
|
0adb86d4f2 | |
|
86b77c2022 | |
|
0901c57b12 | |
|
154a893580 | |
|
780e7839f4 | |
|
89df2e837c | |
|
c72d4e9f04 | |
|
2550add549 | |
|
1a420abfb2 | |
|
fc44424dda | |
|
4994a94369 | |
|
48e40cdc46 | |
|
5e17af2fae | |
|
e8a90faa62 | |
|
07eacdcebf | |
|
117ce937fe | |
|
64a52e0183 | |
|
063ac0cb7b | |
|
671018ea2e | |
|
63a8f0f3c7 | |
|
f9ba0642e1 | |
|
f991aa0aa8 | |
|
848d00a8b3 | |
|
6732effe0c | |
|
c6758c3346 | |
|
85c4d79443 | |
|
f37294f229 | |
|
017f435da6 | |
|
ae36d676f5 | |
|
a1555a4c54 | |
|
ab2d3fc4dc | |
|
80337c61df | |
|
5d7bfec177 | |
|
ded1dae481 | |
|
a88696d590 | |
|
502f41993a | |
|
2ed9323f0f | |
|
a06cfa12a4 | |
|
841195eca0 | |
|
698edfbe72 | |
|
97dfeca20d | |
|
5cb2b326f1 | |
|
b5b52dcda0 | |
|
7ece059610 | |
|
fcdc69d7c8 | |
|
a338dbed70 | |
|
676ce400ac | |
|
1b52468e14 | |
|
3aa5bdac92 | |
|
883eb7d57a | |
|
c6cf2ed144 | |
|
cf7bcdae7a | |
|
c8943e43fd | |
|
b0b04ad017 | |
|
0d2aada01f | |
|
4848a89ca2 | |
|
018327a9ec | |
|
896626a1fd | |
|
b45e529879 | |
|
2eb38382f4 | |
|
65b5094e23 | |
|
5696a44c1b | |
|
5078559668 | |
|
a25744c4a4 | |
|
6e8f2754e5 | |
|
82cc153c98 | |
|
93ece4bf07 | |
|
4b66a8dea5 | |
|
f7db8d671c | |
|
43284e3b79 | |
|
0b7f2895a7 | |
|
2f6adfc515 | |
|
7364f055b7 | |
|
924d921b70 | |
|
54962fbb56 | |
|
5e2158daf4 | |
|
629b89fe2f | |
|
f132912da7 | |
|
f88fb130c6 | |
|
23ae5d7b4c | |
|
9ff1d3fa83 | |
|
b5ae9ab0c5 | |
|
0ecdaf89e7 | |
|
8c6a61a165 | |
|
a476bc2d6b | |
|
dbc1eee2e4 | |
|
01344d693e | |
|
419353e18b | |
|
06ceaf3820 | |
|
616725b956 | |
|
684418c550 | |
|
217942dfd0 | |
|
421970ba45 | |
|
a3177f126e | |
|
5c5a6069ce | |
|
2eb555f12f | |
|
c254c89bd8 | |
|
87e0b1661b | |
|
108edae586 | |
|
c65ac9f4db | |
|
ff28df13f8 | |
|
885437bb2e | |
|
cc9a4af169 | |
|
ac57141c0e | |
|
eabe29ed5c | |
|
ca01ceacde | |
|
4ad8bfc210 | |
|
edbdf221ff | |
|
e71278d7c8 | |
|
535fa77986 | |
|
5b4fdcc443 | |
|
de19f2b54c | |
|
13f09f13d2 | |
|
59fc86bfe9 | |
|
a4201368d7 | |
|
5147967bc0 | |
|
e3706094c2 | |
|
278788ead3 | |
|
11cfca5d80 | |
|
f2ef6c1c4e | |
|
b4b096ef9e | |
|
778d8fbb67 | |
|
d5f2dd8f06 | |
|
e18a1a6176 | |
|
4ddc07406a | |
|
035a42a895 | |
|
a1bba4496d | |
|
855da2b7bf | |
|
97df1d8fd2 | |
|
f18da15262 | |
|
c2042276ae | |
|
d8073e78ab | |
|
66665ba5dd | |
|
c83854c4c6 | |
|
359e67c734 | |
|
290a7273d0 | |
|
8d0d19d4c7 | |
|
6a7fcd1afe | |
|
909e6674d6 | |
|
0fe63abba6 | |
|
42b86f05ce | |
|
83e7a5f66a | |
|
5ae5cec9f9 | |
|
a09f430c60 | |
|
0fcd969c97 | |
|
e710d45011 | |
|
4d23c9f24b | |
|
84651c8a17 | |
|
ccff995680 | |
|
d94cd801cc | |
|
45a77a86f1 | |
|
4eebfd8769 | |
|
39d6e818f5 | |
|
f69ed548f0 | |
|
f6439ed356 | |
|
fea59a729e | |
|
194e7a3eb4 | |
|
645f3f3cb9 | |
|
fb902b54bc | |
|
5526987472 | |
|
c2a6dd7979 | |
|
1744524949 | |
|
5b2987c95e | |
|
bd2db2ef58 | |
|
4246275759 | |
|
858d2f842a | |
|
5250e59389 | |
|
b10cb9f09f | |
|
bcc4e5ba44 | |
|
2f80bc90af | |
|
f70dd41a37 | |
|
023593eb45 | |
|
67872aca10 | |
|
59ca61c96f | |
|
e5a449c80c | |
|
0de8af81d3 | |
|
6cd0df04e6 | |
|
e13f46613f | |
|
8e761f711d | |
|
65a8a78622 | |
|
c067006d08 | |
|
af940c67c6 | |
|
89cdd466b1 | |
|
311a40deef | |
|
58ec845402 | |
|
169389b5b8 | |
|
78da5f5393 | |
|
d5373ecbd6 | |
|
f26290a952 | |
|
ca7ae30991 | |
|
d4a93484c4 | |
|
399f2fd8fe | |
|
b083dada83 | |
|
f3042b0326 | |
|
b383efd99a | |
|
19fd0ee71b | |
|
22ae08863b | |
|
76ebb3beb4 | |
|
ffcf52a490 | |
|
abbfe7bc4a | |
|
56d1c0ca30 | |
|
374118133a | |
|
788c6e8b61 | |
|
7547461282 | |
|
ed211ba14b | |
|
860f92cb42 | |
|
b2414f861b | |
|
42e46a88fb | |
|
c0e3a14e8b | |
|
7759a49f3a | |
|
0d7d60a1e8 | |
|
3e8b35e2e1 | |
|
47603d1315 | |
|
983b91fbdd | |
|
f6fc19f210 | |
|
ed0f33dbc5 | |
|
c144da665e | |
|
e86c8f6263 | |
|
9c861f7544 | |
|
262ab78305 | |
|
223e14a850 | |
|
2b474cab67 | |
|
4d163c7e8f | |
|
de39839140 | |
|
c97b5bffd2 | |
|
962ae4ca96 | |
|
caffb672bc | |
|
6522df24b4 | |
|
b90f6b037c | |
|
71b5b8d47a | |
|
2d85ce32f9 | |
|
eabb71834f | |
|
ceb0c1fc75 | |
|
03bef91066 | |
|
2ee2002876 | |
|
a3beba5906 | |
|
68d1e1662e | |
|
dd3059b609 | |
|
ae0f08b2c6 | |
|
ebf2345fea | |
|
96b05de066 | |
|
b7a841d998 | |
|
8c680b375a | |
|
dc65f7ad20 | |
|
b87191c4d9 | |
|
1e2c86c74f | |
|
5e89b773ff | |
|
ed73a1459b | |
|
4d4598adf8 | |
|
ef129eb542 | |
|
b55ddf4cec | |
|
264881274d | |
|
8660b1bea4 | |
|
4050c2d3d0 | |
|
6ff774f1b0 | |
|
f3854d9682 | |
|
c9adf048cc | |
|
8ada6bd3e3 | |
|
c104240b1e | |
|
613ebc0eb4 | |
|
0a88479a9e | |
|
d3cc62d910 | |
|
74a6b20590 | |
|
d6338f1988 | |
|
8d2d73be46 | |
|
2fb7db051c | |
|
2be0f515c8 | |
|
6d1767207c | |
|
19769b1a8b | |
|
2baa7c02f0 | |
|
3652e28a61 | |
|
10c9bfe266 | |
|
45b9cffc10 | |
|
179c3daba8 | |
|
990ed74fef | |
|
5c280867e2 | |
|
9c790f734c | |
|
2dbda38ae7 | |
|
95f96d7ebd | |
|
88e040411f | |
|
a013152a09 | |
|
c30070f212 | |
|
36554f9f32 | |
|
63fc09ad1c | |
|
d749f52771 | |
|
01c4553e5f | |
|
c86731d9e8 | |
|
e156629775 | |
|
f38e184ab9 | |
|
53aff479e6 | |
|
a167c983d7 | |
|
cc193ce160 | |
|
533f8cfa93 | |
|
1d80d75e6a | |
|
e1c70f9302 | |
|
e644eec1fa | |
|
1a3446dd07 | |
|
a8b28de2a4 | |
|
db99a22254 | |
|
abe894c8bd | |
|
0d9bb8af1d | |
|
7748df1384 | |
|
30f61f970b | |
|
23aa972a85 | |
|
804fb28e11 | |
|
0c6da68962 | |
|
39d31ec330 | |
|
d1a27126d8 | |
|
b8ffc8c26c | |
|
4132bb2b46 | |
|
067ecbf2dc | |
|
ff813dc97a | |
|
ad5056a783 | |
|
5c761ca111 | |
|
4034320ff7 | |
|
c64aad02e1 | |
|
802af41a10 | |
|
fa5bdfc5f6 | |
|
9991c4a462 | |
|
fb43ff5b74 | |
|
0a6c38f959 | |
|
b2a345cf58 | |
|
19994e0772 | |
|
02494d4bed | |
|
01e9ae2dce | |
|
c67baccaea | |
|
879373209e | |
|
5f45434d89 | |
|
c4dcac8c00 | |
|
c8cd14f991 | |
|
55ac9e9329 | |
|
cc07d42de8 | |
|
f385dd4e83 | |
|
3a8c35521e | |
|
15487bfbf2 | |
|
01e726c6f7 | |
|
b26bdd861b | |
|
511f7ea283 | |
|
4ecce6af0a | |
|
0f1d13e961 | |
|
5d6c14f4d7 | |
|
8146aa5231 | |
|
f9c874df2c | |
|
2f19f093cb | |
|
6a17f87050 | |
|
afee23b99d | |
|
2f283d1a78 | |
|
a0a7ef6734 | |
|
8b916016c6 | |
|
9121929359 | |
|
e923ebcc72 | |
|
db2844efdb | |
|
a5adc7550c | |
|
0910425c5c | |
|
ff61a5931b | |
|
de6b4f1951 | |
|
d64c9e2a34 | |
|
d3e6462aed | |
|
a5ea756bc2 | |
|
b0420ee2b0 | |
|
ba3f6a79e6 | |
|
b266c44d34 | |
|
8cbb97af29 | |
|
0916afbe37 | |
|
9dd216269a | |
|
d1ba6e580f | |
|
13cd59c6bb | |
|
9565f97c4f | |
|
3aa8acf02a | |
|
0db556a97b | |
|
8642089bc7 | |
|
73f421f19e | |
|
2cc04da76c | |
|
822058b491 | |
|
e413acf85d | |
|
a5ea7ab104 | |
|
23f889af07 | |
|
a34c6e1ecf | |
|
a251053a84 | |
|
24266b53d5 | |
|
6b87402a6a | |
|
5927a60de2 | |
|
b69f3a08be | |
|
9472f13695 | |
|
d292395bb7 | |
|
9c50079bfc | |
|
02da97a8df | |
|
7121dc4e0d | |
|
2027c365fa | |
|
f2832d71de | |
|
376323652b | |
|
932457fcde | |
|
6696bc8841 | |
|
6fee57be87 | |
|
e7628d3e4b | |
|
3334349163 | |
|
b47d022f94 | |
|
431a68a0ad | |
|
8d4dc5d9e1 | |
|
9deb5bceea | |
|
2b3ca85af4 | |
|
f6494a077e | |
|
75ba4d4fd9 | |
|
764bd3915e | |
|
45982a8a7d | |
|
8bb0923c8b | |
|
83ab3eb31e | |
|
1322dad63d | |
|
2cd4058c1e | |
|
a1eda5350f | |
|
198db0df49 | |
|
be3f853b14 | |
|
6a9bbd93e8 | |
|
421b54cebe | |
|
eaf5f491eb | |
|
f7e0fbf728 | |
|
26643fb158 | |
|
34bf15c573 | |
|
0aa9975535 | |
|
24c62b4533 | |
|
94d471e20f | |
|
0c714d2c04 | |
|
cbcb2f2c71 | |
|
04a6a49565 | |
|
8d8944afb3 | |
|
1069960d98 | |
|
5e5f1fe88b | |
|
cc0c73a91a | |
|
a06696df01 | |
|
22ed652b9e | |
|
023a3b541a | |
|
c556a8b82d | |
|
fb5b347bb6 | |
|
fceb5dd5fd | |
|
d4d03c160b | |
|
aa1aaa98ff | |
|
51c1e8a2e1 | |
|
935b382ef2 | |
|
b2e54e1f7f | |
|
9baa32f6d2 | |
|
8b4dc73a2c | |
|
13b0becb6e | |
|
282ca08605 | |
|
559bf0db02 | |
|
c465286718 | |
|
fb18d5eace | |
|
3ef82599ce | |
|
f7b1d7bd37 | |
|
9269d17e85 | |
|
74eb296285 | |
|
658747d479 | |
|
cd82a208cc | |
|
16ca18c945 | |
|
4476df4608 | |
|
5ec1d7d311 | |
|
d4d4bed74b | |
|
eaaeb028e3 | |
|
71967591d3 | |
|
012b401414 | |
|
d86548f70e | |
|
d40b6fb06b | |
|
2e4610847d | |
|
ae96349cff | |
|
a8a74cdb48 | |
|
28905063b2 | |
|
661f7bacd6 | |
|
cfcbb8bce5 | |
|
1dc19a6eaa | |
|
6ff1ae96d5 | |
|
cbf7ef7ccf | |
|
c6f613c5e5 | |
|
55ab885ef9 | |
|
2ee3ba5251 | |
|
864e187a4e | |
|
221dda174a | |
|
10448b9d77 | |
|
6e588278d8 | |
|
1455d8ce02 | |
|
e38e9b1dd7 | |
|
8e3fad60c0 | |
|
227d3a8c88 | |
|
26bc5401f1 | |
|
a3acb3b190 | |
|
55d86d3153 | |
|
e6279ff261 | |
|
686bacd38a | |
|
d0176303da | |
|
2c6d3de784 | |
|
c61e4d30f6 | |
|
5b448e5bb3 | |
|
878845627a | |
|
f0dc7b4a41 | |
|
bddfd91de1 | |
|
d9cc35280b | |
|
58fd5a8326 | |
|
23e1a58f28 | |
|
e53990d880 | |
|
3a20752ed3 | |
|
2298d4582f | |
|
d5ea4fb46d | |
|
00c90b29e9 | |
|
f4adedb4f1 | |
|
9f815937a5 | |
|
01dd584028 | |
|
834f686475 | |
|
867ac12042 | |
|
3453e1007b | |
|
c59bc170a6 | |
|
b67a6d5d75 | |
|
6601e2e0ae | |
|
d45bf43f6e | |
|
5bb165757a | |
|
9b3ebff1c7 | |
|
ff6e1c178d | |
|
99df3c5df2 | |
|
a53f41a0b7 | |
|
ac998d33aa | |
|
31a5dd653c | |
|
3a2fca110c | |
|
c77a462cb6 | |
|
a0f4b74422 | |
|
39180c1b3a | |
|
6cba927ebc | |
|
5930985f0b | |
|
cd5654d91e | |
|
f01ed28d95 | |
|
37d8cc1b49 | |
|
4836b14e3e | |
|
bf4faa88a1 | |
|
1ee8b68fce | |
|
b7e71044b0 | |
|
c8fe115fec | |
|
c3b4856125 | |
|
b9c7baa136 | |
|
961c9a6973 | |
|
1b567f8fa0 | |
|
2ffcb6dfe8 | |
|
8c46ee45c2 | |
|
807567cede | |
|
4c7a730d08 | |
|
e024d37f77 | |
|
2070a142fd | |
|
c8bbb7c08b | |
|
f9dd927292 | |
|
a0895488b4 | |
|
f86dc7b60f | |
|
58edd511dc | |
|
2068fa4795 | |
|
9f439a686f | |
|
b4741c9e6b | |
|
fc886c2a8b | |
|
a58f31f7d8 | |
|
81718c0c4d | |
|
adc9d1630b | |
|
8599974437 | |
|
3b4af9c749 | |
|
7144bb3871 | |
|
3ef43531c3 | |
|
0658785a9a | |
|
0c59ca8e49 | |
|
a6adec0407 | |
|
d361ecd514 | |
|
273d086154 | |
|
a8870ec46a | |
|
ffe17751d9 | |
|
88ce527bf1 | |
|
f94c457263 | |
|
ea4a46d9c7 | |
|
0b17da1b76 | |
|
675820eff6 | |
|
3b0d0afddb | |
|
48a1f89399 | |
|
c19f49dcdd | |
|
650a5409b1 | |
|
155b8b3743 | |
|
1bbee11ec0 | |
|
8dc277ec2a | |
|
467cd8faf7 | |
|
6b84f24a08 | |
|
82010f1684 | |
|
bb2c3fef51 | |
|
f536d08317 | |
|
18737878a0 | |
|
ba8db3b73f | |
|
d499565ca3 | |
|
47cb1c2586 | |
|
092745a069 | |
|
9cd56bb33d | |
|
9d77c0bc93 | |
|
13290aa44b | |
|
1ec91add8e | |
|
db54277bc0 | |
|
d33909ad01 | |
|
2aa7177449 | |
|
4f31e7c553 | |
|
29f7bb1038 | |
|
1ba24b46db | |
|
14ac4f7de6 | |
|
390c530d39 | |
|
023d232ab5 | |
|
44c7b87726 | |
|
ae19e8b3c6 | |
|
c6a20d80d6 | |
|
8ff78a0a76 | |
|
9e254a0c33 | |
|
fe7b37fd15 | |
|
7d39211eeb | |
|
b74ee04557 | |
|
100e3b4d72 | |
|
ea9e099523 | |
|
0659298b5f | |
|
5618c1f53a | |
|
4c1631478c | |
|
247701125c | |
|
9cdcb63603 | |
|
d1168c3014 | |
|
95a673a8ed | |
|
83064c3813 | |
|
1f5823536f | |
|
6758c0a4e0 | |
|
5e6a83c001 | |
|
faf1d15283 | |
|
7054ad1d40 | |
|
979c96c5ac | |
|
5b5eca0606 | |
|
58edb1007a | |
|
00cea34dde | |
|
7bca8a4194 | |
|
21251a5167 | |
|
627289c58d | |
|
350dedd78d | |
|
a1ef002a24 | |
|
9cb0292361 | |
|
9383a3b4fb | |
|
befbbf3f73 | |
|
aee29345a5 | |
|
3340a16541 | |
|
5f75d3a0f1 | |
|
ed5ce3c459 | |
|
4e0967a26c | |
|
5c593697b9 | |
|
b0c23b03fd | |
|
f1b1163611 | |
|
26e6ceb24d | |
|
b969824474 | |
|
61e410aa1d | |
|
a6e57127f9 | |
|
dbd5b8f95f | |
|
78745cf7ce | |
|
57fb85d278 | |
|
fe99bdf3fd | |
|
1b394e3cac | |
|
b35952928c | |
|
ab0343582e | |
|
9f280c6089 | |
|
a2499f11e1 | |
|
f3fbfe41bb | |
|
d4a7a9374a | |
|
28db925645 | |
|
6c6e4ca950 | |
|
df7ab77225 | |
|
a0fc8a528c | |
|
3a95bdbbf7 | |
|
96d1ef7f68 | |
|
1cf9a46286 | |
|
ae507167b7 | |
|
9dd53855b5 | |
|
0f64477763 | |
|
1fbcd0ccd5 | |
|
402b2882da | |
|
e169031c19 | |
|
b1d18de23e | |
|
df403e35e6 | |
|
e8cee99b78 | |
|
836f40867c | |
|
eb1c621066 | |
|
b36c53119c | |
|
d178a77bc6 | |
|
e9555a6017 | |
|
7c91869c8b | |
|
23bff237a5 | |
|
e6c16356be | |
|
bee5a1e82d | |
|
590b4d9ca6 | |
|
545cb19dce | |
|
d21e11cc3d | |
|
45c4e08191 | |
|
1feb26bd6d | |
|
3cb21d7117 | |
|
824b60df57 | |
|
7357559c48 | |
|
44d3fa7634 | |
|
c86dbcb456 | |
|
45caf8ac2f | |
|
29401f4d67 | |
|
3f753a97e7 | |
|
fb2baa6180 | |
|
0b52be2568 | |
|
bbac57845a | |
|
0f8edae458 | |
|
f8bcc74133 | |
|
2a5942a9a9 | |
|
365597e5cf | |
|
e1b329db34 | |
|
0a97d0504b | |
|
1e5c56e19b | |
|
ce0bfe12d7 | |
|
9c6e41d2ae | |
|
6f8b04a3ed | |
|
096f0c57ba | |
|
84dd46b22c | |
|
5a5adbd165 | |
|
7eadb62af7 | |
|
f1fb2f9904 | |
|
d1a9e13a4b | |
|
819a5e2d6e | |
|
d8edd443c7 | |
|
f7a3bdf997 | |
|
a3fe097970 | |
|
5ed5554495 | |
|
77857e9d31 | |
|
c7b24adc5a | |
|
1f2746ac18 | |
|
ff14d81f51 | |
|
bdae839e50 | |
|
6d456f2352 | |
|
c3203b18e7 | |
|
c333428389 | |
|
a3cdb18535 | |
|
ae68f25c3c | |
|
ff95882e42 | |
|
773c917c20 | |
|
a1254b25b4 | |
|
efb0162f9c | |
|
58b8b2f7b0 | |
|
8843318b66 | |
|
bb3ce4f862 | |
|
6965c5ea78 | |
|
06d42ca876 | |
|
83fb97ad9b | |
|
ad2e502010 | |
|
b447df7217 | |
|
ed0e4fadf8 | |
|
59783c3d3a | |
|
3b9ccab48c | |
|
b78aa0f29b | |
|
6bc6797eba | |
|
e71018866e | |
|
579e675a22 | |
|
9a29e7e2fd | |
|
957bc34f00 | |
|
7e1482dd3a | |
|
94c0fa2aa7 | |
|
fcb34c9309 | |
|
dd88598072 | |
|
ae9c293e34 | |
|
f4ac7c1539 | |
|
57804f9f2d | |
|
9d32f6af3b | |
|
cce3162816 | |
|
2c607ef8d9 | |
|
0a7ac85729 | |
|
f1fc1e6734 | |
|
508b6f226d | |
|
833c4e1392 | |
|
92311accb0 | |
|
8d428bbd13 | |
|
7994f3c791 | |
|
e25896fa77 | |
|
6b90a083cb | |
|
3305bb4222 | |
|
3729834a86 | |
|
179f5a684f | |
|
04bbf9e9d7 | |
|
a738fe1579 | |
|
94c0cccb1e | |
|
d95350a8eb | |
|
a5a2feb8fd | |
|
3ab3f146d4 | |
|
b89293a9a3 | |
|
f3f4d03c16 | |
|
70b872b912 | |
|
755fca504d | |
|
cc7f16b635 | |
|
6c2fbea6d5 | |
|
0338e0ea45 | |
|
a6e3fd3480 | |
|
ee66704a92 | |
|
5fef000e02 | |
|
e335322d5f | |
|
89947f96cd | |
|
6ca732986d | |
|
8c7747999d | |
|
b5a1d05ff0 | |
|
b8c8610781 | |
|
802df02581 | |
|
b41d5f19dc | |
|
885bd631ff | |
|
f645e8982c | |
|
8182bf7b91 | |
|
a71da3a45d | |
|
1befb353a9 | |
|
0da3bcdf40 | |
|
2d8dd46d15 | |
|
21958cfdb4 | |
|
b5bdb975b8 | |
|
36473d979b | |
|
d1be809b76 | |
|
764eef13c3 | |
|
4c7a35f142 | |
|
46cdd9e62b | |
|
3fc7f34899 | |
|
0b9788d38b | |
|
38a180f92b | |
|
5b5dba868a | |
|
b7061de689 | |
|
1f76d572ce | |
|
387c3c7649 | |
|
72f141315e | |
|
55dda496f3 | |
|
4183ad3fa0 | |
|
a7fd073886 | |
|
17f067144c | |
|
f8efb9e6e9 | |
|
c1e2e434ac | |
|
2c67041030 | |
|
27f8a95e6f | |
|
621d038133 | |
|
e884bab1ea | |
|
4dcebc99bf | |
|
9f0d9bca29 | |
|
35e4f91154 | |
|
584e299a8d | |
|
656b736119 | |
|
8aaab2c25c | |
|
64fcf3c824 | |
|
bc53685765 | |
|
771fec7177 | |
|
bd905ded3a | |
|
ecfacd4100 | |
|
ad4a8beb0a | |
|
f16e956a53 | |
|
0a577e0524 | |
|
d0e2093a1c | |
|
0fdff03715 | |
|
3e8c090abd | |
|
df1defa168 | |
|
23fab7d224 | |
|
1966498d66 | |
|
57e53e43c6 | |
|
1f622317e7 | |
|
0a8312a3a8 | |
|
6855a0efec | |
|
e751233233 | |
|
449a790427 | |
|
eb008e8330 | |
|
9d90d041ee | |
|
b2b36289c7 | |
|
06eb72764d | |
|
3e4934fae1 | |
|
2f3c5245c0 | |
|
5af5c518b5 | |
|
21cc6b3ecd | |
|
252dd21492 | |
|
a8e1bdc684 | |
|
edceac850d | |
|
fce1068fbb | |
|
1f1fc4d6b9 | |
|
9fcea12580 | |
|
6c3a271ee2 | |
|
58d2c21e5b | |
|
ee00f7f5b5 | |
|
011344b761 | |
|
547e4847a7 | |
|
b52956d27d | |
|
9ba7fec42f | |
|
1485166fdd | |
|
10767615de | |
|
51fb940adb | |
|
65c2b24b78 | |
|
bf85a0f1c7 | |
|
57aa38c84c | |
|
074bb6c94c | |
|
ae137e8244 | |
|
d0e6c28ea2 | |
|
e9645cf86c | |
|
06e04e1fb5 | |
|
168fe4c5b1 | |
|
13490719c4 | |
|
7f281b8630 | |
|
f8428a5591 | |
|
5a869f0722 | |
|
70000e3eca | |
|
6c96089445 | |
|
29e8bb6344 | |
|
390dd05a06 | |
|
21f0c80bc9 | |
|
c1108945ff | |
|
803b8d508d | |
|
2246792404 | |
|
d75c48df0f | |
|
19e8b948ae | |
|
1091a762de | |
|
b48cc55f4b | |
|
e98cc7a92a | |
|
285ba4ef7b | |
|
3ad63ed354 | |
|
fd589ff798 | |
|
9cd8b2e8d6 | |
|
2aff1d3d06 | |
|
4b7b689a6c | |
|
278faeb533 | |
|
5b6ad1a7c0 | |
|
f904c8cfd2 | |
|
e50b8f0094 | |
|
3c87882805 | |
|
0ae2bbca34 | |
|
86e0043fc7 | |
|
3e59d7881a | |
|
eed06282d8 | |
|
34cfd57589 | |
|
b94df214ff | |
|
ccb558f4e9 | |
|
b26d1f7945 | |
|
94d2fbb5ca | |
|
36f44179b2 | |
|
628ed69bdb | |
|
3a8808452d | |
|
74f151800d | |
|
f922bcb750 | |
|
105f149503 | |
|
5b10a3e60f | |
|
8aba370063 | |
|
97140ae813 | |
|
67b29c5d24 | |
|
caa50a16ce | |
|
9084d918c0 | |
|
a46d3affde | |
|
9e06a48841 | |
|
b7f2a320c7 | |
|
ad8618a51b | |
|
622c875dc5 | |
|
b479ce83e0 | |
|
cceb906d65 | |
|
f076df8f12 | |
|
39f0873fb8 | |
|
3e16357878 | |
|
d23eb052f4 | |
|
2462b5f38e | |
|
37a71f7594 | |
|
c725dd446d | |
|
fe4a681894 | |
|
4fe6b7584d | |
|
fd68e997c5 | |
|
66db2f0bd7 | |
|
c379491df0 | |
|
a4e415f0ab | |
|
42c2401c24 | |
|
f139be4fcd | |
|
663ca7c25d | |
|
8c77f6fe40 | |
|
74dd49ffe0 | |
|
52e1cfc828 | |
|
9ebb7b85b2 | |
|
69a32231e2 | |
|
7f8c8b07c4 | |
|
618d358256 | |
|
d573389871 | |
|
3dbace5336 | |
|
4f2e4e1304 | |
|
e00d836b50 | |
|
f2a8f724ce | |
|
43fc2e2312 | |
|
793084eb74 | |
|
f4b1e18582 | |
|
63fb45b22d | |
|
916842ba93 | |
|
bf21c88f00 | |
|
9ab6ac9718 | |
|
336a5ccafc | |
|
42f113ccf6 | |
|
1a90be0561 | |
|
0fba2ade32 | |
|
e0a9a5ca72 | |
|
a53ac3d6cc | |
|
cf6cf11179 | |
|
7b170f05bf | |
|
268ddb027b | |
|
5e0afd215f | |
|
e5940ff785 | |
|
3c5b8d4fbf | |
|
072deeea5e | |
|
b8856194c4 | |
|
94c9e1e84a | |
|
4618ba87fa | |
|
12715adbdb | |
|
710532bc4e | |
|
dd90af9b6c | |
|
6f5aed2cbe | |
|
f1f2b94747 | |
|
2bfc6606f0 | |
|
4cc895b69c | |
|
6f31eeeeec | |
|
9528f4572b | |
|
5027b9a174 | |
|
b61badc723 | |
|
be946a4f8b | |
|
7786c1ed64 | |
|
89cf61a750 | |
|
967e3334ae | |
|
531371543e | |
|
de7906bbf3 | |
|
0b767ff812 | |
|
37a87fa8e1 | |
|
a0b19f8e79 | |
|
a86b9067e2 | |
|
3aa8b568c4 | |
|
7630e6dfe4 | |
|
800eac4e24 | |
|
062c306cf4 | |
|
1a2046be74 | |
|
3807e74fe4 | |
|
1e3aa0c8c0 | |
|
aaa08b9d2b | |
|
20ef8a5a12 | |
|
66555806f2 | |
|
2851291a27 | |
|
458e48d4c6 | |
|
d63941adca | |
|
d4f559f2c7 | |
|
9b037e77ff | |
|
f2ac15829d | |
|
742fa231f1 | |
|
2c86fb17f1 | |
|
3ee8ff78ca | |
|
88c2640ddc | |
|
9afa5df0c7 | |
|
950bd5f3a7 | |
|
d92a09e228 | |
|
dae33e4df8 | |
|
933e092da0 | |
|
bbd2c86b61 | |
|
e09bd48e1b | |
|
5893c0b9e9 | |
|
6b69884c2e | |
|
7619a5b4f5 | |
|
96e942af11 | |
|
3a060c9c6a | |
|
9ae43244d9 | |
|
9d1c375d59 | |
|
8b3076640d | |
|
632f7bbdeb | |
|
9121e79533 | |
|
34d08e4bfe | |
|
db00be75ad | |
|
4fc3e1fabb | |
|
a5f41871ae | |
|
494482b6a8 | |
|
034148841f | |
|
43e02ca00e | |
|
ebcb356230 | |
|
bc9b19e2df | |
|
c0d8bf3a48 | |
|
cc464c631e | |
|
35201cb2d3 | |
|
b590c91892 | |
|
0e35b2b2d5 | |
|
85b3c3033a | |
|
870081677e | |
|
51a85343d9 | |
|
7f5d9c7180 | |
|
aab98e3c45 | |
|
8a0b65998e | |
|
b07286d43d | |
|
00b15c1129 | |
|
e3fa756b14 | |
|
c0be47a2e4 | |
|
cac9a9139f | |
|
f0f6a7e9a3 | |
|
351dc012eb | |
|
994a22a195 | |
|
e948253bea | |
|
09804e06c7 | |
|
78e70f2b69 | |
|
7325be2366 | |
|
386f2e3126 | |
|
640a7d4b14 | |
|
06b61a52f6 | |
|
79d6f133a1 | |
|
51b3283ff7 | |
|
fc247ae413 | |
|
efcf3be585 | |
|
5b9f9d38a2 | |
|
96e7bf78c5 | |
|
96e9d1a00a | |
|
617af7b7cb | |
|
a44ea9384a | |
|
dcd681b656 | |
|
02a1554b21 | |
|
72ce3615d0 | |
|
7962dbc26a | |
|
1c86c874e0 | |
|
4ecc8c213e | |
|
3477b24c93 | |
|
c2e4380f18 | |
|
71e469542a | |
|
f20660839a | |
|
b57b60dd84 | |
|
8af09d46ed | |
|
00b7883aed | |
|
0f48b6fa4d | |
|
94c8f538ea | |
|
fec9ef25bf | |
|
84f22cfeb8 | |
|
b67489aae8 | |
|
565ec15589 | |
|
3404bc6d0b | |
|
218f45c289 | |
|
7b8093c048 | |
|
da99d82504 | |
|
8d2ad235fb | |
|
4d602aadfd | |
|
e18d129b32 | |
|
f6051ae15c | |
|
257ec7926e | |
|
fdf6fd2bba | |
|
f903432e74 | |
|
04d30186c2 | |
|
f7fb18cf0a | |
|
02129591cf | |
|
bf4d11545d | |
|
70847176ca | |
|
97ce44242c | |
|
c75e4cbf95 | |
|
60e9accd99 | |
|
652e5c1838 | |
|
a149c37fb2 | |
|
1bf754e81a | |
|
72d19b2347 | |
|
017d7a866d | |
|
00cd6feb12 | |
|
8f925401d5 | |
|
8363f813de | |
|
68d1d0dbb0 | |
|
0e7abe5fa4 | |
|
9c5620f340 | |
|
41e1d365f3 | |
|
b6836fc59e | |
|
81591b4f67 | |
|
83a0ec7eb8 | |
|
8d60754682 | |
|
ba57c2fcd9 | |
|
8490f24438 | |
|
db3ff0416c | |
|
d7044cfdcc | |
|
f4792d7921 | |
|
960129f86c | |
|
6e261b7793 | |
|
4b44b9a979 | |
|
8f1ddb08b3 | |
|
330b1c1ec2 | |
|
6205feaca4 | |
|
0e691436e9 | |
|
81e6870f71 |
|
@ -1,4 +1,4 @@
|
||||||
module.exports = {
|
export default {
|
||||||
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
|
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
|
||||||
// This option interrupts the configuration hierarchy at this file
|
// This option interrupts the configuration hierarchy at this file
|
||||||
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
|
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
|
||||||
|
@ -58,7 +58,7 @@ module.exports = {
|
||||||
rules: {
|
rules: {
|
||||||
'prefer-promise-reject-errors': 'off',
|
'prefer-promise-reject-errors': 'off',
|
||||||
'no-unused-vars': 'warn',
|
'no-unused-vars': 'warn',
|
||||||
"vue/no-multiple-template-root": "off" ,
|
'vue/no-multiple-template-root': 'off',
|
||||||
// allow debugger during development only
|
// allow debugger during development only
|
||||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||||
},
|
},
|
|
@ -29,5 +29,9 @@ yarn-error.log*
|
||||||
*.sln
|
*.sln
|
||||||
|
|
||||||
# Cypress directories and files
|
# Cypress directories and files
|
||||||
/tests/cypress/videos
|
/test/cypress/videos
|
||||||
/tests/cypress/screenshots
|
/test/cypress/screenshots
|
||||||
|
|
||||||
|
# VitePress directories and files
|
||||||
|
/docs/.vitepress/cache
|
||||||
|
/docs/.vuepress
|
||||||
|
|
|
@ -1,23 +1,24 @@
|
||||||
const fs = require('fs');
|
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
||||||
const path = require('path');
|
import { join, resolve } from 'path';
|
||||||
|
|
||||||
function getCurrentBranchName(p = process.cwd()) {
|
function getCurrentBranchName(p = process.cwd()) {
|
||||||
if (!fs.existsSync(p)) return false;
|
if (!existsSync(p)) return false;
|
||||||
|
|
||||||
const gitHeadPath = path.join(p, '.git', 'HEAD');
|
const gitHeadPath = join(p, '.git', 'HEAD');
|
||||||
|
|
||||||
if (!fs.existsSync(gitHeadPath))
|
if (!existsSync(gitHeadPath)) {
|
||||||
return getCurrentBranchName(path.resolve(p, '..'));
|
return getCurrentBranchName(resolve(p, '..'));
|
||||||
|
}
|
||||||
|
|
||||||
const headContent = fs.readFileSync(gitHeadPath, 'utf-8');
|
const headContent = readFileSync(gitHeadPath, 'utf-8');
|
||||||
return headContent.trim().split('/')[2];
|
return headContent.trim().split('/')[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
const branchName = getCurrentBranchName();
|
const branchName = getCurrentBranchName();
|
||||||
|
|
||||||
if (branchName) {
|
if (branchName) {
|
||||||
const msgPath = `.git/COMMIT_EDITMSG`;
|
const msgPath = '.git/COMMIT_EDITMSG';
|
||||||
const msg = fs.readFileSync(msgPath, 'utf-8');
|
const msg = readFileSync(msgPath, 'utf-8');
|
||||||
const reference = branchName.match(/^\d+/);
|
const reference = branchName.match(/^\d+/);
|
||||||
|
|
||||||
const referenceTag = `refs #${reference}`;
|
const referenceTag = `refs #${reference}`;
|
||||||
|
@ -26,8 +27,7 @@ if (branchName) {
|
||||||
|
|
||||||
if (splitedMsg.length > 1) {
|
if (splitedMsg.length > 1) {
|
||||||
const finalMsg = splitedMsg[0] + ': ' + referenceTag + splitedMsg.slice(1).join(':');
|
const finalMsg = splitedMsg[0] + ': ' + referenceTag + splitedMsg.slice(1).join(':');
|
||||||
fs.writeFileSync(msgPath, finalMsg);
|
writeFileSync(msgPath, finalMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module.exports = {
|
export default {
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
printWidth: 90,
|
printWidth: 90,
|
||||||
tabWidth: 4,
|
tabWidth: 4,
|
||||||
|
|
154
CHANGELOG.md
154
CHANGELOG.md
|
@ -1,3 +1,157 @@
|
||||||
|
# Version 25.04 - 2025-01-28
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- chore: add task comment by:jorgep
|
||||||
|
- chore: refs #8198 rollback by:jorgep
|
||||||
|
- chore: refs #8322 unnecessary prop by:alexm
|
||||||
|
- feat: refs #7055 added new test case by:provira
|
||||||
|
- feat: refs #7055 created FilterItemForm test by:provira
|
||||||
|
- feat: refs #7077 created test for VnInputTime by:provira
|
||||||
|
- feat: refs #7078 created test for VnJsonValue by:provira
|
||||||
|
- feat: refs #7087 added more test cases by:provira
|
||||||
|
- feat: refs #7087 added new test by:provira
|
||||||
|
- feat: refs #7087 created CardSummary test by:provira
|
||||||
|
- feat: refs #7088 created test for FetchedTags by:provira
|
||||||
|
- feat: refs #7202 added new field by:Jon
|
||||||
|
- feat: refs #7882 Added coords to create a address by:guillermo
|
||||||
|
- feat: refs #7957 add tooltip and i18n support for search link in VnSearchbar component by:jorgep
|
||||||
|
- feat: refs #7957 enhance search functionality and improve data filtering logic by:jorgep
|
||||||
|
- feat: refs #7957 open in new tab by:jorgep
|
||||||
|
- feat: refs #7957 simplify fn to by:jorgep
|
||||||
|
- feat: refs #7957 update VnSearchbar component with improved search URL handling and styling enhancements by:jorgep
|
||||||
|
- feat: refs #8117 filters and values added as needed by:jtubau
|
||||||
|
- feat: refs #8197 useHasContent and use in VnSection and RightMenu by:alexm
|
||||||
|
- feat: refs #8219 added invoice out e2e tests by:Jon
|
||||||
|
- feat: refs #8219 global invoicing e2e by:Jon
|
||||||
|
- feat: refs #8220 added barcodes e2e test by:Jon
|
||||||
|
- feat: refs #8220 created items e2e by:Jon
|
||||||
|
- feat: refs #8220 modified create item form and added respective e2e by:Jon
|
||||||
|
- feat: refs #8225 added account and invoiceOut modules by:Jon
|
||||||
|
- feat: refs #8225 added entry module and fixed translations by:Jon
|
||||||
|
- feat: refs #8225 added invoiceIn and travel module by:Jon
|
||||||
|
- feat: refs #8225 added moreOptions and use it in customer and ticket summary by:Jon
|
||||||
|
- feat: refs #8225 added route and shelving module by:Jon
|
||||||
|
- feat: refs #8225 added worker and zone modules by:Jon
|
||||||
|
- feat: refs #8225 use it in claim, item and order modules by:Jon
|
||||||
|
- feat: refs #8258 added button to pass to uppercase by:provira
|
||||||
|
- feat: refs #8258 added uppercase option to VnInput by:provira
|
||||||
|
- feat: refs #8258 added uppercase validation on supplier create by:provira
|
||||||
|
- feat: refs #8298 add price optimum input and update translations for bonus and price optimum by:jgallego
|
||||||
|
- feat: refs #8316 add entryFilter prop to VnTable component in EntryList by:jtubau
|
||||||
|
- feat: refs #8322 added department changes by:provira
|
||||||
|
- feat: refs #8372 workerPBX by:robert
|
||||||
|
- feat: refs #8381 add initial and final temperature fields to entry forms and summaries by:jgallego
|
||||||
|
- feat: refs #8381 add initial and final temperature labels in English and Spanish locales by:jgallego
|
||||||
|
- feat: refs #8381 add toCelsius filter and update temperature fields in entry forms and summaries by:jgallego
|
||||||
|
- feat: skip tests by:jorgep
|
||||||
|
- style: refs #7957 update VnSearchbar padding for improved layout by:jorgep
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- perf: refs #8219 #8219 minor change by:Javier Segarra
|
||||||
|
- perf: refs #8220 on-fetch and added missing translations by:Jon
|
||||||
|
- perf: refs #8220 on-fetch by:Jon
|
||||||
|
- perf: refs #8220 translations by:Jon
|
||||||
|
- perf: refs #8220 use searchbar selector in e2e tests by:Jon
|
||||||
|
- perf: remove warning default value by:Javier Segarra
|
||||||
|
- refactor: redirect using params by:Jon
|
||||||
|
- refactor: refs #7077 removed some comments by:provira
|
||||||
|
- refactor: refs #7087 removed unused imports by:provira
|
||||||
|
- refactor: refs #7100 added const mockData by:jtubau
|
||||||
|
- refactor: refs #7100 delete unnecesary set prop by:jtubau
|
||||||
|
- refactor: refs #7100 refactorized with methods by:jtubau
|
||||||
|
- refactor: refs #7957 remove blank by:jorgep
|
||||||
|
- refactor: refs #8198 simplify data fetching and filtering logic by:jorgep
|
||||||
|
- refactor: refs #8198 simplify state management and data fetching in ItemDiary component by:jorgep
|
||||||
|
- refactor: refs #8219 modified e2e tests and fixed some translations by:Jon
|
||||||
|
- refactor: refs #8219 modified list test, created cypress download folder and added to gitignore by:Jon
|
||||||
|
- refactor: refs #8219 requested changes by:Jon
|
||||||
|
- refactor: refs #8219 use checkNotification command by:Jon
|
||||||
|
- refactor: refs #8220 added data-cy for e2e tests by:Jon
|
||||||
|
- refactor: refs #8220 requested changes by:Jon
|
||||||
|
- refactor: refs #8220 skip failling test and modifed tag test by:Jon
|
||||||
|
- refactor: refs #8225 requested changes by:Jon
|
||||||
|
- refactor: refs #8247 use new acl for sysadmin by:Jon
|
||||||
|
- refactor: refs #8316 added claimFilter by:jtubau
|
||||||
|
- refactor: refs #8316 added entryFilter by:jtubau
|
||||||
|
- refactor: refs #8316 add new localization keys and update existing ones for entry components by:jtubau
|
||||||
|
- refactor: refs #8316 moved localizations to local locale by:jtubau
|
||||||
|
- refactor: refs #8316 move order localization by:jtubau
|
||||||
|
- refactor: refs #8316 remove unused OrderSearchbar component by:jtubau
|
||||||
|
- refactor: refs #8316 update EntryCard to use user-filter prop and remove exprBuilder from EntryList by:jtubau
|
||||||
|
- refactor: refs #8316 used VnSection and VnCardBeta by:jtubau
|
||||||
|
- refactor: refs #8322 changed translations by:provira
|
||||||
|
- refactor: refs #8322 changed Worker component to use VnSection/VnCardBeta by:provira
|
||||||
|
- refactor: refs #8322 set department inside worker by:alexm
|
||||||
|
- refactor: skip intermitent failing test by:Jon
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- feat: refs #8225 added entry module and fixed translations by:Jon
|
||||||
|
- fix: added missing translations in InvoiceIn by:provira
|
||||||
|
- fix: changed invoiceIn for InvoiceIn by:provira
|
||||||
|
- fix: changed translations to only use "invoicein" by:provira
|
||||||
|
- fix: department descriptor link by:Jon
|
||||||
|
- fix: e2e tests by:Jon
|
||||||
|
- fix: entry summary view and build warnings by:Jon
|
||||||
|
- fix: fixed InvoiceIn filter translations by:provira
|
||||||
|
- fix: modified setData in customerDescriptor to show the icons by:Jon
|
||||||
|
- fix: redirect to TicketSale from OrderLines (origin/Fix-RedirectToTicketSale) by:Jon
|
||||||
|
- fix: redirect when confirming lines by:Jon
|
||||||
|
- fix: refs #7055 #7055 #7055 fixed some tests by:provira
|
||||||
|
- fix: refs #7077 removed unused imports by:provira
|
||||||
|
- fix: refs #7078 added missing case with array by:provira
|
||||||
|
- fix: refs #7087 fixed some tests by:provira
|
||||||
|
- fix: refs #7088 changed "vm.vm" to "vm" by:provira
|
||||||
|
- fix: refs #7088 changed wrapper to vm by:provira
|
||||||
|
- fix: refs #7699 add icons and hint by:carlossa
|
||||||
|
- fix: refs #7699 add pwd vnInput by:carlossa
|
||||||
|
- fix: refs #7699 fix component by:carlossa
|
||||||
|
- fix: refs #7699 fix password visibility by:carlossa
|
||||||
|
- fix: refs #7699 fix tfront clean code by:carlossa
|
||||||
|
- fix: refs #7699 fix vnChangePassword, clean VnInput by:carlossa
|
||||||
|
- fix: refs #7699 fix vnInputPassword by:carlossa
|
||||||
|
- fix: refs #7957 add missing closing brace by:jorgep
|
||||||
|
- fix: refs #7957 css by:jorgep
|
||||||
|
- fix: refs #7957 rollback by:jorgep
|
||||||
|
- fix: refs #7957 update data-cy by:jorgep
|
||||||
|
- fix: refs #7957 update visibility handling for clear icon in VnInput component by:jorgep
|
||||||
|
- fix: refs #7957 vn-searchbar test by:jorgep
|
||||||
|
- fix: refs #8117 update salesPersonFk filter options and URL for improved data retrieval by:jtubau
|
||||||
|
- fix: refs #8197 not use yet by:alexm
|
||||||
|
- fix: refs #8198 update query param by:jorgep
|
||||||
|
- fix: refs #8219 fixed e2e tests by:Jon
|
||||||
|
- fix: refs #8219 fixed summary and global tests by:Jon
|
||||||
|
- fix: refs #8219 forgotten dataCy by:Jon
|
||||||
|
- fix: refs #8219 global e2e by:Jon
|
||||||
|
- fix: refs #8219 requested changes by:Jon
|
||||||
|
- fix: refs #8220 itemTag test by:Javier Segarra
|
||||||
|
- fix: refs #8225 invoice in translations by:Jon
|
||||||
|
- fix: refs #8243 fixed SkeletonSummary by:provira
|
||||||
|
- fix: refs #8247 conflicts by:Jon
|
||||||
|
- fix: refs #8247 fixed acls and added lost options by:Jon
|
||||||
|
- fix: refs #8316 ref="claimFilterRef" by:alexm
|
||||||
|
- fix: refs #8316 userFilter by:alexm
|
||||||
|
- fix: refs #8316 use rightMenu by:alexm
|
||||||
|
- fix: refs #8316 use section-searchbar by:alexm
|
||||||
|
- fix: refs #8317 disable action buttons when no rows are selected in ItemFixedPrice by:jtubau
|
||||||
|
- fix: refs #8322 unnecessary section by:alexm
|
||||||
|
- fix: refs #8338 fixed VnTable translations by:provira
|
||||||
|
- fix: refs #8338 removed chipLocale property/added more translations by:provira
|
||||||
|
- fix: refs #8448 e2e by:Jon
|
||||||
|
- fix: refs #8448 not use croppie by:alexm
|
||||||
|
- fix: remove departmentCode by:Javier Segarra
|
||||||
|
- fix: removed unused searchbar by:PAU ROVIRA ROSALENY
|
||||||
|
- fix: skip failling e2e by:Jon
|
||||||
|
- fix: sort by name in description by:Jon
|
||||||
|
- fix: translations by:Jon
|
||||||
|
- fix: use entryFilter by:alexm
|
||||||
|
- fix(VnCardBeta): add userFilter by:alexm
|
||||||
|
- refactor: refs #8219 modified e2e tests and fixed some translations by:Jon
|
||||||
|
- revert: revert header by:alexm
|
||||||
|
- test: fix expedition e2e by:alexm
|
||||||
|
|
||||||
# Version 25.00 - 2025-01-14
|
# Version 25.00 - 2025-01-14
|
||||||
|
|
||||||
### Added 🆕
|
### Added 🆕
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
module.exports = { extends: ['@commitlint/config-conventional'] };
|
export default { extends: ['@commitlint/config-conventional'] };
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
const { defineConfig } = require('cypress');
|
import { defineConfig } from 'cypress';
|
||||||
// https://docs.cypress.io/app/tooling/reporters
|
// https://docs.cypress.io/app/tooling/reporters
|
||||||
// https://docs.cypress.io/app/references/configuration
|
// https://docs.cypress.io/app/references/configuration
|
||||||
// https://www.npmjs.com/package/cypress-mochawesome-reporter
|
// https://www.npmjs.com/package/cypress-mochawesome-reporter
|
||||||
|
|
||||||
module.exports = defineConfig({
|
export default defineConfig({
|
||||||
e2e: {
|
e2e: {
|
||||||
baseUrl: 'http://localhost:9000/',
|
baseUrl: 'http://localhost:9000/',
|
||||||
experimentalStudio: true,
|
experimentalStudio: true,
|
||||||
|
@ -30,9 +30,13 @@ module.exports = defineConfig({
|
||||||
testFiles: '**/*.spec.js',
|
testFiles: '**/*.spec.js',
|
||||||
supportFile: 'test/cypress/support/unit.js',
|
supportFile: 'test/cypress/support/unit.js',
|
||||||
},
|
},
|
||||||
setupNodeEvents(on, config) {
|
setupNodeEvents: async (on, config) => {
|
||||||
require('cypress-mochawesome-reporter/plugin')(on);
|
const plugin = await import('cypress-mochawesome-reporter/plugin');
|
||||||
// implement node event listeners here
|
plugin.default(on);
|
||||||
|
|
||||||
|
return config;
|
||||||
},
|
},
|
||||||
|
viewportWidth: 1280,
|
||||||
|
viewportHeight: 720,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
import { defineConfig } from 'vitepress';
|
||||||
|
|
||||||
|
// https://vitepress.dev/reference/site-config
|
||||||
|
export default defineConfig({
|
||||||
|
title: 'Lilium',
|
||||||
|
description: 'Lilium docs',
|
||||||
|
themeConfig: {
|
||||||
|
// https://vitepress.dev/reference/default-theme-config
|
||||||
|
nav: [
|
||||||
|
{ text: 'Home', link: '/' },
|
||||||
|
{ text: 'Components', link: '/components/vnInput' },
|
||||||
|
{ text: 'Composables', link: '/composables/useArrayData' },
|
||||||
|
],
|
||||||
|
|
||||||
|
sidebar: [
|
||||||
|
{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: 'Components',
|
||||||
|
collapsible: true,
|
||||||
|
collapsed: true,
|
||||||
|
items: [{ text: 'VnInput', link: '/components/vnInput' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Composables',
|
||||||
|
collapsible: true,
|
||||||
|
collapsed: true,
|
||||||
|
items: [
|
||||||
|
{ text: 'useArrayData', link: '/composables/useArrayData' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
socialLinks: [{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }],
|
||||||
|
},
|
||||||
|
});
|
|
@ -0,0 +1,136 @@
|
||||||
|
# VnInput
|
||||||
|
|
||||||
|
`VnInput` is a custom input component that provides various useful features such as validation, input clearing, and more.
|
||||||
|
|
||||||
|
## Props
|
||||||
|
|
||||||
|
### `modelValue`
|
||||||
|
|
||||||
|
- **Type:** `String | Number`
|
||||||
|
- **Default:** `null`
|
||||||
|
- **Description:** The value of the model bound to the component.
|
||||||
|
|
||||||
|
### `isOutlined`
|
||||||
|
|
||||||
|
- **Type:** `Boolean`
|
||||||
|
- **Default:** `false`
|
||||||
|
- **Description:** If `true`, the component is rendered with an outlined style.
|
||||||
|
|
||||||
|
### `info`
|
||||||
|
|
||||||
|
- **Type:** `String`
|
||||||
|
- **Default:** `''`
|
||||||
|
- **Description:** Additional information displayed alongside the component.
|
||||||
|
|
||||||
|
### `clearable`
|
||||||
|
|
||||||
|
- **Type:** `Boolean`
|
||||||
|
- **Default:** `true`
|
||||||
|
- **Description:** If `true`, the component shows a button to clear the input.
|
||||||
|
|
||||||
|
### `emptyToNull`
|
||||||
|
|
||||||
|
- **Type:** `Boolean`
|
||||||
|
- **Default:** `true`
|
||||||
|
- **Description:** If `true`, converts empty inputs to `null`.
|
||||||
|
|
||||||
|
### `insertable`
|
||||||
|
|
||||||
|
- **Type:** `Boolean`
|
||||||
|
- **Default:** `false`
|
||||||
|
- **Description:** If `true`, allows the insertion of new values.
|
||||||
|
|
||||||
|
### `maxlength`
|
||||||
|
|
||||||
|
- **Type:** `Number`
|
||||||
|
- **Default:** `null`
|
||||||
|
- **Description:** The maximum number of characters allowed in the input.
|
||||||
|
|
||||||
|
### `uppercase`
|
||||||
|
|
||||||
|
- **Type:** `Boolean`
|
||||||
|
- **Default:** `false`
|
||||||
|
- **Description:** If `true`, converts the input text to uppercase.
|
||||||
|
|
||||||
|
## Emits
|
||||||
|
|
||||||
|
### `update:modelValue`
|
||||||
|
|
||||||
|
- **Description:** Emits the updated model value.
|
||||||
|
- **Behavior:** This event is emitted whenever the input value changes. It is used to update the model value bound to the component.
|
||||||
|
|
||||||
|
### `update:options`
|
||||||
|
|
||||||
|
- **Description:** Emits the updated options.
|
||||||
|
- **Behavior:** This event is emitted when the component's options change. It is useful for components with dynamic options.
|
||||||
|
|
||||||
|
### `keyup.enter`
|
||||||
|
|
||||||
|
- **Description:** Emits an event when the Enter key is pressed.
|
||||||
|
- **Behavior:** This event is emitted whenever the Enter key is pressed while the input is focused. It can be used to handle specific actions when the input is confirmed.
|
||||||
|
|
||||||
|
### `remove`
|
||||||
|
|
||||||
|
- **Description:** Emits an event to remove the current value.
|
||||||
|
- **Behavior:** This event is emitted when the clear button (close icon) is clicked. It is used to handle the removal of the current input value.
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### `focus`
|
||||||
|
|
||||||
|
- **Description:** Focuses the input.
|
||||||
|
- **Behavior:** This function is exposed so it can be called from outside the component. It uses `vnInputRef.value.focus()` to focus the input.
|
||||||
|
|
||||||
|
### `handleKeydown`
|
||||||
|
|
||||||
|
- **Description:** Handles the `keydown` event of the input.
|
||||||
|
- **Behavior:** This function is called whenever a key is pressed while the input is focused. If the pressed key is `Backspace`, it does nothing. If `insertable` is `true` and the pressed key is a number, it calls `handleInsertMode`.
|
||||||
|
|
||||||
|
### `handleInsertMode`
|
||||||
|
|
||||||
|
- **Description:** Handles the insertion mode of values.
|
||||||
|
- **Behavior:** This function is called when `insertable` is `true` and a numeric key is pressed. It inserts the value at the cursor position and updates the input value. Then, it moves the cursor to the correct position.
|
||||||
|
|
||||||
|
### `handleUppercase`
|
||||||
|
|
||||||
|
- **Description:** Converts the input value to uppercase.
|
||||||
|
- **Behavior:** This function is called when the uppercase icon is clicked. It converts the current input value to uppercase.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<VnInput
|
||||||
|
v-model="inputValue"
|
||||||
|
:isOutlined="true"
|
||||||
|
info="Additional information"
|
||||||
|
:clearable="true"
|
||||||
|
:emptyToNull="true"
|
||||||
|
:insertable="false"
|
||||||
|
:maxlength="50"
|
||||||
|
:uppercase="true"
|
||||||
|
@update:modelValue="handleUpdate"
|
||||||
|
@keyup.enter="handleEnter"
|
||||||
|
@remove="handleRemove"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
|
const inputValue = ref('');
|
||||||
|
|
||||||
|
const handleUpdate = (value) => {
|
||||||
|
console.log('Updated value:', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEnter = () => {
|
||||||
|
console.log('Enter pressed');
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleRemove = () => {
|
||||||
|
console.log('Value removed');
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
```
|
|
@ -0,0 +1,215 @@
|
||||||
|
# useArrayData
|
||||||
|
|
||||||
|
`useArrayData` is a composable function that provides a set of utilities for managing array data in a Vue component. It leverages Pinia for state management and provides various methods for fetching, filtering, and manipulating data.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
|
const {
|
||||||
|
fetch,
|
||||||
|
applyFilter,
|
||||||
|
addFilter,
|
||||||
|
getCurrentFilter,
|
||||||
|
setCurrentFilter,
|
||||||
|
addFilterWhere,
|
||||||
|
addOrder,
|
||||||
|
deleteOrder,
|
||||||
|
refresh,
|
||||||
|
destroy,
|
||||||
|
loadMore,
|
||||||
|
store,
|
||||||
|
totalRows,
|
||||||
|
updateStateParams,
|
||||||
|
isLoading,
|
||||||
|
deleteOption,
|
||||||
|
reset,
|
||||||
|
resetPagination,
|
||||||
|
} = useArrayData('myKey', userOptions);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
### `key`
|
||||||
|
|
||||||
|
- **Type:** `String`
|
||||||
|
- **Description:** A unique key to identify the data store.
|
||||||
|
|
||||||
|
### `userOptions`
|
||||||
|
|
||||||
|
- **Type:** `Object`
|
||||||
|
- **Description:** An object containing user-defined options for configuring the data store.
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### `fetch`
|
||||||
|
|
||||||
|
Fetches data from the server.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- **`options`** : An object with the following properties:
|
||||||
|
- `append` (Boolean): Whether to append the fetched data to the existing data.
|
||||||
|
- `updateRouter` (Boolean): Whether to update the router with the current filter.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
- **`Promise`** : A promise that resolves with the fetched data.
|
||||||
|
|
||||||
|
### `applyFilter`
|
||||||
|
|
||||||
|
Applies a filter to the data.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- **`filter`** : An object containing the filter criteria.
|
||||||
|
- **`params`** : Additional parameters for the filter.
|
||||||
|
- **`fetchOptions`** : Options for the fetch method.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
- **`Promise`** : A promise that resolves with the filtered data.
|
||||||
|
|
||||||
|
### `addFilter`
|
||||||
|
|
||||||
|
Adds a filter to the existing filters.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- **`filter`** : An object containing the filter criteria.
|
||||||
|
- **`params`** : Additional parameters for the filter.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
- **`Promise`** : A promise that resolves with the updated filter and parameters.
|
||||||
|
|
||||||
|
### `getCurrentFilter`
|
||||||
|
|
||||||
|
Gets the current filter applied to the data.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
- **`Object`** : The current filter and parameters.
|
||||||
|
|
||||||
|
### `setCurrentFilter`
|
||||||
|
|
||||||
|
Sets the current filter for the data.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
- **`Object`** : The current filter and parameters.
|
||||||
|
|
||||||
|
### `addFilterWhere`
|
||||||
|
|
||||||
|
Adds a `where` clause to the existing filters.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- **`where`** : An object containing the `where` clause.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
- **`Promise`** : A promise that resolves when the filter is applied.
|
||||||
|
|
||||||
|
### `addOrder`
|
||||||
|
|
||||||
|
Adds an order to the existing orders.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- **`field`** : The field to order by.
|
||||||
|
- **`direction`** : The direction of the order (`ASC` or `DESC`).
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
- **`Promise`** : A promise that resolves with the updated order.
|
||||||
|
|
||||||
|
### `deleteOrder`
|
||||||
|
|
||||||
|
Deletes an order from the existing orders.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- **`field`** : The field to delete the order for.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
- **`Promise`** : A promise that resolves when the order is deleted.
|
||||||
|
|
||||||
|
### `refresh`
|
||||||
|
|
||||||
|
Refreshes the data by re-fetching it from the server.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
- **`Promise`** : A promise that resolves with the refreshed data.
|
||||||
|
|
||||||
|
### `destroy`
|
||||||
|
|
||||||
|
Destroys the data store for the given key.
|
||||||
|
|
||||||
|
### `loadMore`
|
||||||
|
|
||||||
|
Loads more data by incrementing the pagination.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
- **`Promise`** : A promise that resolves with the additional data.
|
||||||
|
|
||||||
|
### `updateStateParams`
|
||||||
|
|
||||||
|
Updates the state parameters with the given data.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- **`data`** : The data to update the state parameters with.
|
||||||
|
|
||||||
|
### `deleteOption`
|
||||||
|
|
||||||
|
Deletes an option from the store.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- **`option`** : The option to delete.
|
||||||
|
|
||||||
|
### `reset`
|
||||||
|
|
||||||
|
Resets the store to its default state.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- **`opts`** : An array of options to reset.
|
||||||
|
|
||||||
|
### `resetPagination`
|
||||||
|
|
||||||
|
Resets the pagination for the store.
|
||||||
|
|
||||||
|
## Computed Properties
|
||||||
|
|
||||||
|
### `totalRows`
|
||||||
|
|
||||||
|
- **Description:** The total number of rows in the data.
|
||||||
|
- **Type:** `Number`
|
||||||
|
|
||||||
|
### `isLoading`
|
||||||
|
|
||||||
|
- **Description:** Whether the data is currently being loaded.
|
||||||
|
- **Type:** `Boolean`
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<script setup>
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
|
const userOptions = {
|
||||||
|
url: '/api/data',
|
||||||
|
limit: 10,
|
||||||
|
};
|
||||||
|
|
||||||
|
const arrayData = useArrayData('myKey', userOptions);
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
# https://vitepress.dev/reference/default-theme-home-page
|
||||||
|
layout: home
|
||||||
|
|
||||||
|
hero:
|
||||||
|
name: 'Lilium'
|
||||||
|
text: 'Lilium docs'
|
||||||
|
tagline: Powered by Verdnatura
|
||||||
|
actions:
|
||||||
|
- theme: brand
|
||||||
|
text: Docs
|
||||||
|
link: /components/vnInput
|
||||||
|
---
|
44
package.json
44
package.json
|
@ -1,11 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "25.04.0",
|
"version": "25.08.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@8.15.1",
|
"packageManager": "pnpm@8.15.1",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"resetDatabase": "cd ../salix && gulp docker",
|
"resetDatabase": "cd ../salix && gulp docker",
|
||||||
"lint": "eslint --ext .js,.vue ./",
|
"lint": "eslint --ext .js,.vue ./",
|
||||||
|
@ -17,42 +18,47 @@
|
||||||
"test:unit:ci": "vitest run",
|
"test:unit:ci": "vitest run",
|
||||||
"commitlint": "commitlint --edit",
|
"commitlint": "commitlint --edit",
|
||||||
"prepare": "npx husky install",
|
"prepare": "npx husky install",
|
||||||
"addReferenceTag": "node .husky/addReferenceTag.js"
|
"addReferenceTag": "node .husky/addReferenceTag.js",
|
||||||
|
"docs:dev": "vitepress dev docs",
|
||||||
|
"docs:build": "vitepress build docs",
|
||||||
|
"docs:preview": "vitepress preview docs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@quasar/cli": "^2.3.0",
|
"@quasar/cli": "^2.4.1",
|
||||||
"@quasar/extras": "^1.16.9",
|
"@quasar/extras": "^1.16.16",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"chromium": "^3.0.3",
|
"chromium": "^3.0.3",
|
||||||
"croppie": "^2.6.5",
|
"croppie": "^2.6.5",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"pinia": "^2.1.3",
|
"pinia": "^2.1.3",
|
||||||
"quasar": "^2.14.5",
|
"quasar": "^2.17.7",
|
||||||
"validator": "^13.9.0",
|
"validator": "^13.9.0",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.5.13",
|
||||||
"vue-i18n": "^9.2.2",
|
"vue-i18n": "^9.3.0",
|
||||||
"vue-router": "^4.2.1"
|
"vue-router": "^4.2.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^19.2.1",
|
"@commitlint/cli": "^19.2.1",
|
||||||
"@commitlint/config-conventional": "^19.1.0",
|
"@commitlint/config-conventional": "^19.1.0",
|
||||||
"@intlify/unplugin-vue-i18n": "^0.8.1",
|
"@intlify/unplugin-vue-i18n": "^0.8.2",
|
||||||
"@pinia/testing": "^0.1.2",
|
"@pinia/testing": "^0.1.2",
|
||||||
"@quasar/app-vite": "^1.7.3",
|
"@quasar/app-vite": "^2.0.8",
|
||||||
"@quasar/quasar-app-extension-qcalendar": "4.0.0-beta.15",
|
"@quasar/quasar-app-extension-qcalendar": "^4.0.2",
|
||||||
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
|
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
|
||||||
"@vue/test-utils": "^2.4.4",
|
"@vue/test-utils": "^2.4.4",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
"cypress": "^13.6.6",
|
"cypress": "^13.6.6",
|
||||||
"cypress-mochawesome-reporter": "^3.8.2",
|
"cypress-mochawesome-reporter": "^3.8.2",
|
||||||
"eslint": "^8.41.0",
|
"eslint": "^9.18.0",
|
||||||
"eslint-config-prettier": "^8.8.0",
|
"eslint-config-prettier": "^10.0.1",
|
||||||
"eslint-plugin-cypress": "^2.13.3",
|
"eslint-plugin-cypress": "^4.1.0",
|
||||||
"eslint-plugin-vue": "^9.14.1",
|
"eslint-plugin-vue": "^9.32.0",
|
||||||
"husky": "^8.0.0",
|
"husky": "^8.0.0",
|
||||||
"postcss": "^8.4.23",
|
"postcss": "^8.4.23",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^3.4.2",
|
||||||
"vitest": "^0.31.1"
|
"sass": "^1.83.4",
|
||||||
|
"vitepress": "^1.6.3",
|
||||||
|
"vitest": "^0.34.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^20 || ^18 || ^16",
|
"node": "^20 || ^18 || ^16",
|
||||||
|
@ -61,8 +67,8 @@
|
||||||
"bun": ">= 1.0.25"
|
"bun": ">= 1.0.25"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@vitejs/plugin-vue": "^5.0.4",
|
"@vitejs/plugin-vue": "^5.2.1",
|
||||||
"vite": "^5.1.4",
|
"vite": "^6.0.11",
|
||||||
"vitest": "^0.31.1"
|
"vitest": "^0.31.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
4809
pnpm-lock.yaml
4809
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,14 @@
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// https://github.com/michael-ciniawsky/postcss-load-config
|
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||||
|
|
||||||
module.exports = {
|
import autoprefixer from 'autoprefixer';
|
||||||
|
// Uncomment the following line if you want to support RTL CSS
|
||||||
|
// import rtlcss from 'postcss-rtlcss';
|
||||||
|
|
||||||
|
export default {
|
||||||
plugins: [
|
plugins: [
|
||||||
// https://github.com/postcss/autoprefixer
|
// https://github.com/postcss/autoprefixer
|
||||||
require('autoprefixer')({
|
autoprefixer({
|
||||||
overrideBrowserslist: [
|
overrideBrowserslist: [
|
||||||
'last 4 Chrome versions',
|
'last 4 Chrome versions',
|
||||||
'last 4 Firefox versions',
|
'last 4 Firefox versions',
|
||||||
|
@ -18,10 +22,7 @@ module.exports = {
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// https://github.com/elchininet/postcss-rtlcss
|
// https://github.com/elchininet/postcss-rtlcss
|
||||||
// If you want to support RTL css, then
|
// If you want to support RTL CSS, uncomment the following line:
|
||||||
// 1. yarn/npm install postcss-rtlcss
|
// rtlcss(),
|
||||||
// 2. optionally set quasar.config.js > framework > lang to an RTL language
|
|
||||||
// 3. uncomment the following line:
|
|
||||||
// require('postcss-rtlcss')
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
path: '/api',
|
||||||
|
rule: { target: 'http://0.0.0.0:3000' },
|
||||||
|
},
|
||||||
|
];
|
|
@ -8,11 +8,11 @@
|
||||||
// Configuration for your app
|
// Configuration for your app
|
||||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
|
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
|
||||||
|
|
||||||
const { configure } = require('quasar/wrappers');
|
import { configure } from 'quasar/wrappers';
|
||||||
const VueI18nPlugin = require('@intlify/unplugin-vue-i18n/vite');
|
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||||
const path = require('path');
|
import path from 'path';
|
||||||
|
|
||||||
module.exports = configure(function (/* ctx */) {
|
export default configure(function (/* ctx */) {
|
||||||
return {
|
return {
|
||||||
eslint: {
|
eslint: {
|
||||||
// fix: true,
|
// fix: true,
|
||||||
|
@ -179,7 +179,6 @@ module.exports = configure(function (/* ctx */) {
|
||||||
'render', // keep this as last one
|
'render', // keep this as last one
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
// https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
|
// https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
|
||||||
pwa: {
|
pwa: {
|
||||||
workboxMode: 'generateSW', // or 'injectManifest'
|
workboxMode: 'generateSW', // or 'injectManifest'
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{
|
{
|
||||||
"@quasar/testing-unit-vitest": {
|
"@quasar/testing-unit-vitest": {
|
||||||
"options": ["scripts"]
|
"options": [
|
||||||
|
"scripts"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"@quasar/qcalendar": {}
|
"@quasar/qcalendar": {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ describe('Axios boot', () => {
|
||||||
describe('onRequest()', async () => {
|
describe('onRequest()', async () => {
|
||||||
it('should set the "Authorization" property on the headers', async () => {
|
it('should set the "Authorization" property on the headers', async () => {
|
||||||
const config = { headers: {} };
|
const config = { headers: {} };
|
||||||
|
localStorage.setItem('token', 'DEFAULT_TOKEN');
|
||||||
const resultConfig = onRequest(config);
|
const resultConfig = onRequest(config);
|
||||||
|
|
||||||
expect(resultConfig).toEqual(
|
expect(resultConfig).toEqual(
|
||||||
|
|
|
@ -3,9 +3,9 @@ import { useSession } from 'src/composables/useSession';
|
||||||
import { Router } from 'src/router';
|
import { Router } from 'src/router';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
||||||
|
import { getToken, isLoggedIn } from 'src/utils/session';
|
||||||
import { i18n } from 'src/boot/i18n';
|
import { i18n } from 'src/boot/i18n';
|
||||||
|
|
||||||
const session = useSession();
|
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const stateQuery = useStateQueryStore();
|
const stateQuery = useStateQueryStore();
|
||||||
const baseUrl = '/api/';
|
const baseUrl = '/api/';
|
||||||
|
@ -13,7 +13,7 @@ axios.defaults.baseURL = baseUrl;
|
||||||
const axiosNoError = axios.create({ baseURL: baseUrl });
|
const axiosNoError = axios.create({ baseURL: baseUrl });
|
||||||
|
|
||||||
const onRequest = (config) => {
|
const onRequest = (config) => {
|
||||||
const token = session.getToken();
|
const token = getToken();
|
||||||
if (token.length && !config.headers.Authorization) {
|
if (token.length && !config.headers.Authorization) {
|
||||||
config.headers.Authorization = token;
|
config.headers.Authorization = token;
|
||||||
config.headers['Accept-Language'] = i18n.global.locale.value;
|
config.headers['Accept-Language'] = i18n.global.locale.value;
|
||||||
|
@ -37,15 +37,15 @@ const onResponse = (response) => {
|
||||||
return response;
|
return response;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onResponseError = (error) => {
|
const onResponseError = async (error) => {
|
||||||
stateQuery.remove(error.config);
|
stateQuery.remove(error.config);
|
||||||
|
|
||||||
if (session.isLoggedIn() && error.response?.status === 401) {
|
if (isLoggedIn() && error.response?.status === 401) {
|
||||||
session.destroy(false);
|
await useSession().destroy(false);
|
||||||
const hash = window.location.hash;
|
const hash = window.location.hash;
|
||||||
const url = hash.slice(1);
|
const url = hash.slice(1);
|
||||||
Router.push(`/login?redirect=${url}`);
|
Router.push(`/login?redirect=${url}`);
|
||||||
} else if (!session.isLoggedIn()) {
|
} else if (!isLoggedIn()) {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
export const langs = ['en', 'es'];
|
||||||
|
export const decimalPlaces = 2;
|
|
@ -1,6 +1,6 @@
|
||||||
export default {
|
export default {
|
||||||
mounted: function (el, binding) {
|
mounted(el, binding) {
|
||||||
const shortcut = binding.value ?? '+';
|
const shortcut = binding.value || '+';
|
||||||
|
|
||||||
const { key, ctrl, alt, callback } =
|
const { key, ctrl, alt, callback } =
|
||||||
typeof shortcut === 'string'
|
typeof shortcut === 'string'
|
||||||
|
@ -8,25 +8,24 @@ export default {
|
||||||
key: shortcut,
|
key: shortcut,
|
||||||
ctrl: true,
|
ctrl: true,
|
||||||
alt: true,
|
alt: true,
|
||||||
callback: () =>
|
callback: () => el?.click(),
|
||||||
document
|
|
||||||
.querySelector(`button[shortcut="${shortcut}"]`)
|
|
||||||
?.click(),
|
|
||||||
}
|
}
|
||||||
: binding.value;
|
: binding.value;
|
||||||
|
|
||||||
|
if (!el.hasAttribute('shortcut')) {
|
||||||
|
el.setAttribute('shortcut', key);
|
||||||
|
}
|
||||||
|
|
||||||
const handleKeydown = (event) => {
|
const handleKeydown = (event) => {
|
||||||
if (event.key === key && (!ctrl || event.ctrlKey) && (!alt || event.altKey)) {
|
if (event.key === key && (!ctrl || event.ctrlKey) && (!alt || event.altKey)) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Attach the event listener to the window
|
|
||||||
window.addEventListener('keydown', handleKeydown);
|
window.addEventListener('keydown', handleKeydown);
|
||||||
|
|
||||||
el._handleKeydown = handleKeydown;
|
el._handleKeydown = handleKeydown;
|
||||||
},
|
},
|
||||||
unmounted: function (el) {
|
unmounted(el) {
|
||||||
if (el._handleKeydown) {
|
if (el._handleKeydown) {
|
||||||
window.removeEventListener('keydown', el._handleKeydown);
|
window.removeEventListener('keydown', el._handleKeydown);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ const { t } = useI18n();
|
||||||
const bicInputRef = ref(null);
|
const bicInputRef = ref(null);
|
||||||
const state = useState();
|
const state = useState();
|
||||||
|
|
||||||
const customer = computed(() => state.get('customer'));
|
const customer = computed(() => state.get('Customer'));
|
||||||
|
|
||||||
const countriesFilter = {
|
const countriesFilter = {
|
||||||
fields: ['id', 'name', 'code'],
|
fields: ['id', 'name', 'code'],
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { computed, ref, watch } from 'vue';
|
import { computed, ref, useAttrs, watch } from 'vue';
|
||||||
import { useRouter, onBeforeRouteLeave } from 'vue-router';
|
import { useRouter, onBeforeRouteLeave } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
@ -17,6 +17,7 @@ const quasar = useQuasar();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { validate } = useValidator();
|
const { validate } = useValidator();
|
||||||
|
const $attrs = useAttrs();
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
model: {
|
model: {
|
||||||
|
@ -113,9 +114,11 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function fetch(data) {
|
async function fetch(data) {
|
||||||
resetData(data);
|
const keyData = $attrs['key-data'];
|
||||||
emit('onFetch', data);
|
const rows = keyData ? data[keyData] : data;
|
||||||
return data;
|
resetData(rows);
|
||||||
|
emit('onFetch', rows);
|
||||||
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetData(data) {
|
function resetData(data) {
|
||||||
|
@ -146,7 +149,7 @@ function filter(value, update, filterOptions) {
|
||||||
(ref) => {
|
(ref) => {
|
||||||
ref.setOptionIndex(-1);
|
ref.setOptionIndex(-1);
|
||||||
ref.moveOptionSelection(1, true);
|
ref.moveOptionSelection(1, true);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +215,7 @@ async function remove(data) {
|
||||||
|
|
||||||
if (preRemove.length) {
|
if (preRemove.length) {
|
||||||
newData = newData.filter(
|
newData = newData.filter(
|
||||||
(form) => !preRemove.some((index) => index == form.$index)
|
(form) => !preRemove.some((index) => index == form.$index),
|
||||||
);
|
);
|
||||||
const changes = getChanges();
|
const changes = getChanges();
|
||||||
if (!changes.creates?.length && !changes.updates?.length)
|
if (!changes.creates?.length && !changes.updates?.length)
|
||||||
|
|
|
@ -84,7 +84,7 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
reload: {
|
reload: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: true,
|
||||||
},
|
},
|
||||||
defaultTrim: {
|
defaultTrim: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
@ -97,7 +97,7 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['onFetch', 'onDataSaved']);
|
const emit = defineEmits(['onFetch', 'onDataSaved']);
|
||||||
const modelValue = computed(
|
const modelValue = computed(
|
||||||
() => $props.model ?? `formModel_${route?.meta?.title ?? route.name}`
|
() => $props.model ?? `formModel_${route?.meta?.title ?? route.name}`,
|
||||||
).value;
|
).value;
|
||||||
const componentIsRendered = ref(false);
|
const componentIsRendered = ref(false);
|
||||||
const arrayData = useArrayData(modelValue);
|
const arrayData = useArrayData(modelValue);
|
||||||
|
@ -105,8 +105,8 @@ const isLoading = ref(false);
|
||||||
// Si elegimos observar los cambios del form significa que inicialmente las actions estaran deshabilitadas
|
// Si elegimos observar los cambios del form significa que inicialmente las actions estaran deshabilitadas
|
||||||
const isResetting = ref(false);
|
const isResetting = ref(false);
|
||||||
const hasChanges = ref(!$props.observeFormChanges);
|
const hasChanges = ref(!$props.observeFormChanges);
|
||||||
const originalData = ref({});
|
const originalData = computed(() => state.get(modelValue));
|
||||||
const formData = computed(() => state.get(modelValue));
|
const formData = ref({});
|
||||||
const defaultButtons = computed(() => ({
|
const defaultButtons = computed(() => ({
|
||||||
save: {
|
save: {
|
||||||
dataCy: 'saveDefaultBtn',
|
dataCy: 'saveDefaultBtn',
|
||||||
|
@ -127,8 +127,6 @@ const defaultButtons = computed(() => ({
|
||||||
}));
|
}));
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
originalData.value = JSON.parse(JSON.stringify($props.formInitialData ?? {}));
|
|
||||||
|
|
||||||
nextTick(() => (componentIsRendered.value = true));
|
nextTick(() => (componentIsRendered.value = true));
|
||||||
|
|
||||||
// Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla
|
// Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla
|
||||||
|
@ -148,7 +146,7 @@ onMounted(async () => {
|
||||||
JSON.stringify(newVal) !== JSON.stringify(originalData.value);
|
JSON.stringify(newVal) !== JSON.stringify(originalData.value);
|
||||||
isResetting.value = false;
|
isResetting.value = false;
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -156,16 +154,24 @@ onMounted(async () => {
|
||||||
if (!$props.url)
|
if (!$props.url)
|
||||||
watch(
|
watch(
|
||||||
() => arrayData.store.data,
|
() => arrayData.store.data,
|
||||||
(val) => updateAndEmit('onFetch', val)
|
(val) => updateAndEmit('onFetch', val),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
originalData,
|
||||||
|
(val) => {
|
||||||
|
if (val) formData.value = JSON.parse(JSON.stringify(val));
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => [$props.url, $props.filter],
|
() => [$props.url, $props.filter],
|
||||||
async () => {
|
async () => {
|
||||||
originalData.value = null;
|
state.set(modelValue, null);
|
||||||
reset();
|
reset();
|
||||||
await fetch();
|
await fetch();
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
onBeforeRouteLeave((to, from, next) => {
|
onBeforeRouteLeave((to, from, next) => {
|
||||||
|
@ -197,7 +203,6 @@ async function fetch() {
|
||||||
updateAndEmit('onFetch', data);
|
updateAndEmit('onFetch', data);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
state.set(modelValue, {});
|
state.set(modelValue, {});
|
||||||
originalData.value = {};
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,6 +241,7 @@ async function saveAndGo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
|
formData.value = JSON.parse(JSON.stringify(originalData.value));
|
||||||
updateAndEmit('onFetch', originalData.value);
|
updateAndEmit('onFetch', originalData.value);
|
||||||
if ($props.observeFormChanges) {
|
if ($props.observeFormChanges) {
|
||||||
hasChanges.value = false;
|
hasChanges.value = false;
|
||||||
|
@ -254,13 +260,12 @@ function filter(value, update, filterOptions) {
|
||||||
(ref) => {
|
(ref) => {
|
||||||
ref.setOptionIndex(-1);
|
ref.setOptionIndex(-1);
|
||||||
ref.moveOptionSelection(1, true);
|
ref.moveOptionSelection(1, true);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateAndEmit(evt, val, res) {
|
function updateAndEmit(evt, val, res) {
|
||||||
state.set(modelValue, val);
|
state.set(modelValue, val);
|
||||||
originalData.value = val && JSON.parse(JSON.stringify(val));
|
|
||||||
if (!$props.url) arrayData.store.data = val;
|
if (!$props.url) arrayData.store.data = val;
|
||||||
|
|
||||||
emit(evt, state.get(modelValue), res);
|
emit(evt, state.get(modelValue), res);
|
||||||
|
|
|
@ -31,7 +31,6 @@ const props = defineProps({
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const itemTypesOptions = ref([]);
|
const itemTypesOptions = ref([]);
|
||||||
const suppliersOptions = ref([]);
|
|
||||||
const tagOptions = ref([]);
|
const tagOptions = ref([]);
|
||||||
const tagValues = ref([]);
|
const tagValues = ref([]);
|
||||||
const categoryList = ref(null);
|
const categoryList = ref(null);
|
||||||
|
@ -40,13 +39,13 @@ const selectedTypeFk = ref(getParamWhere(route.query.table, 'typeFk', false));
|
||||||
|
|
||||||
const selectedCategory = computed(() => {
|
const selectedCategory = computed(() => {
|
||||||
return (categoryList.value || []).find(
|
return (categoryList.value || []).find(
|
||||||
(category) => category?.id === selectedCategoryFk.value
|
(category) => category?.id === selectedCategoryFk.value,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const selectedType = computed(() => {
|
const selectedType = computed(() => {
|
||||||
return (itemTypesOptions.value || []).find(
|
return (itemTypesOptions.value || []).find(
|
||||||
(type) => type?.id === selectedTypeFk.value
|
(type) => type?.id === selectedTypeFk.value,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -134,13 +133,6 @@ const setCategoryList = (data) => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="ItemCategories" limit="30" auto-load @on-fetch="setCategoryList" />
|
<FetchData url="ItemCategories" limit="30" auto-load @on-fetch="setCategoryList" />
|
||||||
<FetchData
|
|
||||||
url="Suppliers"
|
|
||||||
limit="30"
|
|
||||||
auto-load
|
|
||||||
:filter="{ fields: ['id', 'name', 'nickname'], order: 'name ASC', limit: 30 }"
|
|
||||||
@on-fetch="(data) => (suppliersOptions = data)"
|
|
||||||
/>
|
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Tags"
|
url="Tags"
|
||||||
:filter="{ fields: ['id', 'name', 'isFree'] }"
|
:filter="{ fields: ['id', 'name', 'isFree'] }"
|
||||||
|
@ -290,7 +282,7 @@ const setCategoryList = (data) => {
|
||||||
<QItem class="q-mt-lg">
|
<QItem class="q-mt-lg">
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="add_circle"
|
icon="add_circle"
|
||||||
shortcut="+"
|
v-shortcut="'+'"
|
||||||
flat
|
flat
|
||||||
class="fill-icon-on-hover q-px-xs"
|
class="fill-icon-on-hover q-px-xs"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -349,4 +341,11 @@ es:
|
||||||
floramondo: Floramondo
|
floramondo: Floramondo
|
||||||
salesPersonFk: Comprador
|
salesPersonFk: Comprador
|
||||||
categoryFk: Categoría
|
categoryFk: Categoría
|
||||||
|
Plant: Planta natural
|
||||||
|
Flower: Flor fresca
|
||||||
|
Handmade: Hecho a mano
|
||||||
|
Artificial: Artificial
|
||||||
|
Green: Verdes frescos
|
||||||
|
Accessories: Complementos florales
|
||||||
|
Fruit: Fruta
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -10,12 +10,13 @@ import routes from 'src/router/modules';
|
||||||
import LeftMenuItem from './LeftMenuItem.vue';
|
import LeftMenuItem from './LeftMenuItem.vue';
|
||||||
import LeftMenuItemGroup from './LeftMenuItemGroup.vue';
|
import LeftMenuItemGroup from './LeftMenuItemGroup.vue';
|
||||||
import VnInput from './common/VnInput.vue';
|
import VnInput from './common/VnInput.vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const navigation = useNavigationStore();
|
const navigation = useNavigationStore();
|
||||||
|
const router = useRouter();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
source: {
|
source: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -40,7 +41,6 @@ const filteredItems = computed(() => {
|
||||||
return locale.includes(normalizedSearch);
|
return locale.includes(normalizedSearch);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const filteredPinnedModules = computed(() => {
|
const filteredPinnedModules = computed(() => {
|
||||||
if (!search.value) return pinnedModules.value;
|
if (!search.value) return pinnedModules.value;
|
||||||
const normalizedSearch = search.value
|
const normalizedSearch = search.value
|
||||||
|
@ -71,7 +71,7 @@ watch(
|
||||||
items.value = [];
|
items.value = [];
|
||||||
getRoutes();
|
getRoutes();
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
function findMatches(search, item) {
|
function findMatches(search, item) {
|
||||||
|
@ -103,12 +103,22 @@ function addChildren(module, route, parent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRoutes() {
|
function getRoutes() {
|
||||||
if (props.source === 'main') {
|
const handleRoutes = {
|
||||||
|
main: getMainRoutes,
|
||||||
|
card: getCardRoutes,
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
handleRoutes[props.source]();
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(`Method is not defined`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getMainRoutes() {
|
||||||
const modules = Object.assign([], navigation.getModules().value);
|
const modules = Object.assign([], navigation.getModules().value);
|
||||||
|
|
||||||
for (const item of modules) {
|
for (const item of modules) {
|
||||||
const moduleDef = routes.find(
|
const moduleDef = routes.find(
|
||||||
(route) => toLowerCamel(route.name) === item.module
|
(route) => toLowerCamel(route.name) === item.module,
|
||||||
);
|
);
|
||||||
if (!moduleDef) continue;
|
if (!moduleDef) continue;
|
||||||
item.children = [];
|
item.children = [];
|
||||||
|
@ -117,19 +127,16 @@ function getRoutes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
items.value = modules;
|
items.value = modules;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.source === 'card') {
|
function getCardRoutes() {
|
||||||
const currentRoute = route.matched[1];
|
const currentRoute = route.matched[1];
|
||||||
const currentModule = toLowerCamel(currentRoute.name);
|
const currentModule = toLowerCamel(currentRoute.name);
|
||||||
let moduleDef = routes.find(
|
let moduleDef = routes.find((route) => toLowerCamel(route.name) === currentModule);
|
||||||
(route) => toLowerCamel(route.name) === currentModule
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!moduleDef) return;
|
if (!moduleDef) return;
|
||||||
if (!moduleDef?.menus) moduleDef = betaGetRoutes();
|
if (!moduleDef?.menus) moduleDef = betaGetRoutes();
|
||||||
addChildren(currentModule, moduleDef, items.value);
|
addChildren(currentModule, moduleDef, items.value);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function betaGetRoutes() {
|
function betaGetRoutes() {
|
||||||
|
@ -174,6 +181,10 @@ function normalize(text) {
|
||||||
.replace(/[\u0300-\u036f]/g, '')
|
.replace(/[\u0300-\u036f]/g, '')
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
}
|
}
|
||||||
|
const searchModule = () => {
|
||||||
|
const [item] = filteredItems.value;
|
||||||
|
if (item) router.push({ name: item.name });
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -188,10 +199,11 @@ function normalize(text) {
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
autofocus
|
autofocus
|
||||||
|
@keyup.enter.stop="searchModule()"
|
||||||
/>
|
/>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
<template v-if="filteredPinnedModules.size">
|
<template v-if="filteredPinnedModules.size && !search">
|
||||||
<LeftMenuItem
|
<LeftMenuItem
|
||||||
v-for="[key, pinnedModule] of filteredPinnedModules"
|
v-for="[key, pinnedModule] of filteredPinnedModules"
|
||||||
:key="key"
|
:key="key"
|
||||||
|
@ -215,11 +227,18 @@ function normalize(text) {
|
||||||
</LeftMenuItem>
|
</LeftMenuItem>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
</template>
|
</template>
|
||||||
<template v-for="item in filteredItems" :key="item.name">
|
<template v-for="(item, index) in filteredItems" :key="item.name">
|
||||||
<template
|
<template
|
||||||
v-if="item.children && !filteredPinnedModules.has(item.name)"
|
v-if="
|
||||||
|
search ||
|
||||||
|
(item.children && !filteredPinnedModules.has(item.name))
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<LeftMenuItem
|
||||||
|
:item="item"
|
||||||
|
group="modules"
|
||||||
|
:class="search && index === 0 ? 'searched' : ''"
|
||||||
>
|
>
|
||||||
<LeftMenuItem :item="item" group="modules">
|
|
||||||
<template #side>
|
<template #side>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="item.isPinned === true"
|
v-if="item.isPinned === true"
|
||||||
|
@ -336,6 +355,9 @@ function normalize(text) {
|
||||||
.header {
|
.header {
|
||||||
color: var(--vn-label-color);
|
color: var(--vn-label-color);
|
||||||
}
|
}
|
||||||
|
.searched {
|
||||||
|
background-color: var(--vn-section-hover-color);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
|
|
|
@ -20,6 +20,7 @@ const appName = 'Lilium';
|
||||||
const pinnedModulesRef = ref();
|
const pinnedModulesRef = ref();
|
||||||
|
|
||||||
onMounted(() => stateStore.setMounted());
|
onMounted(() => stateStore.setMounted());
|
||||||
|
const refresh = () => window.location.reload();
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QHeader color="white" elevated>
|
<QHeader color="white" elevated>
|
||||||
|
@ -64,6 +65,13 @@ onMounted(() => stateStore.setMounted());
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
||||||
<div id="actions-prepend"></div>
|
<div id="actions-prepend"></div>
|
||||||
|
<QIcon
|
||||||
|
name="refresh"
|
||||||
|
size="md"
|
||||||
|
color="red"
|
||||||
|
v-if="state.get('error')"
|
||||||
|
@click="refresh"
|
||||||
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
:class="{ 'q-pa-none': quasar.platform.is.mobile }"
|
:class="{ 'q-pa-none': quasar.platform.is.mobile }"
|
||||||
id="pinnedModules"
|
id="pinnedModules"
|
||||||
|
|
|
@ -2,26 +2,9 @@
|
||||||
defineProps({ row: { type: Object, required: true } });
|
defineProps({ row: { type: Object, required: true } });
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<span>
|
<span class="q-gutter-x-xs">
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.isTaxDataChecked === 0"
|
v-if="row?.risk"
|
||||||
name="vn:no036"
|
|
||||||
color="primary"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.hasTicketRequest" name="vn:buyrequest" color="primary" size="xs">
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.itemShortage" name="vn:unavailable" color="primary" size="xs">
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.notVisible') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.isFreezed" name="vn:frozen" color="primary" size="xs">
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.clientFrozen') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.risk"
|
|
||||||
name="vn:risk"
|
name="vn:risk"
|
||||||
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
||||||
size="xs"
|
size="xs"
|
||||||
|
@ -30,10 +13,57 @@ defineProps({ row: { type: Object, required: true } });
|
||||||
{{ $t('salesTicketsTable.risk') }}: {{ row.risk - row.credit }}
|
{{ $t('salesTicketsTable.risk') }}: {{ row.risk - row.credit }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon v-if="row.hasComponentLack" name="vn:components" color="primary" size="xs">
|
<QIcon
|
||||||
|
v-if="row?.hasComponentLack"
|
||||||
|
name="vn:components"
|
||||||
|
color="primary"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
<QTooltip>{{ $t('salesTicketsTable.componentLack') }}</QTooltip>
|
<QTooltip>{{ $t('salesTicketsTable.componentLack') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon v-if="row.isTooLittle" name="vn:isTooLittle" color="primary" size="xs">
|
<QIcon v-if="row?.hasItemDelay" color="primary" size="xs" name="vn:hasItemDelay">
|
||||||
|
<QTooltip>
|
||||||
|
{{ $t('ticket.summary.hasItemDelay') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row?.hasItemLost" color="primary" size="xs" name="vn:hasItemLost">
|
||||||
|
<QTooltip>
|
||||||
|
{{ $t('salesTicketsTable.hasItemLost') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row?.hasItemShortage"
|
||||||
|
name="vn:unavailable"
|
||||||
|
color="primary"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.notVisible') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row?.hasRounding" color="primary" name="sync_problem" size="xs">
|
||||||
|
<QTooltip>
|
||||||
|
{{ $t('ticketList.rounding') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row?.hasTicketRequest"
|
||||||
|
name="vn:buyrequest"
|
||||||
|
color="primary"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="!row?.isTaxDataChecked === 0"
|
||||||
|
name="vn:no036"
|
||||||
|
color="primary"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row?.isFreezed" name="vn:frozen" color="primary" size="xs">
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.clientFrozen') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row?.isTooLittle" name="vn:isTooLittle" color="primary" size="xs">
|
||||||
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
|
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import quasarLang from 'src/utils/quasarLang';
|
||||||
|
|
||||||
import { onMounted, computed, ref } from 'vue';
|
import { onMounted, computed, ref } from 'vue';
|
||||||
import { Dark, Quasar } from 'quasar';
|
|
||||||
|
import { Dark } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -31,14 +34,7 @@ const userLocale = computed({
|
||||||
|
|
||||||
value = localeEquivalence[value] ?? value;
|
value = localeEquivalence[value] ?? value;
|
||||||
|
|
||||||
try {
|
quasarLang(value);
|
||||||
/* @vite-ignore */
|
|
||||||
import(`../../node_modules/quasar/lang/${value}.mjs`).then((lang) => {
|
|
||||||
Quasar.lang.set(lang.default);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,7 @@ onMounted(() => {
|
||||||
watch(
|
watch(
|
||||||
() => $props.columns,
|
() => $props.columns,
|
||||||
(value) => splitColumns(value),
|
(value) => splitColumns(value),
|
||||||
{ immediate: true }
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
const isTableMode = computed(() => mode.value == TABLE_MODE);
|
const isTableMode = computed(() => mode.value == TABLE_MODE);
|
||||||
|
@ -212,7 +212,7 @@ function splitColumns(columns) {
|
||||||
// Status column
|
// Status column
|
||||||
if (splittedColumns.value.chips.length) {
|
if (splittedColumns.value.chips.length) {
|
||||||
splittedColumns.value.columnChips = splittedColumns.value.chips.filter(
|
splittedColumns.value.columnChips = splittedColumns.value.chips.filter(
|
||||||
(c) => !c.isId
|
(c) => !c.isId,
|
||||||
);
|
);
|
||||||
if (splittedColumns.value.columnChips.length)
|
if (splittedColumns.value.columnChips.length)
|
||||||
splittedColumns.value.columns.unshift({
|
splittedColumns.value.columns.unshift({
|
||||||
|
@ -314,7 +314,19 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
show-if-above
|
show-if-above
|
||||||
>
|
>
|
||||||
<QScrollArea class="fit">
|
<QScrollArea class="fit">
|
||||||
<VnTableFilter :data-key="$attrs['data-key']" :columns="columns" :redirect="redirect" />
|
<VnTableFilter
|
||||||
|
:data-key="$attrs['data-key']"
|
||||||
|
:columns="columns"
|
||||||
|
:redirect="redirect"
|
||||||
|
>
|
||||||
|
<template
|
||||||
|
v-for="(_, slotName) in $slots"
|
||||||
|
#[slotName]="slotData"
|
||||||
|
:key="slotName"
|
||||||
|
>
|
||||||
|
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||||
|
</template>
|
||||||
|
</VnTableFilter>
|
||||||
</QScrollArea>
|
</QScrollArea>
|
||||||
</QDrawer>
|
</QDrawer>
|
||||||
<CrudModel
|
<CrudModel
|
||||||
|
@ -472,7 +484,9 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
|
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
|
||||||
"
|
"
|
||||||
:style="`visibility: ${
|
:style="`visibility: ${
|
||||||
(btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden'
|
((btn.show && btn.show(row)) ?? true)
|
||||||
|
? 'visible'
|
||||||
|
: 'hidden'
|
||||||
}`"
|
}`"
|
||||||
@click="btn.action(row)"
|
@click="btn.action(row)"
|
||||||
/>
|
/>
|
||||||
|
@ -486,7 +500,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
<QCard
|
<QCard
|
||||||
bordered
|
bordered
|
||||||
flat
|
flat
|
||||||
class="row no-wrap justify-between cursor-pointer"
|
class="row no-wrap justify-between cursor-pointer q-pa-sm"
|
||||||
@click="
|
@click="
|
||||||
(_, row) => {
|
(_, row) => {
|
||||||
$props.rowClick && $props.rowClick(row);
|
$props.rowClick && $props.rowClick(row);
|
||||||
|
@ -567,7 +581,6 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
<!-- Actions -->
|
<!-- Actions -->
|
||||||
<QCardSection
|
<QCardSection
|
||||||
v-if="colsMap.tableActions"
|
v-if="colsMap.tableActions"
|
||||||
class="column flex-center w-10 no-margin q-pa-xs q-gutter-y-xs"
|
|
||||||
@click="stopEventPropagation($event)"
|
@click="stopEventPropagation($event)"
|
||||||
>
|
>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -616,7 +629,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
size="md"
|
size="md"
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
shortcut="+"
|
v-shortcut="'+'"
|
||||||
:disabled="!disabledAttr"
|
:disabled="!disabledAttr"
|
||||||
/>
|
/>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
|
@ -634,7 +647,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
color="primary"
|
color="primary"
|
||||||
fab
|
fab
|
||||||
icon="add"
|
icon="add"
|
||||||
shortcut="+"
|
v-shortcut="'+'"
|
||||||
data-cy="vnTableCreateBtn"
|
data-cy="vnTableCreateBtn"
|
||||||
/>
|
/>
|
||||||
<QTooltip self="top right">
|
<QTooltip self="top right">
|
||||||
|
@ -793,12 +806,15 @@ es:
|
||||||
|
|
||||||
.grid-two {
|
.grid-two {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
|
grid-template-columns: 2fr 2fr;
|
||||||
max-width: 100%;
|
.vn-label-value {
|
||||||
margin: 0 auto;
|
flex-direction: column;
|
||||||
overflow: scroll;
|
white-space: nowrap;
|
||||||
white-space: wrap;
|
.fields {
|
||||||
width: 100%;
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.w-80 {
|
.w-80 {
|
||||||
|
|
|
@ -27,7 +27,7 @@ function columnName(col) {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnFilterPanel v-bind="$attrs" :search-button="true" :disable-submit-event="true">
|
<VnFilterPanel v-bind="$attrs" :search-button="true" :disable-submit-event="true">
|
||||||
<template #body="{ params, orders }">
|
<template #body="{ params, orders, searchFn }">
|
||||||
<div
|
<div
|
||||||
class="row no-wrap flex-center"
|
class="row no-wrap flex-center"
|
||||||
v-for="col of columns.filter((c) => c.columnFilter ?? true)"
|
v-for="col of columns.filter((c) => c.columnFilter ?? true)"
|
||||||
|
@ -52,6 +52,7 @@ function columnName(col) {
|
||||||
<slot
|
<slot
|
||||||
name="moreFilterPanel"
|
name="moreFilterPanel"
|
||||||
:params="params"
|
:params="params"
|
||||||
|
:search-fn="searchFn"
|
||||||
:orders="orders"
|
:orders="orders"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
/>
|
/>
|
||||||
|
@ -62,5 +63,8 @@ function columnName(col) {
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
|
||||||
|
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||||
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -0,0 +1,121 @@
|
||||||
|
import { describe, expect, it, beforeEach, afterEach, vi } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import VnVisibleColumn from '../VnVisibleColumn.vue';
|
||||||
|
import { axios } from 'app/test/vitest/helper';
|
||||||
|
|
||||||
|
describe('VnVisibleColumns', () => {
|
||||||
|
let wrapper;
|
||||||
|
let vm;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
wrapper = createWrapper(VnVisibleColumn, {
|
||||||
|
propsData: {
|
||||||
|
tableCode: 'testTable',
|
||||||
|
skip: ['skippedColumn'],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
vm = wrapper.vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('setUserConfigViewData()', () => {
|
||||||
|
it('should initialize localColumns with visible configuration', () => {
|
||||||
|
vm.columns = [
|
||||||
|
{ name: 'columnMockName', label: undefined },
|
||||||
|
{ name: 'columnMockAddress', label: undefined },
|
||||||
|
{ name: 'columnMockId', label: undefined },
|
||||||
|
];
|
||||||
|
const configuration = {
|
||||||
|
columnMockName: true,
|
||||||
|
columnMockAddress: false,
|
||||||
|
columnMockId: true,
|
||||||
|
};
|
||||||
|
const expectedColumns = [
|
||||||
|
{ name: 'columnMockName', label: undefined, visible: true },
|
||||||
|
{ name: 'columnMockAddress', label: undefined, visible: false },
|
||||||
|
{ name: 'columnMockId', label: undefined, visible: true },
|
||||||
|
];
|
||||||
|
|
||||||
|
vm.setUserConfigViewData(configuration, false);
|
||||||
|
|
||||||
|
expect(vm.localColumns).toEqual(expectedColumns);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should skip columns based on props', () => {
|
||||||
|
vm.columns = [
|
||||||
|
{ name: 'columnMockName', label: undefined },
|
||||||
|
{ name: 'columnMockId', label: undefined },
|
||||||
|
{ name: 'skippedColumn', label: 'Skipped Column' },
|
||||||
|
];
|
||||||
|
const configuration = {
|
||||||
|
columnMockName: true,
|
||||||
|
skippedColumn: false,
|
||||||
|
columnMockId: true,
|
||||||
|
};
|
||||||
|
const expectedColumns = [
|
||||||
|
{ name: 'columnMockName', label: undefined, visible: true },
|
||||||
|
{ name: 'columnMockId', label: undefined, visible: true },
|
||||||
|
];
|
||||||
|
|
||||||
|
vm.setUserConfigViewData(configuration, false);
|
||||||
|
|
||||||
|
expect(vm.localColumns).toEqual(expectedColumns);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('toggleMarkAll()', () => {
|
||||||
|
it('should set all localColumns to visible=true', () => {
|
||||||
|
vm.localColumns = [
|
||||||
|
{ name: 'columnMockName', visible: false },
|
||||||
|
{ name: 'columnMockId', visible: false },
|
||||||
|
];
|
||||||
|
|
||||||
|
vm.toggleMarkAll(true);
|
||||||
|
|
||||||
|
expect(vm.localColumns.every((col) => col.visible)).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set all localColumns to visible=false', () => {
|
||||||
|
vm.localColumns = [
|
||||||
|
{ name: 'columnMockName', visible: true },
|
||||||
|
{ name: 'columnMockId', visible: true },
|
||||||
|
];
|
||||||
|
|
||||||
|
vm.toggleMarkAll(false);
|
||||||
|
|
||||||
|
expect(vm.localColumns.every((col) => col.visible)).toBe(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('saveConfig()', () => {
|
||||||
|
it('should call setUserConfigViewData and axios.post with correct params', async () => {
|
||||||
|
const mockAxiosPost = vi.spyOn(axios, 'post').mockResolvedValue({
|
||||||
|
data: [{ id: 1 }],
|
||||||
|
});
|
||||||
|
|
||||||
|
vm.localColumns = [
|
||||||
|
{ name: 'columnMockName', visible: true },
|
||||||
|
{ name: 'columnMockId', visible: false },
|
||||||
|
];
|
||||||
|
|
||||||
|
await vm.saveConfig();
|
||||||
|
|
||||||
|
expect(mockAxiosPost).toHaveBeenCalledWith('UserConfigViews/crud', {
|
||||||
|
creates: [
|
||||||
|
{
|
||||||
|
userFk: vm.user.id,
|
||||||
|
tableCode: vm.tableCode,
|
||||||
|
tableConfig: vm.tableCode,
|
||||||
|
configuration: {
|
||||||
|
columnMockName: true,
|
||||||
|
columnMockId: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,12 @@
|
||||||
|
export default function (initialFooter, data) {
|
||||||
|
const footer = data.reduce(
|
||||||
|
(acc, row) => {
|
||||||
|
Object.entries(initialFooter).forEach(([key, initialValue]) => {
|
||||||
|
acc[key] += row?.[key] !== undefined ? row[key] : initialValue;
|
||||||
|
});
|
||||||
|
return acc;
|
||||||
|
},
|
||||||
|
{ ...initialFooter }
|
||||||
|
);
|
||||||
|
return footer;
|
||||||
|
}
|
|
@ -93,7 +93,7 @@ describe('FormModel', () => {
|
||||||
|
|
||||||
it('should call axios.patch with the right data', async () => {
|
it('should call axios.patch with the right data', async () => {
|
||||||
const spy = vi.spyOn(axios, 'patch').mockResolvedValue({ data: {} });
|
const spy = vi.spyOn(axios, 'patch').mockResolvedValue({ data: {} });
|
||||||
const { vm } = mount({ propsData: { url, model, formInitialData } });
|
const { vm } = mount({ propsData: { url, model } });
|
||||||
vm.formData.mockKey = 'newVal';
|
vm.formData.mockKey = 'newVal';
|
||||||
await vm.$nextTick();
|
await vm.$nextTick();
|
||||||
await vm.save();
|
await vm.save();
|
||||||
|
@ -106,6 +106,7 @@ describe('FormModel', () => {
|
||||||
const { vm } = mount({
|
const { vm } = mount({
|
||||||
propsData: { url, model, formInitialData, urlCreate: 'mockUrlCreate' },
|
propsData: { url, model, formInitialData, urlCreate: 'mockUrlCreate' },
|
||||||
});
|
});
|
||||||
|
await vm.$nextTick();
|
||||||
vm.formData.mockKey = 'newVal';
|
vm.formData.mockKey = 'newVal';
|
||||||
await vm.$nextTick();
|
await vm.$nextTick();
|
||||||
await vm.save();
|
await vm.save();
|
||||||
|
@ -119,7 +120,7 @@ describe('FormModel', () => {
|
||||||
});
|
});
|
||||||
const spyPatch = vi.spyOn(axios, 'patch').mockResolvedValue({ data: {} });
|
const spyPatch = vi.spyOn(axios, 'patch').mockResolvedValue({ data: {} });
|
||||||
const spySaveFn = vi.spyOn(vm.$props, 'saveFn');
|
const spySaveFn = vi.spyOn(vm.$props, 'saveFn');
|
||||||
|
await vm.$nextTick();
|
||||||
vm.formData.mockKey = 'newVal';
|
vm.formData.mockKey = 'newVal';
|
||||||
await vm.$nextTick();
|
await vm.$nextTick();
|
||||||
await vm.save();
|
await vm.save();
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
import { vi, describe, expect, it, beforeAll } from 'vitest';
|
import { vi, describe, expect, it, beforeAll, beforeEach, afterEach } from 'vitest';
|
||||||
import { createWrapper, axios } from 'app/test/vitest/helper';
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
import Leftmenu from 'components/LeftMenu.vue';
|
import Leftmenu from 'components/LeftMenu.vue';
|
||||||
|
import * as vueRouter from 'vue-router';
|
||||||
import { useNavigationStore } from 'src/stores/useNavigationStore';
|
import { useNavigationStore } from 'src/stores/useNavigationStore';
|
||||||
|
|
||||||
|
let vm;
|
||||||
|
let navigation;
|
||||||
|
|
||||||
vi.mock('src/router/modules', () => ({
|
vi.mock('src/router/modules', () => ({
|
||||||
default: [
|
default: [
|
||||||
{
|
{
|
||||||
|
@ -21,6 +24,16 @@ vi.mock('src/router/modules', () => ({
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
name: 'CustomerMain',
|
name: 'CustomerMain',
|
||||||
|
meta: {
|
||||||
|
menu: 'Customer',
|
||||||
|
menuChildren: [
|
||||||
|
{
|
||||||
|
name: 'CustomerCreditContracts',
|
||||||
|
title: 'creditContracts',
|
||||||
|
icon: 'vn:solunion',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'list',
|
path: 'list',
|
||||||
|
@ -28,6 +41,13 @@ vi.mock('src/router/modules', () => ({
|
||||||
meta: {
|
meta: {
|
||||||
title: 'list',
|
title: 'list',
|
||||||
icon: 'view_list',
|
icon: 'view_list',
|
||||||
|
menuChildren: [
|
||||||
|
{
|
||||||
|
name: 'CustomerCreditContracts',
|
||||||
|
title: 'creditContracts',
|
||||||
|
icon: 'vn:solunion',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -44,20 +64,59 @@ vi.mock('src/router/modules', () => ({
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}));
|
}));
|
||||||
|
vi.spyOn(vueRouter, 'useRoute').mockReturnValue({
|
||||||
describe('Leftmenu', () => {
|
matched: [
|
||||||
let vm;
|
{
|
||||||
let navigation;
|
path: '/',
|
||||||
beforeAll(() => {
|
redirect: {
|
||||||
|
name: 'Dashboard',
|
||||||
|
},
|
||||||
|
name: 'Main',
|
||||||
|
meta: {},
|
||||||
|
props: {
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '/dashboard',
|
||||||
|
name: 'Dashboard',
|
||||||
|
meta: {
|
||||||
|
title: 'dashboard',
|
||||||
|
icon: 'dashboard',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/customer',
|
||||||
|
redirect: {
|
||||||
|
name: 'CustomerMain',
|
||||||
|
},
|
||||||
|
name: 'Customer',
|
||||||
|
meta: {
|
||||||
|
title: 'customers',
|
||||||
|
icon: 'vn:client',
|
||||||
|
moduleName: 'Customer',
|
||||||
|
keyBinding: 'c',
|
||||||
|
menu: 'customer',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
query: {},
|
||||||
|
params: {},
|
||||||
|
meta: { moduleName: 'mockName' },
|
||||||
|
path: 'mockName/1',
|
||||||
|
name: 'Customer',
|
||||||
|
});
|
||||||
|
function mount(source = 'main') {
|
||||||
vi.spyOn(axios, 'get').mockResolvedValue({
|
vi.spyOn(axios, 'get').mockResolvedValue({
|
||||||
data: [],
|
data: [],
|
||||||
});
|
});
|
||||||
|
const wrapper = createWrapper(Leftmenu, {
|
||||||
vm = createWrapper(Leftmenu, {
|
|
||||||
propsData: {
|
propsData: {
|
||||||
source: 'main',
|
source,
|
||||||
},
|
},
|
||||||
}).vm;
|
});
|
||||||
|
|
||||||
navigation = useNavigationStore();
|
navigation = useNavigationStore();
|
||||||
navigation.fetchPinned = vi.fn().mockReturnValue(Promise.resolve(true));
|
navigation.fetchPinned = vi.fn().mockReturnValue(Promise.resolve(true));
|
||||||
|
@ -71,24 +130,259 @@ describe('Leftmenu', () => {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('getRoutes', () => {
|
||||||
|
afterEach(() => vi.clearAllMocks());
|
||||||
|
const getRoutes = vi.fn().mockImplementation((props, getMethodA, getMethodB) => {
|
||||||
|
const handleRoutes = {
|
||||||
|
methodA: getMethodA,
|
||||||
|
methodB: getMethodB,
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
handleRoutes[props.source]();
|
||||||
|
} catch (error) {
|
||||||
|
throw Error('Method not defined');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return a proper formated object with two child items', async () => {
|
const getMethodA = vi.fn();
|
||||||
const expectedMenuItem = [
|
const getMethodB = vi.fn();
|
||||||
{
|
const fn = (props) => getRoutes(props, getMethodA, getMethodB);
|
||||||
children: null,
|
|
||||||
name: 'CustomerList',
|
it('should call getMethodB when source is card', () => {
|
||||||
title: 'globals.pageTitles.list',
|
let props = { source: 'methodB' };
|
||||||
icon: 'view_list',
|
fn(props);
|
||||||
},
|
|
||||||
{
|
expect(getMethodB).toHaveBeenCalled();
|
||||||
children: null,
|
expect(getMethodA).not.toHaveBeenCalled();
|
||||||
name: 'CustomerCreate',
|
});
|
||||||
title: 'globals.pageTitles.createCustomer',
|
it('should call getMethodA when source is main', () => {
|
||||||
icon: 'vn:addperson',
|
let props = { source: 'methodA' };
|
||||||
},
|
fn(props);
|
||||||
];
|
|
||||||
const firstMenuItem = vm.items[0];
|
expect(getMethodA).toHaveBeenCalled();
|
||||||
expect(firstMenuItem.children).toEqual(expect.arrayContaining(expectedMenuItem));
|
expect(getMethodB).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call getMethodA when source is not exists or undefined', () => {
|
||||||
|
let props = { source: 'methodC' };
|
||||||
|
expect(() => fn(props)).toThrowError('Method not defined');
|
||||||
|
|
||||||
|
expect(getMethodA).not.toHaveBeenCalled();
|
||||||
|
expect(getMethodB).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Leftmenu as card', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
vm = mount('card').vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should get routes for card source', async () => {
|
||||||
|
vm.getRoutes();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
describe('Leftmenu as main', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
vm = mount().vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should initialize with default props', () => {
|
||||||
|
expect(vm.source).toBe('main');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should filter items based on search input', async () => {
|
||||||
|
vm.search = 'cust';
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(vm.filteredItems[0].name).toEqual('customer');
|
||||||
|
expect(vm.filteredItems[0].module).toEqual('customer');
|
||||||
|
});
|
||||||
|
it('should filter items based on search input', async () => {
|
||||||
|
vm.search = 'Rou';
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(vm.filteredItems).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return pinned items', () => {
|
||||||
|
vm.items = [
|
||||||
|
{ name: 'Item 1', isPinned: false },
|
||||||
|
{ name: 'Item 2', isPinned: true },
|
||||||
|
];
|
||||||
|
expect(vm.pinnedModules).toEqual(
|
||||||
|
new Map([['Item 2', { name: 'Item 2', isPinned: true }]]),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should find matches in routes', () => {
|
||||||
|
const search = 'child1';
|
||||||
|
const item = {
|
||||||
|
children: [
|
||||||
|
{ name: 'child1', children: [] },
|
||||||
|
{ name: 'child2', children: [] },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
const matches = vm.findMatches(search, item);
|
||||||
|
expect(matches).toEqual([{ name: 'child1', children: [] }]);
|
||||||
|
});
|
||||||
|
it('should not proceed if event is already prevented', async () => {
|
||||||
|
const item = { module: 'testModule', isPinned: false };
|
||||||
|
const event = {
|
||||||
|
preventDefault: vi.fn(),
|
||||||
|
stopPropagation: vi.fn(),
|
||||||
|
defaultPrevented: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
await vm.togglePinned(item, event);
|
||||||
|
|
||||||
|
expect(event.preventDefault).not.toHaveBeenCalled();
|
||||||
|
expect(event.stopPropagation).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call quasar.notify with success message', async () => {
|
||||||
|
const item = { module: 'testModule', isPinned: false };
|
||||||
|
const event = {
|
||||||
|
preventDefault: vi.fn(),
|
||||||
|
stopPropagation: vi.fn(),
|
||||||
|
defaultPrevented: false,
|
||||||
|
};
|
||||||
|
const response = { data: { id: 1 } };
|
||||||
|
|
||||||
|
vi.spyOn(axios, 'post').mockResolvedValue(response);
|
||||||
|
vi.spyOn(vm.quasar, 'notify');
|
||||||
|
|
||||||
|
await vm.togglePinned(item, event);
|
||||||
|
|
||||||
|
expect(vm.quasar.notify).toHaveBeenCalledWith({
|
||||||
|
message: 'Data saved',
|
||||||
|
type: 'positive',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle a single matched route with a menu', () => {
|
||||||
|
const route = {
|
||||||
|
matched: [{ meta: { menu: 'customer' } }],
|
||||||
|
};
|
||||||
|
|
||||||
|
const result = vm.betaGetRoutes();
|
||||||
|
|
||||||
|
expect(result.meta.menu).toEqual(route.matched[0].meta.menu);
|
||||||
|
});
|
||||||
|
it('should get routes for main source', () => {
|
||||||
|
vm.props.source = 'main';
|
||||||
|
vm.getRoutes();
|
||||||
|
expect(navigation.getModules).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should find direct child matches', () => {
|
||||||
|
const search = 'child1';
|
||||||
|
const item = {
|
||||||
|
children: [{ name: 'child1' }, { name: 'child2' }],
|
||||||
|
};
|
||||||
|
const result = vm.findMatches(search, item);
|
||||||
|
expect(result).toEqual([{ name: 'child1' }]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should find nested child matches', () => {
|
||||||
|
const search = 'child3';
|
||||||
|
const item = {
|
||||||
|
children: [
|
||||||
|
{ name: 'child1' },
|
||||||
|
{
|
||||||
|
name: 'child2',
|
||||||
|
children: [{ name: 'child3' }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
const result = vm.findMatches(search, item);
|
||||||
|
expect(result).toEqual([{ name: 'child3' }]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('normalize', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
vm = mount('card').vm;
|
||||||
|
});
|
||||||
|
it('should normalize and lowercase text', () => {
|
||||||
|
const input = 'ÁÉÍÓÚáéíóú';
|
||||||
|
const expected = 'aeiouaeiou';
|
||||||
|
expect(vm.normalize(input)).toBe(expected);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle empty string', () => {
|
||||||
|
const input = '';
|
||||||
|
const expected = '';
|
||||||
|
expect(vm.normalize(input)).toBe(expected);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle text without diacritics', () => {
|
||||||
|
const input = 'hello';
|
||||||
|
const expected = 'hello';
|
||||||
|
expect(vm.normalize(input)).toBe(expected);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle mixed text', () => {
|
||||||
|
const input = 'Héllo Wórld!';
|
||||||
|
const expected = 'hello world!';
|
||||||
|
expect(vm.normalize(input)).toBe(expected);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('addChildren', () => {
|
||||||
|
const module = 'testModule';
|
||||||
|
beforeEach(() => {
|
||||||
|
vm = mount().vm;
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should add menu items to parent if matches are found', () => {
|
||||||
|
const parent = 'testParent';
|
||||||
|
const route = {
|
||||||
|
meta: {
|
||||||
|
menu: 'testMenu',
|
||||||
|
},
|
||||||
|
children: [{ name: 'child1' }, { name: 'child2' }],
|
||||||
|
};
|
||||||
|
vm.addChildren(module, route, parent);
|
||||||
|
|
||||||
|
expect(navigation.addMenuItem).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle routes with no meta menu', () => {
|
||||||
|
const route = {
|
||||||
|
meta: {},
|
||||||
|
menus: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
const parent = [];
|
||||||
|
|
||||||
|
vm.addChildren(module, route, parent);
|
||||||
|
expect(navigation.addMenuItem).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle empty parent array', () => {
|
||||||
|
const parent = [];
|
||||||
|
const route = {
|
||||||
|
meta: {
|
||||||
|
menu: 'child11',
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'child1',
|
||||||
|
meta: {
|
||||||
|
menuChildren: [
|
||||||
|
{
|
||||||
|
name: 'CustomerCreditContracts',
|
||||||
|
title: 'creditContracts',
|
||||||
|
icon: 'vn:solunion',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
vm.addChildren(module, route, parent);
|
||||||
|
expect(navigation.addMenuItem).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
import { vi, describe, expect, it, beforeEach, beforeAll, afterEach } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import UserPanel from 'src/components/UserPanel.vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
|
||||||
|
describe('UserPanel', () => {
|
||||||
|
let wrapper;
|
||||||
|
let vm;
|
||||||
|
let state;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
wrapper = createWrapper(UserPanel, {});
|
||||||
|
state = useState();
|
||||||
|
state.setUser({
|
||||||
|
id: 115,
|
||||||
|
name: 'itmanagement',
|
||||||
|
nickname: 'itManagementNick',
|
||||||
|
lang: 'en',
|
||||||
|
darkMode: false,
|
||||||
|
companyFk: 442,
|
||||||
|
warehouseFk: 1,
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fetch warehouses data on mounted', async () => {
|
||||||
|
const fetchData = wrapper.findComponent({ name: 'FetchData' });
|
||||||
|
expect(fetchData.props('url')).toBe('Warehouses');
|
||||||
|
expect(fetchData.props('autoLoad')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should toggle dark mode correctly and update preferences', async () => {
|
||||||
|
await vm.saveDarkMode(true);
|
||||||
|
expect(axios.patch).toHaveBeenCalledWith('/UserConfigs/115', { darkMode: true });
|
||||||
|
expect(vm.user.darkMode).toBe(true);
|
||||||
|
vm.updatePreferences();
|
||||||
|
expect(vm.darkMode).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should change user language and update preferences', async () => {
|
||||||
|
const userLanguage = 'es';
|
||||||
|
await vm.saveLanguage(userLanguage);
|
||||||
|
expect(axios.patch).toHaveBeenCalledWith('/VnUsers/115', { lang: userLanguage });
|
||||||
|
expect(vm.user.lang).toBe(userLanguage);
|
||||||
|
vm.updatePreferences();
|
||||||
|
expect(vm.locale).toBe(userLanguage);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should update user data', async () => {
|
||||||
|
const key = 'name';
|
||||||
|
const value = 'itboss';
|
||||||
|
await vm.saveUserData(key, value);
|
||||||
|
expect(axios.post).toHaveBeenCalledWith('UserConfigs/setUserConfig', { [key]: value });
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,53 @@
|
||||||
|
<script setup>
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import { useHasContent } from 'src/composables/useHasContent';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const stateStore = useStateStore();
|
||||||
|
const hasContent = useHasContent('#advanced-menu');
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
isMainSection: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => $props.isMainSection,
|
||||||
|
(val) => {
|
||||||
|
if (stateStore) stateStore.rightAdvancedDrawer = val;
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<Teleport to="#searchbar-after" v-if="stateStore.isHeaderMounted()">
|
||||||
|
<QBtn
|
||||||
|
v-if="hasContent || $slots['advanced-menu']"
|
||||||
|
flat
|
||||||
|
@click="stateStore.toggleRightAdvancedDrawer()"
|
||||||
|
round
|
||||||
|
icon="tune"
|
||||||
|
color="white"
|
||||||
|
>
|
||||||
|
<QTooltip bottom anchor="bottom right">
|
||||||
|
{{ t('globals.advancedMenu') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</Teleport>
|
||||||
|
<QDrawer
|
||||||
|
v-model="stateStore.rightAdvancedDrawer"
|
||||||
|
side="right"
|
||||||
|
:width="256"
|
||||||
|
:overlay="!isMainSection"
|
||||||
|
v-bind="$attrs"
|
||||||
|
>
|
||||||
|
<QScrollArea class="fit">
|
||||||
|
<div id="advanced-menu"></div>
|
||||||
|
<slot v-if="!hasContent" name="advanced-menu" />
|
||||||
|
</QScrollArea>
|
||||||
|
</QDrawer>
|
||||||
|
</template>
|
|
@ -17,7 +17,7 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Teleport to="#actions-append" v-if="stateStore.isHeaderMounted()">
|
<Teleport to="#actions-prepend" v-if="stateStore.isHeaderMounted()">
|
||||||
<div class="row q-gutter-x-sm">
|
<div class="row q-gutter-x-sm">
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="hasContent || $slots['right-panel']"
|
v-if="hasContent || $slots['right-panel']"
|
||||||
|
@ -26,6 +26,7 @@ onMounted(() => {
|
||||||
round
|
round
|
||||||
dense
|
dense
|
||||||
icon="dock_to_left"
|
icon="dock_to_left"
|
||||||
|
data-cy="toggle-right-drawer"
|
||||||
>
|
>
|
||||||
<QTooltip bottom anchor="bottom right">
|
<QTooltip bottom anchor="bottom right">
|
||||||
{{ t('globals.collapseMenu') }}
|
{{ t('globals.collapseMenu') }}
|
||||||
|
|
|
@ -10,11 +10,11 @@ import LeftMenu from 'components/LeftMenu.vue';
|
||||||
import RightMenu from 'components/common/RightMenu.vue';
|
import RightMenu from 'components/common/RightMenu.vue';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dataKey: { type: String, required: true },
|
dataKey: { type: String, required: true },
|
||||||
baseUrl: { type: String, default: undefined },
|
url: { type: String, default: undefined },
|
||||||
customUrl: { type: String, default: undefined },
|
|
||||||
filter: { type: Object, default: () => {} },
|
filter: { type: Object, default: () => {} },
|
||||||
descriptor: { type: Object, required: true },
|
descriptor: { type: Object, required: true },
|
||||||
filterPanel: { type: Object, default: undefined },
|
filterPanel: { type: Object, default: undefined },
|
||||||
|
idInWhere: { type: Boolean, default: false },
|
||||||
searchDataKey: { type: String, default: undefined },
|
searchDataKey: { type: String, default: undefined },
|
||||||
searchbarProps: { type: Object, default: undefined },
|
searchbarProps: { type: Object, default: undefined },
|
||||||
redirectOnError: { type: Boolean, default: false },
|
redirectOnError: { type: Boolean, default: false },
|
||||||
|
@ -23,25 +23,20 @@ const props = defineProps({
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const url = computed(() => {
|
|
||||||
if (props.baseUrl) {
|
|
||||||
return `${props.baseUrl}/${route.params.id}`;
|
|
||||||
}
|
|
||||||
return props.customUrl;
|
|
||||||
});
|
|
||||||
const searchRightDataKey = computed(() => {
|
const searchRightDataKey = computed(() => {
|
||||||
if (!props.searchDataKey) return route.name;
|
if (!props.searchDataKey) return route.name;
|
||||||
return props.searchDataKey;
|
return props.searchDataKey;
|
||||||
});
|
});
|
||||||
|
|
||||||
const arrayData = useArrayData(props.dataKey, {
|
const arrayData = useArrayData(props.dataKey, {
|
||||||
url: url.value,
|
url: props.url,
|
||||||
filter: props.filter,
|
userFilter: props.filter,
|
||||||
|
oneRecord: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
try {
|
try {
|
||||||
if (!props.baseUrl) arrayData.store.filter.where = { id: route.params.id };
|
await fetch(route.params.id);
|
||||||
await arrayData.fetch({ append: false, updateRouter: false });
|
|
||||||
} catch {
|
} catch {
|
||||||
const { matched: matches } = router.currentRoute.value;
|
const { matched: matches } = router.currentRoute.value;
|
||||||
const { path } = matches.at(-1);
|
const { path } = matches.at(-1);
|
||||||
|
@ -49,13 +44,17 @@ onBeforeMount(async () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (props.baseUrl) {
|
onBeforeRouteUpdate(async (to, from) => {
|
||||||
onBeforeRouteUpdate(async (to, from) => {
|
const id = to.params.id;
|
||||||
if (to.params.id !== from.params.id) {
|
if (id !== from.params.id) await fetch(id, true);
|
||||||
arrayData.store.url = `${props.baseUrl}/${to.params.id}`;
|
});
|
||||||
await arrayData.fetch({ append: false, updateRouter: false });
|
|
||||||
}
|
async function fetch(id, append = false) {
|
||||||
});
|
const regex = /\/(\d+)/;
|
||||||
|
if (props.idInWhere) arrayData.store.filter.where = { id };
|
||||||
|
else if (!regex.test(props.url)) arrayData.store.url = `${props.url}/${id}`;
|
||||||
|
else arrayData.store.url = props.url.replace(regex, `/${id}`);
|
||||||
|
await arrayData.fetch({ append, updateRouter: false });
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
@ -83,7 +82,7 @@ if (props.baseUrl) {
|
||||||
<QPage>
|
<QPage>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
<div :class="[useCardSize(), $attrs.class]">
|
<div :class="[useCardSize(), $attrs.class]">
|
||||||
<RouterView :key="route.path" />
|
<RouterView :key="$route.path" />
|
||||||
</div>
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onBeforeMount, computed } from 'vue';
|
import { onBeforeMount } from 'vue';
|
||||||
import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router';
|
import { useRouter, onBeforeRouteUpdate } from 'vue-router';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import useCardSize from 'src/composables/useCardSize';
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
@ -9,8 +9,8 @@ import VnSubToolbar from '../ui/VnSubToolbar.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dataKey: { type: String, required: true },
|
dataKey: { type: String, required: true },
|
||||||
baseUrl: { type: String, default: undefined },
|
url: { type: String, default: undefined },
|
||||||
customUrl: { type: String, default: undefined },
|
idInWhere: { type: Boolean, default: false },
|
||||||
filter: { type: Object, default: () => {} },
|
filter: { type: Object, default: () => {} },
|
||||||
descriptor: { type: Object, required: true },
|
descriptor: { type: Object, required: true },
|
||||||
filterPanel: { type: Object, default: undefined },
|
filterPanel: { type: Object, default: undefined },
|
||||||
|
@ -20,38 +20,35 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const url = computed(() => {
|
|
||||||
if (props.baseUrl) {
|
|
||||||
return `${props.baseUrl}/${route.params.id}`;
|
|
||||||
}
|
|
||||||
return props.customUrl;
|
|
||||||
});
|
|
||||||
|
|
||||||
const arrayData = useArrayData(props.dataKey, {
|
const arrayData = useArrayData(props.dataKey, {
|
||||||
url: url.value,
|
url: props.url,
|
||||||
filter: props.filter,
|
userFilter: props.filter,
|
||||||
|
oneRecord: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
|
const route = router.currentRoute.value;
|
||||||
try {
|
try {
|
||||||
if (!props.baseUrl) arrayData.store.filter.where = { id: route.params.id };
|
await fetch(route.params.id);
|
||||||
await arrayData.fetch({ append: false, updateRouter: false });
|
|
||||||
} catch {
|
} catch {
|
||||||
const { matched: matches } = router.currentRoute.value;
|
const { matched: matches } = route;
|
||||||
const { path } = matches.at(-1);
|
const { path } = matches.at(-1);
|
||||||
router.push({ path: path.replace(/:id.*/, '') });
|
router.push({ path: path.replace(/:id.*/, '') });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (props.baseUrl) {
|
onBeforeRouteUpdate(async (to, from) => {
|
||||||
onBeforeRouteUpdate(async (to, from) => {
|
const id = to.params.id;
|
||||||
if (to.params.id !== from.params.id) {
|
if (id !== from.params.id) await fetch(id, true);
|
||||||
arrayData.store.url = `${props.baseUrl}/${to.params.id}`;
|
});
|
||||||
await arrayData.fetch({ append: false, updateRouter: false });
|
|
||||||
}
|
async function fetch(id, append = false) {
|
||||||
});
|
const regex = /\/(\d+)/;
|
||||||
|
if (props.idInWhere) arrayData.store.filter.where = { id };
|
||||||
|
else if (!regex.test(props.url)) arrayData.store.url = `${props.url}/${id}`;
|
||||||
|
else arrayData.store.url = props.url.replace(regex, `/${id}`);
|
||||||
|
await arrayData.fetch({ append, updateRouter: false });
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
@ -62,6 +59,6 @@ if (props.baseUrl) {
|
||||||
</Teleport>
|
</Teleport>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
<div :class="[useCardSize(), $attrs.class]">
|
<div :class="[useCardSize(), $attrs.class]">
|
||||||
<RouterView :key="route.path" />
|
<RouterView :key="$route.path" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { useSession } from 'src/composables/useSession';
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const rows = ref();
|
const rows = ref([]);
|
||||||
const dmsRef = ref();
|
const dmsRef = ref();
|
||||||
const formDialog = ref({});
|
const formDialog = ref({});
|
||||||
const token = useSession().getTokenMultimedia();
|
const token = useSession().getTokenMultimedia();
|
||||||
|
@ -102,7 +102,7 @@ const columns = computed(() => [
|
||||||
storage: 'dms',
|
storage: 'dms',
|
||||||
collection: null,
|
collection: null,
|
||||||
resolution: null,
|
resolution: null,
|
||||||
id: prop.row.file.split('.')[0],
|
id: Number(prop.row.file.split('.')[0]),
|
||||||
token: token,
|
token: token,
|
||||||
class: 'rounded',
|
class: 'rounded',
|
||||||
ratio: 1,
|
ratio: 1,
|
||||||
|
@ -202,7 +202,7 @@ const columns = computed(() => [
|
||||||
prop.row.id,
|
prop.row.id,
|
||||||
$props.downloadModel,
|
$props.downloadModel,
|
||||||
undefined,
|
undefined,
|
||||||
prop.row.download
|
prop.row.download,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -299,11 +299,12 @@ defineExpose({
|
||||||
:url="$props.model"
|
:url="$props.model"
|
||||||
:user-filter="dmsFilter"
|
:user-filter="dmsFilter"
|
||||||
:order="['dmsFk DESC']"
|
:order="['dmsFk DESC']"
|
||||||
:auto-load="true"
|
auto-load
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
>
|
>
|
||||||
<template #body>
|
<template #body>
|
||||||
<QTable
|
<QTable
|
||||||
|
v-if="rows"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
|
@ -373,7 +374,7 @@ defineExpose({
|
||||||
v-if="
|
v-if="
|
||||||
shouldRenderButton(
|
shouldRenderButton(
|
||||||
button.name,
|
button.name,
|
||||||
props.row.isDocuware
|
props.row.isDocuware,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
:is="button.component"
|
:is="button.component"
|
||||||
|
@ -388,6 +389,14 @@ defineExpose({
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
<div
|
||||||
|
v-else
|
||||||
|
class="info-row q-pa-md text-center"
|
||||||
|
>
|
||||||
|
<h5>
|
||||||
|
{{ t('No data to display') }}
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
<QDialog v-model="formDialog.show">
|
<QDialog v-model="formDialog.show">
|
||||||
|
@ -404,7 +413,7 @@ defineExpose({
|
||||||
fab
|
fab
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="add"
|
icon="add"
|
||||||
shortcut="+"
|
v-shortcut
|
||||||
@click="showFormDialog()"
|
@click="showFormDialog()"
|
||||||
class="fill-icon"
|
class="fill-icon"
|
||||||
>
|
>
|
||||||
|
|
|
@ -75,6 +75,7 @@ const focus = () => {
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
focus,
|
focus,
|
||||||
|
vnInputRef,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mixinRules = [
|
const mixinRules = [
|
||||||
|
@ -174,7 +175,11 @@ const handleUppercase = () => {
|
||||||
v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase"
|
v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase"
|
||||||
@click="handleUppercase"
|
@click="handleUppercase"
|
||||||
class="uppercase-icon"
|
class="uppercase-icon"
|
||||||
/>
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('Convert to uppercase') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
|
||||||
<slot name="append" v-if="$slots.append && !$attrs.disabled" />
|
<slot name="append" v-if="$slots.append && !$attrs.disabled" />
|
||||||
<QIcon v-if="info" name="info">
|
<QIcon v-if="info" name="info">
|
||||||
|
@ -187,13 +192,26 @@ const handleUppercase = () => {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.uppercase-icon {
|
||||||
|
transition: color 0.3s, transform 0.2s;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uppercase-icon:hover {
|
||||||
|
color: #ed9937;
|
||||||
|
transform: scale(1.2);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
inputMin: Must be more than {value}
|
inputMin: Must be more than {value}
|
||||||
maxLength: The value exceeds {value} characters
|
maxLength: The value exceeds {value} characters
|
||||||
inputMax: Must be less than {value}
|
inputMax: Must be less than {value}
|
||||||
|
|
||||||
es:
|
es:
|
||||||
inputMin: Debe ser mayor a {value}
|
inputMin: Debe ser mayor a {value}
|
||||||
maxLength: El valor excede los {value} carácteres
|
maxLength: El valor excede los {value} carácteres
|
||||||
inputMax: Debe ser menor a {value}
|
inputMax: Debe ser menor a {value}
|
||||||
|
Convert to uppercase: Convertir a mayúsculas
|
||||||
</i18n>
|
</i18n>
|
|
@ -105,6 +105,7 @@ const manageDate = (date) => {
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
@click="isPopupOpen = !isPopupOpen"
|
@click="isPopupOpen = !isPopupOpen"
|
||||||
|
@keydown="isPopupOpen = false"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
|
|
|
@ -79,6 +79,7 @@ function dateToTime(newDate) {
|
||||||
style="min-width: 100px"
|
style="min-width: 100px"
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
@click="isPopupOpen = !isPopupOpen"
|
@click="isPopupOpen = !isPopupOpen"
|
||||||
|
@keydown="isPopupOpen = false"
|
||||||
type="time"
|
type="time"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
>
|
>
|
||||||
|
|
|
@ -15,6 +15,7 @@ import FetchData from '../FetchData.vue';
|
||||||
import VnSelect from './VnSelect.vue';
|
import VnSelect from './VnSelect.vue';
|
||||||
import VnUserLink from '../ui/VnUserLink.vue';
|
import VnUserLink from '../ui/VnUserLink.vue';
|
||||||
import VnPaginate from '../ui/VnPaginate.vue';
|
import VnPaginate from '../ui/VnPaginate.vue';
|
||||||
|
import RightMenu from './RightMenu.vue';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const validationsStore = useValidator();
|
const validationsStore = useValidator();
|
||||||
|
@ -130,7 +131,7 @@ const actionsIcon = {
|
||||||
};
|
};
|
||||||
const validDate = new RegExp(
|
const validDate = new RegExp(
|
||||||
/^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])/.source +
|
/^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])/.source +
|
||||||
/T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/.source
|
/T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/.source,
|
||||||
);
|
);
|
||||||
|
|
||||||
function castJsonValue(value) {
|
function castJsonValue(value) {
|
||||||
|
@ -192,7 +193,7 @@ function getLogTree(data) {
|
||||||
user: log.user,
|
user: log.user,
|
||||||
userFk: log.userFk,
|
userFk: log.userFk,
|
||||||
logs: [],
|
logs: [],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Model
|
// Model
|
||||||
|
@ -210,7 +211,7 @@ function getLogTree(data) {
|
||||||
id: log.changedModelId,
|
id: log.changedModelId,
|
||||||
showValue: log.changedModelValue,
|
showValue: log.changedModelValue,
|
||||||
logs: [],
|
logs: [],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
nLogs = 0;
|
nLogs = 0;
|
||||||
}
|
}
|
||||||
|
@ -267,7 +268,7 @@ async function applyFilter() {
|
||||||
filter.where.and.push(selectedFilters.value);
|
filter.where.and.push(selectedFilters.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
paginate.value.fetch(filter);
|
paginate.value.fetch({ filter });
|
||||||
}
|
}
|
||||||
|
|
||||||
function setDate(type) {
|
function setDate(type) {
|
||||||
|
@ -282,7 +283,7 @@ function setDate(type) {
|
||||||
to = date.adjustDate(
|
to = date.adjustDate(
|
||||||
to,
|
to,
|
||||||
{ hour: 21, minute: 59, second: 59, millisecond: 999 },
|
{ hour: 21, minute: 59, second: 59, millisecond: 999 },
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -365,7 +366,7 @@ async function clearFilter() {
|
||||||
dateTo.value = undefined;
|
dateTo.value = undefined;
|
||||||
userRadio.value = undefined;
|
userRadio.value = undefined;
|
||||||
Object.keys(checkboxOptions.value).forEach(
|
Object.keys(checkboxOptions.value).forEach(
|
||||||
(opt) => (checkboxOptions.value[opt].selected = false)
|
(opt) => (checkboxOptions.value[opt].selected = false),
|
||||||
);
|
);
|
||||||
await applyFilter();
|
await applyFilter();
|
||||||
}
|
}
|
||||||
|
@ -378,7 +379,7 @@ watch(
|
||||||
() => router.currentRoute.value.params.id,
|
() => router.currentRoute.value.params.id,
|
||||||
() => {
|
() => {
|
||||||
applyFilter();
|
applyFilter();
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
@ -391,7 +392,7 @@ watch(
|
||||||
const changedModel = item.changedModel;
|
const changedModel = item.changedModel;
|
||||||
return {
|
return {
|
||||||
locale: useCapitalize(
|
locale: useCapitalize(
|
||||||
validations[changedModel]?.locale?.name ?? changedModel
|
validations[changedModel]?.locale?.name ?? changedModel,
|
||||||
),
|
),
|
||||||
value: changedModel,
|
value: changedModel,
|
||||||
};
|
};
|
||||||
|
@ -403,7 +404,7 @@ watch(
|
||||||
ref="paginate"
|
ref="paginate"
|
||||||
:data-key="`${model}Log`"
|
:data-key="`${model}Log`"
|
||||||
:url="`${model}Logs`"
|
:url="`${model}Logs`"
|
||||||
:filter="filter"
|
:user-filter="filter"
|
||||||
:skeleton="false"
|
:skeleton="false"
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="setLogTree"
|
@on-fetch="setLogTree"
|
||||||
|
@ -507,7 +508,7 @@ watch(
|
||||||
:title="
|
:title="
|
||||||
date.formatDate(
|
date.formatDate(
|
||||||
log.creationDate,
|
log.creationDate,
|
||||||
'DD/MM/YYYY hh:mm:ss'
|
'DD/MM/YYYY hh:mm:ss',
|
||||||
) ?? `date:'dd/MM/yyyy HH:mm:ss'`
|
) ?? `date:'dd/MM/yyyy HH:mm:ss'`
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -577,7 +578,7 @@ watch(
|
||||||
t(
|
t(
|
||||||
`actions.${
|
`actions.${
|
||||||
actionsText[log.action]
|
actionsText[log.action]
|
||||||
}`
|
}`,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
@ -677,7 +678,8 @@ watch(
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
<QList dense>
|
<QList dense>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
<QItem class="q-mt-sm">
|
<QItem class="q-mt-sm">
|
||||||
|
@ -732,14 +734,17 @@ watch(
|
||||||
v-model="userSelect"
|
v-model="userSelect"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
:url="`${model}Logs/${$route.params.id}/editors`"
|
:url="`${model}Logs/${route.params.id}/editors`"
|
||||||
:fields="['id', 'nickname', 'name', 'image']"
|
:fields="['id', 'nickname', 'name', 'image']"
|
||||||
sort-by="nickname"
|
sort-by="nickname"
|
||||||
@update:model-value="selectFilter('userSelect')"
|
@update:model-value="selectFilter('userSelect')"
|
||||||
hide-selected
|
hide-selected
|
||||||
>
|
>
|
||||||
<template #option="{ opt, itemProps }">
|
<template #option="{ opt, itemProps }">
|
||||||
<QItem v-bind="itemProps" class="q-pa-xs row items-center">
|
<QItem
|
||||||
|
v-bind="itemProps"
|
||||||
|
class="q-pa-xs row items-center"
|
||||||
|
>
|
||||||
<QItemSection class="col-3 items-center">
|
<QItemSection class="col-3 items-center">
|
||||||
<VnAvatar :worker-id="opt.id" />
|
<VnAvatar :worker-id="opt.id" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -799,7 +804,7 @@ watch(
|
||||||
<QItem class="q-mt-sm">
|
<QItem class="q-mt-sm">
|
||||||
<QInput
|
<QInput
|
||||||
class="full-width"
|
class="full-width"
|
||||||
:label="t('to')"
|
:label="t('globals.to')"
|
||||||
@click="dateToDialog = true"
|
@click="dateToDialog = true"
|
||||||
@focus="(evt) => evt.target.blur()"
|
@focus="(evt) => evt.target.blur()"
|
||||||
@clear="selectFilter('date', 'from')"
|
@clear="selectFilter('date', 'from')"
|
||||||
|
@ -809,7 +814,8 @@ watch(
|
||||||
/>
|
/>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QList>
|
</QList>
|
||||||
</Teleport>
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<QDialog v-model="dateFromDialog">
|
<QDialog v-model="dateFromDialog">
|
||||||
<QDate
|
<QDate
|
||||||
:years-in-month-view="false"
|
:years-in-month-view="false"
|
||||||
|
@ -1053,9 +1059,9 @@ en:
|
||||||
Deletes: Deletes
|
Deletes: Deletes
|
||||||
Accesses: Accesses
|
Accesses: Accesses
|
||||||
Users:
|
Users:
|
||||||
User: Usuario
|
User: User
|
||||||
All: Todo
|
All: All
|
||||||
System: Sistema
|
System: System
|
||||||
properties:
|
properties:
|
||||||
id: ID
|
id: ID
|
||||||
claimFk: Claim ID
|
claimFk: Claim ID
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import RightMenu from './RightMenu.vue';
|
import RightAdvancedMenu from './RightAdvancedMenu.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import VnTableFilter from '../VnTable/VnTableFilter.vue';
|
import VnTableFilter from '../VnTable/VnTableFilter.vue';
|
||||||
import { onBeforeMount, computed, ref } from 'vue';
|
import { onBeforeMount, onMounted, onUnmounted, computed, ref } from 'vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useHasContent } from 'src/composables/useHasContent';
|
import { useHasContent } from 'src/composables/useHasContent';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -47,16 +47,14 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
let arrayData;
|
let arrayData;
|
||||||
const sectionValue = computed(() => $props.section ?? $props.dataKey);
|
const sectionValue = computed(() => $props.section ?? $props.dataKey);
|
||||||
const isMainSection = computed(() => {
|
const isMainSection = ref(false);
|
||||||
const isSame = sectionValue.value == route.name;
|
|
||||||
if (!isSame && arrayData) {
|
|
||||||
arrayData.reset(['userParams', 'userFilter']);
|
|
||||||
}
|
|
||||||
return isSame;
|
|
||||||
});
|
|
||||||
const searchbarId = 'section-searchbar';
|
const searchbarId = 'section-searchbar';
|
||||||
|
const advancedMenuSlot = 'advanced-menu';
|
||||||
const hasContent = useHasContent(`#${searchbarId}`);
|
const hasContent = useHasContent(`#${searchbarId}`);
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
|
@ -67,7 +65,27 @@ onBeforeMount(() => {
|
||||||
...$props.arrayDataProps,
|
...$props.arrayDataProps,
|
||||||
navigate: $props.redirect,
|
navigate: $props.redirect,
|
||||||
});
|
});
|
||||||
|
checkIsMain();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
const unsubscribe = router.afterEach(() => {
|
||||||
|
checkIsMain();
|
||||||
|
});
|
||||||
|
onUnmounted(unsubscribe);
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
if (arrayData) arrayData.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
|
function checkIsMain() {
|
||||||
|
isMainSection.value = sectionValue.value == route.name;
|
||||||
|
if (!isMainSection.value && arrayData) {
|
||||||
|
arrayData.reset(['userParams', 'filter']);
|
||||||
|
arrayData.setCurrentFilter();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<slot name="searchbar">
|
<slot name="searchbar">
|
||||||
|
@ -80,18 +98,25 @@ onBeforeMount(() => {
|
||||||
/>
|
/>
|
||||||
<div :id="searchbarId"></div>
|
<div :id="searchbarId"></div>
|
||||||
</slot>
|
</slot>
|
||||||
<RightMenu>
|
<RightAdvancedMenu :is-main-section="isMainSection">
|
||||||
<template #right-panel v-if="$slots['rightMenu'] || rightFilter">
|
<template #advanced-menu v-if="$slots[advancedMenuSlot] || rightFilter">
|
||||||
<slot name="rightMenu">
|
<slot :name="advancedMenuSlot">
|
||||||
<VnTableFilter
|
<VnTableFilter
|
||||||
v-if="rightFilter && columns"
|
v-if="rightFilter && columns"
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:array-data="arrayData"
|
:array-data="arrayData"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
>
|
||||||
|
<template #moreFilterPanel="{ params, orders, searchFn }">
|
||||||
|
<slot
|
||||||
|
name="moreFilterPanel"
|
||||||
|
v-bind="{ params, orders, searchFn }"
|
||||||
/>
|
/>
|
||||||
|
</template>
|
||||||
|
</VnTableFilter>
|
||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightAdvancedMenu>
|
||||||
<slot name="body" v-if="isMainSection" />
|
<slot name="body" v-if="isMainSection" />
|
||||||
<RouterView v-else />
|
<RouterView v-else />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -27,7 +27,7 @@ const $props = defineProps({
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
optionLabel: {
|
optionLabel: {
|
||||||
type: [String],
|
type: [String, Function],
|
||||||
default: 'name',
|
default: 'name',
|
||||||
},
|
},
|
||||||
optionValue: {
|
optionValue: {
|
||||||
|
@ -171,7 +171,8 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const arrayDataKey =
|
const arrayDataKey =
|
||||||
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
|
$props.dataKey ??
|
||||||
|
($props.url?.length > 0 ? $props.url : ($attrs.name ?? $attrs.label));
|
||||||
|
|
||||||
const arrayData = useArrayData(arrayDataKey, {
|
const arrayData = useArrayData(arrayDataKey, {
|
||||||
url: $props.url,
|
url: $props.url,
|
||||||
|
@ -220,7 +221,7 @@ async function fetchFilter(val) {
|
||||||
optionFilterValue.value ??
|
optionFilterValue.value ??
|
||||||
(new RegExp(/\d/g).test(val)
|
(new RegExp(/\d/g).test(val)
|
||||||
? optionValue.value
|
? optionValue.value
|
||||||
: optionFilter.value ?? optionLabel.value);
|
: (optionFilter.value ?? optionLabel.value));
|
||||||
|
|
||||||
let defaultWhere = {};
|
let defaultWhere = {};
|
||||||
if ($props.filterOptions.length) {
|
if ($props.filterOptions.length) {
|
||||||
|
@ -232,12 +233,15 @@ async function fetchFilter(val) {
|
||||||
} else defaultWhere = { [key]: getVal(val) };
|
} else defaultWhere = { [key]: getVal(val) };
|
||||||
const where = { ...(val ? defaultWhere : {}), ...$props.where };
|
const where = { ...(val ? defaultWhere : {}), ...$props.where };
|
||||||
$props.exprBuilder && Object.assign(where, $props.exprBuilder(key, val));
|
$props.exprBuilder && Object.assign(where, $props.exprBuilder(key, val));
|
||||||
const fetchOptions = { where, include, limit };
|
const filterOptions = { where, include, limit };
|
||||||
if (fields) fetchOptions.fields = fields;
|
if (fields) filterOptions.fields = fields;
|
||||||
if (sortBy) fetchOptions.order = sortBy;
|
if (sortBy) filterOptions.order = sortBy;
|
||||||
arrayData.resetPagination();
|
arrayData.resetPagination();
|
||||||
|
|
||||||
const { data } = await arrayData.applyFilter({ filter: fetchOptions });
|
const { data } = await arrayData.applyFilter(
|
||||||
|
{ filter: filterOptions },
|
||||||
|
{ updateRouter: false },
|
||||||
|
);
|
||||||
setOptions(data);
|
setOptions(data);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -269,7 +273,7 @@ async function filterHandler(val, update) {
|
||||||
ref.setOptionIndex(-1);
|
ref.setOptionIndex(-1);
|
||||||
ref.moveOptionSelection(1, true);
|
ref.moveOptionSelection(1, true);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,7 +298,7 @@ async function onScroll({ to, direction, from, index }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ opts: myOptions });
|
defineExpose({ opts: myOptions, vnSelectRef });
|
||||||
|
|
||||||
function handleKeyDown(event) {
|
function handleKeyDown(event) {
|
||||||
if (event.key === 'Tab' && !event.shiftKey) {
|
if (event.key === 'Tab' && !event.shiftKey) {
|
||||||
|
@ -305,7 +309,7 @@ function handleKeyDown(event) {
|
||||||
if (inputValue) {
|
if (inputValue) {
|
||||||
const matchingOption = myOptions.value.find(
|
const matchingOption = myOptions.value.find(
|
||||||
(option) =>
|
(option) =>
|
||||||
option[optionLabel.value].toLowerCase() === inputValue.toLowerCase()
|
option[optionLabel.value].toLowerCase() === inputValue.toLowerCase(),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (matchingOption) {
|
if (matchingOption) {
|
||||||
|
@ -317,11 +321,11 @@ function handleKeyDown(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const focusableElements = document.querySelectorAll(
|
const focusableElements = document.querySelectorAll(
|
||||||
'a:not([disabled]), button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), details:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])'
|
'a:not([disabled]), button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), details:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])',
|
||||||
);
|
);
|
||||||
const currentIndex = Array.prototype.indexOf.call(
|
const currentIndex = Array.prototype.indexOf.call(
|
||||||
focusableElements,
|
focusableElements,
|
||||||
event.target
|
event.target,
|
||||||
);
|
);
|
||||||
if (currentIndex >= 0 && currentIndex < focusableElements.length - 1) {
|
if (currentIndex >= 0 && currentIndex < focusableElements.length - 1) {
|
||||||
focusableElements[currentIndex + 1].focus();
|
focusableElements[currentIndex + 1].focus();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useRole } from 'src/composables/useRole';
|
import { useRole } from 'src/composables/useRole';
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
const value = defineModel({ type: [String, Number, Object] });
|
const value = defineModel({ type: [String, Number, Object] });
|
||||||
|
const select = ref(null);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
rolesAllowedToCreate: {
|
rolesAllowedToCreate: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -33,10 +34,13 @@ const isAllowedToCreate = computed(() => {
|
||||||
if ($props.acls.length) return acl.hasAny($props.acls);
|
if ($props.acls.length) return acl.hasAny($props.acls);
|
||||||
return role.hasAny($props.rolesAllowedToCreate);
|
return role.hasAny($props.rolesAllowedToCreate);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({ vnSelectDialogRef: select });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
ref="select"
|
||||||
v-model="value"
|
v-model="value"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@update:model-value="(...args) => emit('update:modelValue', ...args)"
|
@update:model-value="(...args) => emit('update:modelValue', ...args)"
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<script setup>
|
||||||
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
|
||||||
|
const model = defineModel({ type: [String, Number, Object] });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VnSelect
|
||||||
|
:label="$t('globals.supplier')"
|
||||||
|
v-bind="$attrs"
|
||||||
|
v-model="model"
|
||||||
|
url="Suppliers"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nickname"
|
||||||
|
:fields="['id', 'name', 'nickname', 'nif']"
|
||||||
|
:filter-options="['id', 'name', 'nickname', 'nif']"
|
||||||
|
sort-by="name ASC"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt?.name }}
|
||||||
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{
|
||||||
|
`#${scope.opt?.id} , ${scope.opt?.nickname} (${scope.opt?.nif})`
|
||||||
|
}}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</template>
|
|
@ -9,9 +9,9 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
hasInfo: {
|
info: {
|
||||||
type: Boolean,
|
type: String,
|
||||||
default: false,
|
default: undefined,
|
||||||
},
|
},
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: [String, Number, Object],
|
type: [String, Number, Object],
|
||||||
|
@ -53,13 +53,14 @@ const url = computed(() => {
|
||||||
:fields="['id', 'name', 'nickname', 'code']"
|
:fields="['id', 'name', 'nickname', 'code']"
|
||||||
:filter-options="['id', 'name', 'nickname', 'code']"
|
:filter-options="['id', 'name', 'nickname', 'code']"
|
||||||
sort-by="nickname ASC"
|
sort-by="nickname ASC"
|
||||||
|
data-cy="vnWorkerSelect"
|
||||||
>
|
>
|
||||||
<template #prepend v-if="$props.hasAvatar">
|
<template #prepend v-if="$props.hasAvatar">
|
||||||
<VnAvatar :worker-id="value" color="primary" :title="title" />
|
<VnAvatar :worker-id="value" color="primary" v-bind="$attrs" />
|
||||||
</template>
|
</template>
|
||||||
<template #append v-if="$props.hasInfo">
|
<template #append v-if="$props.info">
|
||||||
<QIcon name="info" class="cursor-pointer">
|
<QIcon name="info" class="cursor-pointer">
|
||||||
<QTooltip>{{ $t($props.hasInfo) }}</QTooltip>
|
<QTooltip>{{ $t($props.info) }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</template>
|
</template>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
|
@ -72,7 +73,8 @@ const url = computed(() => {
|
||||||
{{ scope.opt.nickname }}
|
{{ scope.opt.nickname }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
<QItemLabel caption v-else>
|
<QItemLabel caption v-else>
|
||||||
#{{ scope.opt.id }}, {{ scope.opt.nickname }}, {{ scope.opt.code }}
|
#{{ scope.opt.id }}, {{ scope.opt.nickname }},
|
||||||
|
{{ scope.opt.code }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -10,6 +10,10 @@ defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
width: {
|
||||||
|
type: String,
|
||||||
|
default: 'md-width',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
defineEmits([...useDialogPluginComponent.emits]);
|
defineEmits([...useDialogPluginComponent.emits]);
|
||||||
|
@ -17,7 +21,19 @@ defineEmits([...useDialogPluginComponent.emits]);
|
||||||
const { dialogRef, onDialogHide } = useDialogPluginComponent();
|
const { dialogRef, onDialogHide } = useDialogPluginComponent();
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QDialog ref="dialogRef" @hide="onDialogHide" full-width>
|
<QDialog ref="dialogRef" @hide="onDialogHide">
|
||||||
<component :is="summary" :id="id" />
|
<component :is="summary" :id="id" :class="width" />
|
||||||
</QDialog>
|
</QDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.md-width {
|
||||||
|
max-width: $width-md;
|
||||||
|
}
|
||||||
|
.lg-width {
|
||||||
|
max-width: $width-lg;
|
||||||
|
}
|
||||||
|
.xlg-width {
|
||||||
|
max-width: $width-xl;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -0,0 +1,146 @@
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import { vi, afterEach, beforeEach, beforeAll, describe, expect, it } from 'vitest';
|
||||||
|
import VnDms from 'src/components/common/VnDms.vue';
|
||||||
|
|
||||||
|
class MockFormData {
|
||||||
|
constructor() {
|
||||||
|
this.entries = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
append(key, value) {
|
||||||
|
if (!key) {
|
||||||
|
throw new Error('Key is required for FormData.append');
|
||||||
|
}
|
||||||
|
this.entries[key] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get(key) {
|
||||||
|
return this.entries[key] || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
getAll() {
|
||||||
|
return this.entries;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
global.FormData = MockFormData;
|
||||||
|
|
||||||
|
describe('VnDms', () => {
|
||||||
|
let wrapper;
|
||||||
|
let vm;
|
||||||
|
let postMock;
|
||||||
|
|
||||||
|
const postResponseMock = { data: { success: true } };
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
hasFile: true,
|
||||||
|
hasFileAttached: true,
|
||||||
|
reference: 'DMS-test',
|
||||||
|
warehouseFk: 1,
|
||||||
|
companyFk: 2,
|
||||||
|
dmsTypeFk: 3,
|
||||||
|
description: 'This is a test description',
|
||||||
|
files: { name: 'example.txt', content: new Blob(['file content'], { type: 'text/plain' })},
|
||||||
|
};
|
||||||
|
|
||||||
|
const expectedBody = {
|
||||||
|
hasFile: true,
|
||||||
|
hasFileAttached: true,
|
||||||
|
reference: 'DMS-test',
|
||||||
|
warehouseId: 1,
|
||||||
|
companyId: 2,
|
||||||
|
dmsTypeId: 3,
|
||||||
|
description: 'This is a test description',
|
||||||
|
};
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
wrapper = createWrapper(VnDms, {
|
||||||
|
propsData: {
|
||||||
|
url: '/test',
|
||||||
|
formInitialData: { id: 1, reference: 'test' },
|
||||||
|
model: 'Worker',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
vi.spyOn(vm, '$emit');
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
postMock = vi.spyOn(axios, 'post').mockResolvedValue(postResponseMock);
|
||||||
|
vm.dms = data;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('mapperDms', () => {
|
||||||
|
it('should map DMS data correctly and add file to FormData', () => {
|
||||||
|
const [formData, params] = vm.mapperDms(data);
|
||||||
|
|
||||||
|
expect(formData.get('example.txt')).toBe(data.files);
|
||||||
|
expect(expectedBody).toEqual(params.params);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should map DMS data correctly without file', () => {
|
||||||
|
delete data.files;
|
||||||
|
|
||||||
|
const [formData, params] = vm.mapperDms(data);
|
||||||
|
|
||||||
|
expect(formData.getAll()).toEqual({});
|
||||||
|
expect(expectedBody).toEqual(params.params);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getUrl', () => {
|
||||||
|
it('should returns prop url when is set', async () => {
|
||||||
|
expect(vm.getUrl()).toBe('/test');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should returns url dms/"props.formInitialData.id"/updateFile when prop url is null', async () => {
|
||||||
|
await wrapper.setProps({ url: null });
|
||||||
|
expect(vm.getUrl()).toBe('dms/1/updateFile');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should returns url "props.model"/"route.params.id"/uploadFile when formInitialData is null', async () => {
|
||||||
|
await wrapper.setProps({ formInitialData: null });
|
||||||
|
vm.route.params.id = '123';
|
||||||
|
expect(vm.getUrl()).toBe('Worker/123/uploadFile');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('save', () => {
|
||||||
|
it('should save data correctly', async () => {
|
||||||
|
await vm.save();
|
||||||
|
expect(postMock).toHaveBeenCalledWith(vm.getUrl(), expect.any(FormData), { params: expectedBody });
|
||||||
|
expect(wrapper.emitted('onDataSaved')).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('defaultData', () => {
|
||||||
|
it('should set dms with formInitialData', async () => {
|
||||||
|
const testData = {
|
||||||
|
hasFile: false,
|
||||||
|
hasFileAttached: false,
|
||||||
|
reference: 'defaultData-test',
|
||||||
|
warehouseFk: 2,
|
||||||
|
companyFk: 3,
|
||||||
|
dmsTypeFk: 2,
|
||||||
|
description: 'This is a test description'
|
||||||
|
}
|
||||||
|
await wrapper.setProps({ formInitialData: testData });
|
||||||
|
vm.defaultData();
|
||||||
|
|
||||||
|
expect(vm.dms).toEqual(testData);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should add reference with "route.params.id" to dms if formInitialData is null', async () => {
|
||||||
|
await wrapper.setProps({ formInitialData: null });
|
||||||
|
vm.route.params.id= '111';
|
||||||
|
vm.defaultData();
|
||||||
|
|
||||||
|
expect(vm.dms.reference).toBe('111');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,91 @@
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import { vi, describe, expect, it } from 'vitest';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
|
|
||||||
|
describe('VnInput', () => {
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
let input;
|
||||||
|
|
||||||
|
function generateWrapper(value, isOutlined, emptyToNull, insertable) {
|
||||||
|
wrapper = createWrapper(VnInput, {
|
||||||
|
props: {
|
||||||
|
modelValue: value,
|
||||||
|
isOutlined, emptyToNull, insertable,
|
||||||
|
maxlength: 101
|
||||||
|
},
|
||||||
|
attrs: {
|
||||||
|
label: 'test',
|
||||||
|
required: true,
|
||||||
|
maxlength: 101,
|
||||||
|
maxLength: 10,
|
||||||
|
'max-length':20
|
||||||
|
},
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
input = wrapper.find('[data-cy="test_input"]');
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('value', () => {
|
||||||
|
it('should emit update:modelValue when value changes', async () => {
|
||||||
|
generateWrapper('12345', false, false, true)
|
||||||
|
await input.setValue('123');
|
||||||
|
expect(wrapper.emitted('update:modelValue')).toBeTruthy();
|
||||||
|
expect(wrapper.emitted('update:modelValue')[0]).toEqual(['123']);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should emit update:modelValue with null when input is empty', async () => {
|
||||||
|
generateWrapper('12345', false, true, true);
|
||||||
|
await input.setValue('');
|
||||||
|
expect(wrapper.emitted('update:modelValue')[0]).toEqual([null]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('styleAttrs', () => {
|
||||||
|
it('should return empty styleAttrs when isOutlined is false', async () => {
|
||||||
|
generateWrapper('123', false, false, false);
|
||||||
|
expect(vm.styleAttrs).toEqual({});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set styleAttrs when isOutlined is true', async () => {
|
||||||
|
generateWrapper('123', true, false, false);
|
||||||
|
expect(vm.styleAttrs.outlined).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('handleKeydown', () => {
|
||||||
|
it('should do nothing when "Backspace" key is pressed', async () => {
|
||||||
|
generateWrapper('12345', false, false, true);
|
||||||
|
await input.trigger('keydown', { key: 'Backspace' });
|
||||||
|
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
||||||
|
const spyhandler = vi.spyOn(vm, 'handleInsertMode');
|
||||||
|
expect(spyhandler).not.toHaveBeenCalled();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
TODO: #8399 REDMINE
|
||||||
|
*/
|
||||||
|
it.skip('handleKeydown respects insertable behavior', async () => {
|
||||||
|
const expectedValue = '12345';
|
||||||
|
generateWrapper('1234', false, false, true);
|
||||||
|
vm.focus()
|
||||||
|
await input.trigger('keydown', { key: '5' });
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(wrapper.emitted('update:modelValue')).toBeTruthy();
|
||||||
|
expect(wrapper.emitted('update:modelValue')[0]).toEqual([expectedValue ]);
|
||||||
|
expect(vm.value).toBe( expectedValue);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('focus', () => {
|
||||||
|
it('should call focus method when input is focused', async () => {
|
||||||
|
generateWrapper('123', false, false, true);
|
||||||
|
const focusSpy = vi.spyOn(input.element, 'focus');
|
||||||
|
vm.focus();
|
||||||
|
expect(focusSpy).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,51 +1,78 @@
|
||||||
import { describe, it, expect, vi, beforeAll, afterEach, beforeEach } from 'vitest';
|
import {
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
vi,
|
||||||
|
beforeAll,
|
||||||
|
afterEach,
|
||||||
|
beforeEach,
|
||||||
|
afterAll,
|
||||||
|
} from 'vitest';
|
||||||
import { createWrapper, axios } from 'app/test/vitest/helper';
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
import VnNotes from 'src/components/ui/VnNotes.vue';
|
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
|
import vnDate from 'src/boot/vnDate';
|
||||||
|
|
||||||
describe('VnNotes', () => {
|
describe('VnNotes', () => {
|
||||||
let vm;
|
let vm;
|
||||||
let wrapper;
|
let wrapper;
|
||||||
let spyFetch;
|
let spyFetch;
|
||||||
let postMock;
|
let postMock;
|
||||||
let expectedBody;
|
let patchMock;
|
||||||
const mockData= {name: 'Tony', lastName: 'Stark', text: 'Test Note', observationTypeFk: 1};
|
let expectedInsertBody;
|
||||||
|
let expectedUpdateBody;
|
||||||
function generateExpectedBody() {
|
const defaultOptions = {
|
||||||
expectedBody = {...vm.$props.body, ...{ text: vm.newNote.text, observationTypeFk: vm.newNote.observationTypeFk }};
|
|
||||||
}
|
|
||||||
|
|
||||||
async function setTestParams(text, observationType, type){
|
|
||||||
vm.newNote.text = text;
|
|
||||||
vm.newNote.observationTypeFk = observationType;
|
|
||||||
wrapper.setProps({ selectType: type });
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
|
||||||
vi.spyOn(axios, 'get').mockReturnValue({ data: [] });
|
|
||||||
|
|
||||||
wrapper = createWrapper(VnNotes, {
|
|
||||||
propsData: {
|
|
||||||
url: '/test',
|
url: '/test',
|
||||||
body: { name: 'Tony', lastName: 'Stark' },
|
body: { name: 'Tony', lastName: 'Stark' },
|
||||||
}
|
selectType: false,
|
||||||
|
saveUrl: null,
|
||||||
|
justInput: false,
|
||||||
|
};
|
||||||
|
function generateWrapper(
|
||||||
|
options = defaultOptions,
|
||||||
|
text = null,
|
||||||
|
observationType = null,
|
||||||
|
) {
|
||||||
|
vi.spyOn(axios, 'get').mockResolvedValue({ data: [] });
|
||||||
|
wrapper = createWrapper(VnNotes, {
|
||||||
|
propsData: options,
|
||||||
});
|
});
|
||||||
wrapper = wrapper.wrapper;
|
wrapper = wrapper.wrapper;
|
||||||
vm = wrapper.vm;
|
vm = wrapper.vm;
|
||||||
});
|
vm.newNote.text = text;
|
||||||
|
vm.newNote.observationTypeFk = observationType;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createSpyFetch() {
|
||||||
|
spyFetch = vi.spyOn(vm.$refs.vnPaginateRef, 'fetch');
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateExpectedBody() {
|
||||||
|
expectedInsertBody = {
|
||||||
|
...vm.$props.body,
|
||||||
|
...{ text: vm.newNote.text, observationTypeFk: vm.newNote.observationTypeFk },
|
||||||
|
};
|
||||||
|
expectedUpdateBody = { ...vm.$props.body, ...{ notes: vm.newNote.text } };
|
||||||
|
}
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
postMock = vi.spyOn(axios, 'post').mockResolvedValue(mockData);
|
postMock = vi.spyOn(axios, 'post');
|
||||||
spyFetch = vi.spyOn(vm.vnPaginateRef, 'fetch').mockImplementation(() => vi.fn());
|
patchMock = vi.spyOn(axios, 'patch');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
vi.clearAllMocks();
|
vi.clearAllMocks();
|
||||||
expectedBody = {};
|
expectedInsertBody = {};
|
||||||
|
expectedUpdateBody = {};
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(() => {
|
||||||
|
vi.restoreAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('insert', () => {
|
describe('insert', () => {
|
||||||
it('should not call axios.post and vnPaginateRef.fetch if newNote.text is null', async () => {
|
it('should not call axios.post and vnPaginateRef.fetch when newNote.text is null', async () => {
|
||||||
await setTestParams( null, null, true );
|
generateWrapper({ selectType: true });
|
||||||
|
createSpyFetch();
|
||||||
|
|
||||||
await vm.insert();
|
await vm.insert();
|
||||||
|
|
||||||
|
@ -53,8 +80,9 @@ describe('VnNotes', () => {
|
||||||
expect(spyFetch).not.toHaveBeenCalled();
|
expect(spyFetch).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not call axios.post and vnPaginateRef.fetch if newNote.text is empty', async () => {
|
it('should not call axios.post and vnPaginateRef.fetch when newNote.text is empty', async () => {
|
||||||
await setTestParams( "", null, false );
|
generateWrapper(null, '');
|
||||||
|
createSpyFetch();
|
||||||
|
|
||||||
await vm.insert();
|
await vm.insert();
|
||||||
|
|
||||||
|
@ -62,8 +90,9 @@ describe('VnNotes', () => {
|
||||||
expect(spyFetch).not.toHaveBeenCalled();
|
expect(spyFetch).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not call axios.post and vnPaginateRef.fetch if observationTypeFk is missing and selectType is true', async () => {
|
it('should not call axios.post and vnPaginateRef.fetch when observationTypeFk is null and selectType is true', async () => {
|
||||||
await setTestParams( "Test Note", null, true );
|
generateWrapper({ selectType: true }, 'Test Note');
|
||||||
|
createSpyFetch();
|
||||||
|
|
||||||
await vm.insert();
|
await vm.insert();
|
||||||
|
|
||||||
|
@ -71,37 +100,57 @@ describe('VnNotes', () => {
|
||||||
expect(spyFetch).not.toHaveBeenCalled();
|
expect(spyFetch).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should call axios.post and vnPaginateRef.fetch if observationTypeFk is missing and selectType is false', async () => {
|
it('should call axios.post and vnPaginateRef.fetch when observationTypeFk is missing and selectType is false', async () => {
|
||||||
await setTestParams( "Test Note", null, false );
|
generateWrapper(null, 'Test Note');
|
||||||
|
createSpyFetch();
|
||||||
generateExpectedBody();
|
generateExpectedBody();
|
||||||
|
|
||||||
await vm.insert();
|
await vm.insert();
|
||||||
|
|
||||||
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
|
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedInsertBody);
|
||||||
expect(spyFetch).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should call axios.post and vnPaginateRef.fetch if observationTypeFk is setted and selectType is false', async () => {
|
|
||||||
await setTestParams( "Test Note", 1, false );
|
|
||||||
|
|
||||||
generateExpectedBody();
|
|
||||||
|
|
||||||
await vm.insert();
|
|
||||||
|
|
||||||
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
|
|
||||||
expect(spyFetch).toHaveBeenCalled();
|
expect(spyFetch).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should call axios.post and vnPaginateRef.fetch when newNote is valid', async () => {
|
it('should call axios.post and vnPaginateRef.fetch when newNote is valid', async () => {
|
||||||
await setTestParams( "Test Note", 1, true );
|
generateWrapper({ selectType: true }, 'Test Note', 1);
|
||||||
|
createSpyFetch();
|
||||||
generateExpectedBody();
|
generateExpectedBody();
|
||||||
|
|
||||||
await vm.insert();
|
await vm.insert();
|
||||||
|
|
||||||
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
|
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedInsertBody);
|
||||||
expect(spyFetch).toHaveBeenCalled();
|
expect(spyFetch).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('update', () => {
|
||||||
|
it('should call axios.patch with saveUrl when saveUrl is set and justInput is true', async () => {
|
||||||
|
generateWrapper({
|
||||||
|
url: '/business',
|
||||||
|
justInput: true,
|
||||||
|
saveUrl: '/saveUrlTest',
|
||||||
|
});
|
||||||
|
generateExpectedBody();
|
||||||
|
|
||||||
|
await vm.update();
|
||||||
|
|
||||||
|
expect(patchMock).toHaveBeenCalledWith(vm.$props.saveUrl, expectedUpdateBody);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call axios.patch with url when saveUrl is not set and justInput is true', async () => {
|
||||||
|
generateWrapper({
|
||||||
|
url: '/business',
|
||||||
|
body: { workerFk: 1110 },
|
||||||
|
justInput: true,
|
||||||
|
});
|
||||||
|
generateExpectedBody();
|
||||||
|
|
||||||
|
await vm.update();
|
||||||
|
|
||||||
|
expect(patchMock).toHaveBeenCalledWith(
|
||||||
|
`${vm.$props.url}/${vm.$props.body.workerFk}`,
|
||||||
|
expectedUpdateBody,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
|
@ -37,6 +37,10 @@ const $props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
width: {
|
||||||
|
type: String,
|
||||||
|
default: 'md-width',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
|
@ -55,10 +59,11 @@ onBeforeMount(async () => {
|
||||||
url: $props.url,
|
url: $props.url,
|
||||||
filter: $props.filter,
|
filter: $props.filter,
|
||||||
skip: 0,
|
skip: 0,
|
||||||
|
oneRecord: true,
|
||||||
});
|
});
|
||||||
store = arrayData.store;
|
store = arrayData.store;
|
||||||
entity = computed(() => {
|
entity = computed(() => {
|
||||||
const data = (Array.isArray(store.data) ? store.data[0] : store.data) ?? {};
|
const data = store.data ?? {};
|
||||||
if (data) emit('onFetch', data);
|
if (data) emit('onFetch', data);
|
||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
|
@ -69,7 +74,7 @@ onBeforeMount(async () => {
|
||||||
() => [$props.url, $props.filter],
|
() => [$props.url, $props.filter],
|
||||||
async () => {
|
async () => {
|
||||||
if (!isSameDataKey.value) await getData();
|
if (!isSameDataKey.value) await getData();
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -80,7 +85,7 @@ async function getData() {
|
||||||
try {
|
try {
|
||||||
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
||||||
state.set($props.dataKey, data);
|
state.set($props.dataKey, data);
|
||||||
emit('onFetch', Array.isArray(data) ? data[0] : data);
|
emit('onFetch', data);
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
|
@ -104,7 +109,7 @@ const iconModule = computed(() => route.matched[1].meta.icon);
|
||||||
const toModule = computed(() =>
|
const toModule = computed(() =>
|
||||||
route.matched[1].path.split('/').length > 2
|
route.matched[1].path.split('/').length > 2
|
||||||
? route.matched[1].redirect
|
? route.matched[1].redirect
|
||||||
: route.matched[1].children[0].redirect
|
: route.matched[1].children[0].redirect,
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -128,9 +133,8 @@ const toModule = computed(() =>
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn></slot
|
</QBtn></slot
|
||||||
>
|
>
|
||||||
|
|
||||||
<QBtn
|
<QBtn
|
||||||
@click.stop="viewSummary(entity.id, $props.summary)"
|
@click.stop="viewSummary(entity.id, $props.summary, $props.width)"
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
|
|
|
@ -15,6 +15,10 @@ const props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
userFilter: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
entityId: {
|
entityId: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: null,
|
default: null,
|
||||||
|
@ -34,10 +38,12 @@ const isSummary = ref();
|
||||||
const arrayData = useArrayData(props.dataKey, {
|
const arrayData = useArrayData(props.dataKey, {
|
||||||
url: props.url,
|
url: props.url,
|
||||||
filter: props.filter,
|
filter: props.filter,
|
||||||
|
userFilter: props.userFilter,
|
||||||
skip: 0,
|
skip: 0,
|
||||||
|
oneRecord: true,
|
||||||
});
|
});
|
||||||
const { store } = arrayData;
|
const { store } = arrayData;
|
||||||
const entity = computed(() => (Array.isArray(store.data) ? store.data[0] : store.data));
|
const entity = computed(() => store.data);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
@ -56,7 +62,7 @@ async function fetch() {
|
||||||
store.filter = props.filter ?? {};
|
store.filter = props.filter ?? {};
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
||||||
emit('onFetch', Array.isArray(data) ? data[0] : data);
|
emit('onFetch', data);
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -175,7 +181,7 @@ async function fetch() {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.header.link:hover {
|
.header.link:hover {
|
||||||
color: lighten($primary, 20%);
|
color: rgba(var(--q-primary), 0.8);
|
||||||
}
|
}
|
||||||
.q-checkbox {
|
.q-checkbox {
|
||||||
& .q-checkbox__label {
|
& .q-checkbox__label {
|
||||||
|
@ -203,4 +209,13 @@ async function fetch() {
|
||||||
.summaryHeader {
|
.summaryHeader {
|
||||||
color: $white;
|
color: $white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cardSummary :deep(.q-card__section[content]) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding: 0;
|
||||||
|
> * {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -41,7 +41,7 @@ const card = toRef(props, 'item');
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<span class="link">
|
<span class="link" @click.stop>
|
||||||
{{ card.name }}
|
{{ card.name }}
|
||||||
<ItemDescriptorProxy :id="card.id" />
|
<ItemDescriptorProxy :id="card.id" />
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.sass';
|
import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.scss';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
bordered: {
|
bordered: {
|
||||||
|
|
|
@ -114,7 +114,7 @@ async function clearFilters() {
|
||||||
arrayData.resetPagination();
|
arrayData.resetPagination();
|
||||||
// Filtrar los params no removibles
|
// Filtrar los params no removibles
|
||||||
const removableFilters = Object.keys(userParams.value).filter((param) =>
|
const removableFilters = Object.keys(userParams.value).filter((param) =>
|
||||||
$props.unremovableParams.includes(param)
|
$props.unremovableParams.includes(param),
|
||||||
);
|
);
|
||||||
const newParams = {};
|
const newParams = {};
|
||||||
// Conservar solo los params que no son removibles
|
// Conservar solo los params que no son removibles
|
||||||
|
@ -162,13 +162,13 @@ const formatTags = (tags) => {
|
||||||
|
|
||||||
const tags = computed(() => {
|
const tags = computed(() => {
|
||||||
const filteredTags = tagsList.value.filter(
|
const filteredTags = tagsList.value.filter(
|
||||||
(tag) => !($props.customTags || []).includes(tag.label)
|
(tag) => !($props.customTags || []).includes(tag.label),
|
||||||
);
|
);
|
||||||
return formatTags(filteredTags);
|
return formatTags(filteredTags);
|
||||||
});
|
});
|
||||||
|
|
||||||
const customTags = computed(() =>
|
const customTags = computed(() =>
|
||||||
tagsList.value.filter((tag) => ($props.customTags || []).includes(tag.label))
|
tagsList.value.filter((tag) => ($props.customTags || []).includes(tag.label)),
|
||||||
);
|
);
|
||||||
|
|
||||||
async function remove(key) {
|
async function remove(key) {
|
||||||
|
@ -188,9 +188,15 @@ function formatValue(value) {
|
||||||
const getLocale = (label) => {
|
const getLocale = (label) => {
|
||||||
const param = label.split('.').at(-1);
|
const param = label.split('.').at(-1);
|
||||||
const globalLocale = `globals.params.${param}`;
|
const globalLocale = `globals.params.${param}`;
|
||||||
|
const moduleName = route.meta.moduleName;
|
||||||
|
const moduleLocale = `${moduleName.toLowerCase()}.${param}`;
|
||||||
if (te(globalLocale)) return t(globalLocale);
|
if (te(globalLocale)) return t(globalLocale);
|
||||||
else if (te(t(`params.${param}`)));
|
else if (te(moduleLocale)) return t(moduleLocale);
|
||||||
else return t(`${route.meta.moduleName.toLowerCase()}.params.${param}`);
|
else {
|
||||||
|
const camelCaseModuleName =
|
||||||
|
moduleName.charAt(0).toLowerCase() + moduleName.slice(1);
|
||||||
|
return t(`${camelCaseModuleName}.params.${param}`);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { ref, reactive } from 'vue';
|
import { ref, reactive, useAttrs, computed } from 'vue';
|
||||||
import { onBeforeRouteLeave } from 'vue-router';
|
import { onBeforeRouteLeave } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
@ -16,12 +16,22 @@ import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
|
||||||
|
const emit = defineEmits(['onFetch']);
|
||||||
|
|
||||||
|
const $attrs = useAttrs();
|
||||||
|
|
||||||
|
const isRequired = computed(() => {
|
||||||
|
return Object.keys($attrs).includes('required')
|
||||||
|
});
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
url: { type: String, default: null },
|
url: { type: String, default: null },
|
||||||
|
saveUrl: {type: String, default: null},
|
||||||
filter: { type: Object, default: () => {} },
|
filter: { type: Object, default: () => {} },
|
||||||
body: { type: Object, default: () => {} },
|
body: { type: Object, default: () => {} },
|
||||||
addNote: { type: Boolean, default: false },
|
addNote: { type: Boolean, default: false },
|
||||||
selectType: { type: Boolean, default: false },
|
selectType: { type: Boolean, default: false },
|
||||||
|
justInput: { type: Boolean, default: false },
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -29,6 +39,13 @@ const quasar = useQuasar();
|
||||||
const newNote = reactive({ text: null, observationTypeFk: null });
|
const newNote = reactive({ text: null, observationTypeFk: null });
|
||||||
const observationTypes = ref([]);
|
const observationTypes = ref([]);
|
||||||
const vnPaginateRef = ref();
|
const vnPaginateRef = ref();
|
||||||
|
let originalText;
|
||||||
|
|
||||||
|
function handleClick(e) {
|
||||||
|
if (e.shiftKey && e.key === 'Enter') return;
|
||||||
|
if ($props.justInput) confirmAndUpdate();
|
||||||
|
else insert();
|
||||||
|
}
|
||||||
|
|
||||||
async function insert() {
|
async function insert() {
|
||||||
if (!newNote.text || ($props.selectType && !newNote.observationTypeFk)) return;
|
if (!newNote.text || ($props.selectType && !newNote.observationTypeFk)) return;
|
||||||
|
@ -41,8 +58,36 @@ async function insert() {
|
||||||
await axios.post($props.url, newBody);
|
await axios.post($props.url, newBody);
|
||||||
await vnPaginateRef.value.fetch();
|
await vnPaginateRef.value.fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function confirmAndUpdate() {
|
||||||
|
if(!newNote.text && originalText)
|
||||||
|
quasar
|
||||||
|
.dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
title: t('New note is empty'),
|
||||||
|
message: t('Are you sure remove this note?'),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.onOk(update)
|
||||||
|
.onCancel(() => {
|
||||||
|
newNote.text = originalText;
|
||||||
|
});
|
||||||
|
else update();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function update() {
|
||||||
|
originalText = newNote.text;
|
||||||
|
const body = $props.body;
|
||||||
|
const newBody = {
|
||||||
|
...body,
|
||||||
|
...{ notes: newNote.text },
|
||||||
|
};
|
||||||
|
await axios.patch(`${$props.saveUrl ?? `${$props.url}/${$props.body.workerFk}`}`, newBody);
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeRouteLeave((to, from, next) => {
|
onBeforeRouteLeave((to, from, next) => {
|
||||||
if (newNote.text)
|
if ((newNote.text && !$props.justInput) || (newNote.text !== originalText) && $props.justInput)
|
||||||
quasar.dialog({
|
quasar.dialog({
|
||||||
component: VnConfirm,
|
component: VnConfirm,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
@ -53,6 +98,13 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
});
|
});
|
||||||
else next();
|
else next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function fetchData([ data ]) {
|
||||||
|
newNote.text = data?.notes;
|
||||||
|
originalText = data?.notes;
|
||||||
|
emit('onFetch', data);
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -62,8 +114,19 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="(data) => (observationTypes = data)"
|
@on-fetch="(data) => (observationTypes = data)"
|
||||||
/>
|
/>
|
||||||
<QCard class="q-pa-xs q-mb-lg full-width" v-if="$props.addNote">
|
<FetchData
|
||||||
<QCardSection horizontal>
|
v-if="justInput"
|
||||||
|
:url="url"
|
||||||
|
:filter="filter"
|
||||||
|
@on-fetch="fetchData"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<QCard
|
||||||
|
class="q-pa-xs q-mb-lg full-width"
|
||||||
|
:class="{ 'just-input': $props.justInput }"
|
||||||
|
v-if="$props.addNote || $props.justInput"
|
||||||
|
>
|
||||||
|
<QCardSection horizontal v-if="!$props.justInput">
|
||||||
{{ t('New note') }}
|
{{ t('New note') }}
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="q-px-xs q-my-none q-py-none">
|
<QCardSection class="q-px-xs q-my-none q-py-none">
|
||||||
|
@ -75,19 +138,19 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
v-model="newNote.observationTypeFk"
|
v-model="newNote.observationTypeFk"
|
||||||
option-label="description"
|
option-label="description"
|
||||||
style="flex: 0.15"
|
style="flex: 0.15"
|
||||||
:required="true"
|
:required="isRequired"
|
||||||
@keyup.enter.stop="insert"
|
@keyup.enter.stop="insert"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model.trim="newNote.text"
|
v-model.trim="newNote.text"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:label="t('Add note here...')"
|
:label="$props.justInput && newNote.text ? '' : t('Add note here...')"
|
||||||
filled
|
filled
|
||||||
size="lg"
|
size="lg"
|
||||||
autogrow
|
autogrow
|
||||||
@keyup.enter.stop="insert"
|
@keyup.enter.stop="handleClick"
|
||||||
|
:required="isRequired"
|
||||||
clearable
|
clearable
|
||||||
:required="true"
|
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -95,7 +158,7 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
icon="save"
|
icon="save"
|
||||||
color="primary"
|
color="primary"
|
||||||
flat
|
flat
|
||||||
@click="insert"
|
@click="handleClick"
|
||||||
class="q-mb-xs"
|
class="q-mb-xs"
|
||||||
dense
|
dense
|
||||||
data-cy="saveNote"
|
data-cy="saveNote"
|
||||||
|
@ -106,6 +169,7 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
|
v-if="!$props.justInput"
|
||||||
:data-key="$props.url"
|
:data-key="$props.url"
|
||||||
:url="$props.url"
|
:url="$props.url"
|
||||||
order="created DESC"
|
order="created DESC"
|
||||||
|
@ -198,6 +262,11 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.just-input {
|
||||||
|
padding-right: 18px;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
|
@ -205,4 +274,6 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
New note: Nueva nota
|
New note: Nueva nota
|
||||||
Save (Enter): Guardar (Intro)
|
Save (Enter): Guardar (Intro)
|
||||||
Observation type: Tipo de observación
|
Observation type: Tipo de observación
|
||||||
|
New note is empty: La nueva nota esta vacia
|
||||||
|
Are you sure remove this note?: Estas seguro de quitar esta nota?
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -78,6 +78,10 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
keyData: {
|
||||||
|
type: String,
|
||||||
|
default: undefined,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['onFetch', 'onPaginate', 'onChange']);
|
const emit = defineEmits(['onFetch', 'onPaginate', 'onChange']);
|
||||||
|
@ -119,7 +123,7 @@ watch(
|
||||||
() => props.data,
|
() => props.data,
|
||||||
() => {
|
() => {
|
||||||
store.data = props.data;
|
store.data = props.data;
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
@ -128,12 +132,12 @@ watch(
|
||||||
if (!mounted.value) return;
|
if (!mounted.value) return;
|
||||||
emit('onChange', data);
|
emit('onChange', data);
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => [props.url, props.filter],
|
() => [props.url, props.filter],
|
||||||
([url, filter]) => mounted.value && fetch({ url, filter })
|
([url, filter]) => mounted.value && fetch({ url, filter }),
|
||||||
);
|
);
|
||||||
const addFilter = async (filter, params) => {
|
const addFilter = async (filter, params) => {
|
||||||
await arrayData.addFilter({ filter, params });
|
await arrayData.addFilter({ filter, params });
|
||||||
|
@ -166,7 +170,7 @@ function emitStoreData() {
|
||||||
async function paginate() {
|
async function paginate() {
|
||||||
const { page, rowsPerPage, sortBy, descending } = pagination.value;
|
const { page, rowsPerPage, sortBy, descending } = pagination.value;
|
||||||
|
|
||||||
if (!props.url) return;
|
if (!arrayData.store.url) return;
|
||||||
|
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
await arrayData.loadMore();
|
await arrayData.loadMore();
|
||||||
|
@ -194,7 +198,7 @@ function endPagination() {
|
||||||
async function onLoad(index, done) {
|
async function onLoad(index, done) {
|
||||||
if (!store.data || !mounted.value) return done();
|
if (!store.data || !mounted.value) return done();
|
||||||
|
|
||||||
if (store.data.length === 0 || !props.url) return done(false);
|
if (store.data.length === 0 || !arrayData.store.url) return done(false);
|
||||||
|
|
||||||
pagination.value.page = pagination.value.page + 1;
|
pagination.value.page = pagination.value.page + 1;
|
||||||
|
|
||||||
|
@ -255,7 +259,7 @@ defineExpose({
|
||||||
:disable="disableInfiniteScroll || !store.hasMoreData"
|
:disable="disableInfiniteScroll || !store.hasMoreData"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
>
|
>
|
||||||
<slot name="body" :rows="store.data"></slot>
|
<slot name="body" :rows="keyData ? store.data[keyData] : store.data"></slot>
|
||||||
<div v-if="isLoading" class="spinner info-row q-pa-md text-center">
|
<div v-if="isLoading" class="spinner info-row q-pa-md text-center">
|
||||||
<QSpinner color="primary" size="md" />
|
<QSpinner color="primary" size="md" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -102,7 +102,7 @@ watch(
|
||||||
(val) => {
|
(val) => {
|
||||||
arrayData = useArrayData(val, { ...props });
|
arrayData = useArrayData(val, { ...props });
|
||||||
store = arrayData.store;
|
store = arrayData.store;
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -113,23 +113,20 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function search() {
|
async function search() {
|
||||||
const staticParams = Object.keys(store.userParams ?? {}).length
|
|
||||||
? store.userParams
|
|
||||||
: store.defaultParams;
|
|
||||||
arrayData.resetPagination();
|
arrayData.resetPagination();
|
||||||
|
|
||||||
const filter = {
|
let filter = { params: { search: searchText.value } };
|
||||||
params: {
|
|
||||||
search: searchText.value,
|
|
||||||
},
|
|
||||||
filter: props.filter,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!props.searchRemoveParams || !searchText.value) {
|
if (!props.searchRemoveParams || !searchText.value) {
|
||||||
filter.params = {
|
filter = {
|
||||||
...staticParams,
|
params: {
|
||||||
|
...store.userParams,
|
||||||
search: searchText.value,
|
search: searchText.value,
|
||||||
|
},
|
||||||
|
filter: store.filter,
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
arrayData.reset(['currentFilter', 'userParams']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.whereFilter) {
|
if (props.whereFilter) {
|
||||||
|
@ -179,6 +176,7 @@ async function search() {
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t(props.info) }}</QTooltip>
|
<QTooltip>{{ t(props.info) }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
|
<div id="searchbar-after"></div>
|
||||||
</template>
|
</template>
|
||||||
</VnInput>
|
</VnInput>
|
||||||
</QForm>
|
</QForm>
|
||||||
|
|
|
@ -49,7 +49,7 @@ function formatNumber(number) {
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
:data-key="$props.url"
|
:data-key="$props.url"
|
||||||
:url="$props.url"
|
:url="$props.url"
|
||||||
:filter="filter"
|
:user-filter="filter"
|
||||||
order="smsFk DESC"
|
order="smsFk DESC"
|
||||||
:offset="100"
|
:offset="100"
|
||||||
:limit="5"
|
:limit="5"
|
||||||
|
|
|
@ -19,23 +19,26 @@ onMounted(() => {
|
||||||
const observer = new MutationObserver(
|
const observer = new MutationObserver(
|
||||||
() =>
|
() =>
|
||||||
(hasContent.value =
|
(hasContent.value =
|
||||||
actions.value?.childNodes?.length + data.value?.childNodes?.length)
|
actions.value?.childNodes?.length + data.value?.childNodes?.length),
|
||||||
);
|
);
|
||||||
if (actions.value) observer.observe(actions.value, opts);
|
if (actions.value) observer.observe(actions.value, opts);
|
||||||
if (data.value) observer.observe(data.value, opts);
|
if (data.value) observer.observe(data.value, opts);
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => stateStore.toggleSubToolbar());
|
const actionsChildCount = () => !!actions.value?.childNodes?.length;
|
||||||
|
|
||||||
|
onBeforeUnmount(() => stateStore.toggleSubToolbar() && hasSubToolbar);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QToolbar
|
<QToolbar
|
||||||
id="subToolbar"
|
id="subToolbar"
|
||||||
class="justify-end sticky"
|
|
||||||
v-show="hasContent || $slots['st-actions'] || $slots['st-data']"
|
v-show="hasContent || $slots['st-actions'] || $slots['st-data']"
|
||||||
|
class="justify-end sticky"
|
||||||
>
|
>
|
||||||
<slot name="st-data">
|
<slot name="st-data">
|
||||||
<div id="st-data"></div>
|
<div id="st-data" :class="{ 'full-width': !actionsChildCount() }">
|
||||||
|
</div>
|
||||||
</slot>
|
</slot>
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<slot name="st-actions">
|
<slot name="st-actions">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { defineProps, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
|
@ -51,16 +51,6 @@ describe('CardSummary', () => {
|
||||||
expect(vm.store.filter).toEqual('cardFilter');
|
expect(vm.store.filter).toEqual('cardFilter');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should compute entity correctly from store data', () => {
|
|
||||||
vm.store.data = [{ id: 1, name: 'Entity 1' }];
|
|
||||||
expect(vm.entity).toEqual({ id: 1, name: 'Entity 1' });
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should handle empty data gracefully', () => {
|
|
||||||
vm.store.data = [];
|
|
||||||
expect(vm.entity).toBeUndefined();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should respond to prop changes and refetch data', async () => {
|
it('should respond to prop changes and refetch data', async () => {
|
||||||
const newUrl = 'CardSummary/35';
|
const newUrl = 'CardSummary/35';
|
||||||
const newKey = 'cardSummaryKey/35';
|
const newKey = 'cardSummaryKey/35';
|
||||||
|
@ -72,7 +62,7 @@ describe('CardSummary', () => {
|
||||||
expect(vm.store.filter).toEqual({ key: newKey });
|
expect(vm.store.filter).toEqual({ key: newKey });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return true if route path ends with /summary' , () => {
|
it('should return true if route path ends with /summary', () => {
|
||||||
expect(vm.isSummary).toBe(true);
|
expect(vm.isSummary).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -0,0 +1,89 @@
|
||||||
|
import { vi, describe, expect, it, beforeEach, afterEach } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
|
||||||
|
let wrapper;
|
||||||
|
let vm;
|
||||||
|
const isEmployeeMock = vi.fn();
|
||||||
|
|
||||||
|
function generateWrapper(storage = 'images') {
|
||||||
|
wrapper = createWrapper(VnImg, {
|
||||||
|
props: {
|
||||||
|
id: 123,
|
||||||
|
zoomResolution: '400x400',
|
||||||
|
storage,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
vm.timeStamp = 'timestamp';
|
||||||
|
};
|
||||||
|
|
||||||
|
vi.mock('src/composables/useSession', () => ({
|
||||||
|
useSession: () => ({
|
||||||
|
getTokenMultimedia: () => 'token',
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock('src/composables/useRole', () => ({
|
||||||
|
useRole: () => ({
|
||||||
|
isEmployee: isEmployeeMock,
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
describe('VnImg', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
isEmployeeMock.mockReset();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getUrl', () => {
|
||||||
|
it('should return /api/{storage}/{id}/downloadFile?access_token={token} when storage is dms', async () => {
|
||||||
|
isEmployeeMock.mockReturnValue(false);
|
||||||
|
generateWrapper('dms');
|
||||||
|
await vm.$nextTick();
|
||||||
|
const url = vm.getUrl();
|
||||||
|
expect(url).toBe('/api/dms/123/downloadFile?access_token=token');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return /no-user.png when role is not employee and storage is not dms', async () => {
|
||||||
|
isEmployeeMock.mockReturnValue(false);
|
||||||
|
generateWrapper();
|
||||||
|
await vm.$nextTick();
|
||||||
|
const url = vm.getUrl();
|
||||||
|
expect(url).toBe('/no-user.png');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return /api/{storage}/{collection}/{curResolution}/{id}/download?access_token={token}&{timeStamp} when zoom is false and role is employee and storage is not dms', async () => {
|
||||||
|
isEmployeeMock.mockReturnValue(true);
|
||||||
|
generateWrapper();
|
||||||
|
await vm.$nextTick();
|
||||||
|
const url = vm.getUrl();
|
||||||
|
expect(url).toBe('/api/images/catalog/200x200/123/download?access_token=token×tamp');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return /api/{storage}/{collection}/{curResolution}/{id}/download?access_token={token}&{timeStamp} when zoom is true and role is employee and storage is not dms', async () => {
|
||||||
|
isEmployeeMock.mockReturnValue(true);
|
||||||
|
generateWrapper();
|
||||||
|
await vm.$nextTick();
|
||||||
|
const url = vm.getUrl(true);
|
||||||
|
expect(url).toBe('/api/images/catalog/400x400/123/download?access_token=token×tamp');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('reload', () => {
|
||||||
|
it('should update the timestamp', async () => {
|
||||||
|
generateWrapper();
|
||||||
|
const initialTimestamp = wrapper.vm.timeStamp;
|
||||||
|
|
||||||
|
wrapper.vm.reload();
|
||||||
|
const newTimestamp = wrapper.vm.timeStamp;
|
||||||
|
|
||||||
|
expect(initialTimestamp).not.toEqual(newTimestamp);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,71 @@
|
||||||
|
import { vi, describe, expect, it, beforeEach, afterEach } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
|
|
||||||
|
describe('VnSearchbar', () => {
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
let applyFilterSpy;
|
||||||
|
const searchText = 'Bolas de madera';
|
||||||
|
const userParams = {staticKey: 'staticValue'};
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
wrapper = createWrapper(VnSearchbar, {
|
||||||
|
propsData: {
|
||||||
|
dataKey: 'testKey',
|
||||||
|
filter: null,
|
||||||
|
whereFilter: null,
|
||||||
|
searchRemoveParams: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
|
||||||
|
vm.searchText = searchText;
|
||||||
|
vm.arrayData.store.userParams = userParams;
|
||||||
|
applyFilterSpy = vi.spyOn(vm.arrayData, 'applyFilter').mockImplementation(() => {});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('search resets pagination and applies filter', async () => {
|
||||||
|
const resetPaginationSpy = vi.spyOn(vm.arrayData, 'resetPagination').mockImplementation(() => {});
|
||||||
|
await vm.search();
|
||||||
|
|
||||||
|
expect(resetPaginationSpy).toHaveBeenCalled();
|
||||||
|
expect(applyFilterSpy).toHaveBeenCalledWith({
|
||||||
|
params: { search: searchText },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('search includes static params if searchRemoveParams is false', async () => {
|
||||||
|
wrapper.setProps({ searchRemoveParams: false });
|
||||||
|
await vm.$nextTick();
|
||||||
|
await vm.search();
|
||||||
|
|
||||||
|
expect(applyFilterSpy).toHaveBeenCalledWith({
|
||||||
|
params: { staticKey: 'staticValue', search: searchText },
|
||||||
|
filter: {skip: 0},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('updates store when dataKey changes', async () => {
|
||||||
|
expect(vm.store.userParams).toEqual(userParams);
|
||||||
|
wrapper.setProps({ dataKey: 'newTestKey' });
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(vm.store.userParams).toEqual({});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('computes the "to" property correctly for redirection', () => {
|
||||||
|
vm.arrayData.store.searchUrl = 'searchParam';
|
||||||
|
vm.arrayData.store.currentFilter = { category: 'plants' };
|
||||||
|
const expectedQuery = JSON.stringify({
|
||||||
|
...vm.arrayData.store.currentFilter,
|
||||||
|
search: searchText,
|
||||||
|
});
|
||||||
|
expect(vm.to.query.searchParam).toBe(expectedQuery);
|
||||||
|
});
|
||||||
|
});
|
|
@ -16,7 +16,7 @@ describe('useArrayData', () => {
|
||||||
vi.clearAllMocks();
|
vi.clearAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should fetch and repalce url with new params', async () => {
|
it('should fetch and replace url with new params', async () => {
|
||||||
vi.spyOn(axios, 'get').mockReturnValueOnce({ data: [] });
|
vi.spyOn(axios, 'get').mockReturnValueOnce({ data: [] });
|
||||||
|
|
||||||
const arrayData = useArrayData('ArrayData', { url: 'mockUrl' });
|
const arrayData = useArrayData('ArrayData', { url: 'mockUrl' });
|
||||||
|
@ -33,11 +33,11 @@ describe('useArrayData', () => {
|
||||||
});
|
});
|
||||||
expect(routerReplace.path).toEqual('mockSection/list');
|
expect(routerReplace.path).toEqual('mockSection/list');
|
||||||
expect(JSON.parse(routerReplace.query.params)).toEqual(
|
expect(JSON.parse(routerReplace.query.params)).toEqual(
|
||||||
expect.objectContaining(params)
|
expect.objectContaining(params),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should get data and send new URL without keeping parameters, if there is only one record', async () => {
|
it('should get data and send new URL without keeping parameters, if there is only one record', async () => {
|
||||||
vi.spyOn(axios, 'get').mockReturnValueOnce({ data: [{ id: 1 }] });
|
vi.spyOn(axios, 'get').mockReturnValueOnce({ data: [{ id: 1 }] });
|
||||||
|
|
||||||
const arrayData = useArrayData('ArrayData', { url: 'mockUrl', navigate: {} });
|
const arrayData = useArrayData('ArrayData', { url: 'mockUrl', navigate: {} });
|
||||||
|
@ -56,7 +56,7 @@ describe('useArrayData', () => {
|
||||||
expect(routerPush.query).toBeUndefined();
|
expect(routerPush.query).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should get data and send new URL keeping parameters, if you have more than one record', async () => {
|
it('should get data and send new URL keeping parameters, if you have more than one record', async () => {
|
||||||
vi.spyOn(axios, 'get').mockReturnValueOnce({ data: [{ id: 1 }, { id: 2 }] });
|
vi.spyOn(axios, 'get').mockReturnValueOnce({ data: [{ id: 1 }, { id: 2 }] });
|
||||||
|
|
||||||
vi.spyOn(vueRouter, 'useRoute').mockReturnValue({
|
vi.spyOn(vueRouter, 'useRoute').mockReturnValue({
|
||||||
|
@ -95,4 +95,25 @@ describe('useArrayData', () => {
|
||||||
expect(routerPush.path).toEqual('mockName/');
|
expect(routerPush.path).toEqual('mockName/');
|
||||||
expect(routerPush.query.params).toBeDefined();
|
expect(routerPush.query.params).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should return one record', async () => {
|
||||||
|
vi.spyOn(axios, 'get').mockReturnValueOnce({
|
||||||
|
data: [
|
||||||
|
{ id: 1, name: 'Entity 1' },
|
||||||
|
{ id: 2, name: 'Entity 2' },
|
||||||
|
],
|
||||||
|
});
|
||||||
|
const arrayData = useArrayData('ArrayData', { url: 'mockUrl', oneRecord: true });
|
||||||
|
await arrayData.fetch({});
|
||||||
|
|
||||||
|
expect(arrayData.store.data).toEqual({ id: 1, name: 'Entity 1' });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle empty data gracefully if has to return one record', async () => {
|
||||||
|
vi.spyOn(axios, 'get').mockReturnValueOnce({ data: [] });
|
||||||
|
const arrayData = useArrayData('ArrayData', { url: 'mockUrl', oneRecord: true });
|
||||||
|
await arrayData.fetch({});
|
||||||
|
|
||||||
|
expect(arrayData.store.data).toBeUndefined();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -33,10 +33,11 @@ export function useArrayData(key, userOptions) {
|
||||||
: JSON.parse(params?.filter ?? '{}');
|
: JSON.parse(params?.filter ?? '{}');
|
||||||
delete params.filter;
|
delete params.filter;
|
||||||
|
|
||||||
store.userParams = { ...store.userParams, ...params };
|
store.userParams = params;
|
||||||
store.filter = { ...filter, ...store.userFilter };
|
store.filter = { ...filter, ...store.userFilter };
|
||||||
if (filter?.order) store.order = filter.order;
|
if (filter?.order) store.order = filter.order;
|
||||||
}
|
}
|
||||||
|
setCurrentFilter();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (key && userOptions) setOptions();
|
if (key && userOptions) setOptions();
|
||||||
|
@ -56,6 +57,7 @@ export function useArrayData(key, userOptions) {
|
||||||
'navigate',
|
'navigate',
|
||||||
'mapKey',
|
'mapKey',
|
||||||
'keepData',
|
'keepData',
|
||||||
|
'oneRecord',
|
||||||
];
|
];
|
||||||
if (typeof userOptions === 'object') {
|
if (typeof userOptions === 'object') {
|
||||||
for (const option in userOptions) {
|
for (const option in userOptions) {
|
||||||
|
@ -78,11 +80,7 @@ export function useArrayData(key, userOptions) {
|
||||||
|
|
||||||
cancelRequest();
|
cancelRequest();
|
||||||
canceller = new AbortController();
|
canceller = new AbortController();
|
||||||
const { params, limit } = getCurrentFilter();
|
const { params, limit } = setCurrentFilter();
|
||||||
|
|
||||||
store.currentFilter = JSON.parse(JSON.stringify(params));
|
|
||||||
delete store.currentFilter.filter.include;
|
|
||||||
store.currentFilter.filter = JSON.stringify(store.currentFilter.filter);
|
|
||||||
|
|
||||||
let exprFilter;
|
let exprFilter;
|
||||||
if (store?.exprBuilder) {
|
if (store?.exprBuilder) {
|
||||||
|
@ -96,6 +94,9 @@ export function useArrayData(key, userOptions) {
|
||||||
|
|
||||||
if (params.filter.where || exprFilter)
|
if (params.filter.where || exprFilter)
|
||||||
params.filter.where = { ...params.filter.where, ...exprFilter };
|
params.filter.where = { ...params.filter.where, ...exprFilter };
|
||||||
|
|
||||||
|
if (!params?.filter?.order?.length) delete params?.filter?.order;
|
||||||
|
|
||||||
params.filter = JSON.stringify(params.filter);
|
params.filter = JSON.stringify(params.filter);
|
||||||
|
|
||||||
store.isLoading = true;
|
store.isLoading = true;
|
||||||
|
@ -107,12 +108,16 @@ export function useArrayData(key, userOptions) {
|
||||||
store.hasMoreData = limit && response.data.length >= limit;
|
store.hasMoreData = limit && response.data.length >= limit;
|
||||||
|
|
||||||
if (!append && !isDialogOpened() && updateRouter) {
|
if (!append && !isDialogOpened() && updateRouter) {
|
||||||
if (updateStateParams(response.data)?.redirect) return;
|
if (updateStateParams(response.data)?.redirect && !store.keepData) return;
|
||||||
}
|
}
|
||||||
store.isLoading = false;
|
store.isLoading = false;
|
||||||
canceller = null;
|
canceller = null;
|
||||||
|
|
||||||
processData(response.data, { map: !!store.mapKey, append });
|
processData(response.data, {
|
||||||
|
map: !!store.mapKey,
|
||||||
|
append,
|
||||||
|
oneRecord: store.oneRecord,
|
||||||
|
});
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
@ -142,12 +147,12 @@ export function useArrayData(key, userOptions) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function applyFilter({ filter, params }) {
|
async function applyFilter({ filter, params }, fetchOptions = {}) {
|
||||||
if (filter) store.userFilter = filter;
|
if (filter) store.userFilter = filter;
|
||||||
store.filter = {};
|
store.filter = {};
|
||||||
if (params) store.userParams = { ...params };
|
if (params) store.userParams = { ...params };
|
||||||
|
|
||||||
const response = await fetch({});
|
const response = await fetch(fetchOptions);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,10 +178,9 @@ export function useArrayData(key, userOptions) {
|
||||||
|
|
||||||
async function addOrder(field, direction = 'ASC') {
|
async function addOrder(field, direction = 'ASC') {
|
||||||
const newOrder = field + ' ' + direction;
|
const newOrder = field + ' ' + direction;
|
||||||
let order = store.order || [];
|
const order = toArray(store.order);
|
||||||
if (typeof order == 'string') order = [order];
|
|
||||||
|
|
||||||
let index = order.findIndex((o) => o.split(' ')[0] === field);
|
let index = getOrderIndex(order, field);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
order[index] = newOrder;
|
order[index] = newOrder;
|
||||||
} else {
|
} else {
|
||||||
|
@ -193,16 +197,24 @@ export function useArrayData(key, userOptions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteOrder(field) {
|
async function deleteOrder(field) {
|
||||||
let order = store.order ?? [];
|
const order = toArray(store.order);
|
||||||
if (typeof order == 'string') order = [order];
|
const index = getOrderIndex(order, field);
|
||||||
|
|
||||||
const index = order.findIndex((o) => o.split(' ')[0] === field);
|
|
||||||
if (index > -1) order.splice(index, 1);
|
if (index > -1) order.splice(index, 1);
|
||||||
|
|
||||||
store.order = order;
|
store.order = order;
|
||||||
fetch({});
|
fetch({});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getOrderIndex(order, field) {
|
||||||
|
return order.findIndex((o) => o.split(' ')[0] === field);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toArray(str = []) {
|
||||||
|
if (!str) return [];
|
||||||
|
if (Array.isArray(str)) return str;
|
||||||
|
if (typeof str === 'string') return str.split(',').map((item) => item.trim());
|
||||||
|
}
|
||||||
|
|
||||||
function sanitizerParams(params, exprBuilder) {
|
function sanitizerParams(params, exprBuilder) {
|
||||||
for (const param in params) {
|
for (const param in params) {
|
||||||
if (params[param] === '' || params[param] === null) {
|
if (params[param] === '' || params[param] === null) {
|
||||||
|
@ -276,14 +288,14 @@ export function useArrayData(key, userOptions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCurrentFilter() {
|
function getCurrentFilter() {
|
||||||
|
if (!Object.keys(store.userParams).length)
|
||||||
|
store.userParams = store.defaultParams ?? {};
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
limit: store.limit,
|
limit: store.limit,
|
||||||
|
...store.userFilter,
|
||||||
};
|
};
|
||||||
|
|
||||||
let userParams = { ...store.userParams };
|
|
||||||
|
|
||||||
Object.assign(filter, store.userFilter);
|
|
||||||
|
|
||||||
let where;
|
let where;
|
||||||
if (filter?.where || store.filter?.where)
|
if (filter?.where || store.filter?.where)
|
||||||
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
|
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
|
||||||
|
@ -291,16 +303,27 @@ export function useArrayData(key, userOptions) {
|
||||||
filter.where = where;
|
filter.where = where;
|
||||||
const params = { filter };
|
const params = { filter };
|
||||||
|
|
||||||
Object.assign(params, userParams);
|
Object.assign(params, store.userParams);
|
||||||
if (params.filter) params.filter.skip = store.skip;
|
if (params.filter) params.filter.skip = store.skip;
|
||||||
if (store?.order && typeof store?.order == 'string') store.order = [store.order];
|
if (store.order) params.filter.order = toArray(store.order);
|
||||||
if (store.order?.length) params.filter.order = [...store.order];
|
|
||||||
else delete params.filter.order;
|
else delete params.filter.order;
|
||||||
|
|
||||||
return { filter, params, limit: filter.limit };
|
return { filter, params, limit: filter.limit };
|
||||||
}
|
}
|
||||||
|
|
||||||
function processData(data, { map = true, append = true }) {
|
function setCurrentFilter() {
|
||||||
|
const { params, limit } = getCurrentFilter();
|
||||||
|
store.currentFilter = JSON.parse(JSON.stringify(params));
|
||||||
|
delete store.currentFilter.filter.include;
|
||||||
|
store.currentFilter.filter = JSON.stringify(store.currentFilter.filter);
|
||||||
|
return { params, limit };
|
||||||
|
}
|
||||||
|
|
||||||
|
function processData(data, { map = true, append = true, oneRecord = false }) {
|
||||||
|
if (oneRecord) {
|
||||||
|
store.data = Array.isArray(data) ? data[0] : data;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!append) {
|
if (!append) {
|
||||||
store.data = [];
|
store.data = [];
|
||||||
store.map = new Map();
|
store.map = new Map();
|
||||||
|
@ -333,6 +356,7 @@ export function useArrayData(key, userOptions) {
|
||||||
applyFilter,
|
applyFilter,
|
||||||
addFilter,
|
addFilter,
|
||||||
getCurrentFilter,
|
getCurrentFilter,
|
||||||
|
setCurrentFilter,
|
||||||
addFilterWhere,
|
addFilterWhere,
|
||||||
addOrder,
|
addOrder,
|
||||||
deleteOrder,
|
deleteOrder,
|
||||||
|
|
|
@ -29,8 +29,12 @@ export function useFilterParams(key) {
|
||||||
orders.value = orderObject;
|
orders.value = orderObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setUserParams(watchedParams) {
|
function setUserParams(watchedParams = {}) {
|
||||||
if (!watchedParams || Object.keys(watchedParams).length == 0) return;
|
if (Object.keys(watchedParams).length == 0) {
|
||||||
|
params.value = {};
|
||||||
|
orders.value = {};
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof watchedParams == 'string') watchedParams = JSON.parse(watchedParams);
|
if (typeof watchedParams == 'string') watchedParams = JSON.parse(watchedParams);
|
||||||
if (typeof watchedParams?.filter == 'string')
|
if (typeof watchedParams?.filter == 'string')
|
||||||
|
|
|
@ -5,7 +5,7 @@ export function useHasContent(selector) {
|
||||||
const hasContent = ref();
|
const hasContent = ref();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
container.value = document.querySelector(selector);
|
container.value = document?.querySelector(selector);
|
||||||
if (!container.value) return;
|
if (!container.value) return;
|
||||||
|
|
||||||
const observer = new MutationObserver(() => {
|
const observer = new MutationObserver(() => {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import axios from 'axios';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import useNotify from './useNotify';
|
import useNotify from './useNotify';
|
||||||
import { useTokenConfig } from './useTokenConfig';
|
import { useTokenConfig } from './useTokenConfig';
|
||||||
|
import { getToken, getTokenMultimedia } from 'src/utils/session';
|
||||||
const TOKEN_MULTIMEDIA = 'tokenMultimedia';
|
const TOKEN_MULTIMEDIA = 'tokenMultimedia';
|
||||||
const TOKEN = 'token';
|
const TOKEN = 'token';
|
||||||
|
|
||||||
|
@ -15,19 +16,6 @@ export function useSession() {
|
||||||
let isCheckingToken = false;
|
let isCheckingToken = false;
|
||||||
let intervalId = null;
|
let intervalId = null;
|
||||||
|
|
||||||
function getToken() {
|
|
||||||
const localToken = localStorage.getItem(TOKEN);
|
|
||||||
const sessionToken = sessionStorage.getItem(TOKEN);
|
|
||||||
|
|
||||||
return localToken || sessionToken || '';
|
|
||||||
}
|
|
||||||
function getTokenMultimedia() {
|
|
||||||
const localTokenMultimedia = localStorage.getItem(TOKEN_MULTIMEDIA);
|
|
||||||
const sessionTokenMultimedia = sessionStorage.getItem(TOKEN_MULTIMEDIA);
|
|
||||||
|
|
||||||
return localTokenMultimedia || sessionTokenMultimedia || '';
|
|
||||||
}
|
|
||||||
|
|
||||||
function setSession(data) {
|
function setSession(data) {
|
||||||
let keepLogin = data.keepLogin;
|
let keepLogin = data.keepLogin;
|
||||||
const storage = keepLogin ? localStorage : sessionStorage;
|
const storage = keepLogin ? localStorage : sessionStorage;
|
||||||
|
|
|
@ -4,10 +4,10 @@ import { useQuasar } from 'quasar';
|
||||||
export function useSummaryDialog() {
|
export function useSummaryDialog() {
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
|
||||||
function viewSummary(id, summary) {
|
function viewSummary(id, summary, width) {
|
||||||
quasar.dialog({
|
quasar.dialog({
|
||||||
component: VnSummaryDialog,
|
component: VnSummaryDialog,
|
||||||
componentProps: { id, summary },
|
componentProps: { id, summary, width },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// app global css in SCSS form
|
// app global css in SCSS form
|
||||||
@import './icons.scss';
|
@import './icons.scss';
|
||||||
@import '@quasar/quasar-ui-qcalendar/src/QCalendarMonth.sass';
|
@import '@quasar/quasar-ui-qcalendar/src/QCalendarMonth.scss';
|
||||||
|
|
||||||
body.body--light {
|
body.body--light {
|
||||||
--vn-header-color: #cecece;
|
--vn-header-color: #cecece;
|
||||||
|
@ -212,6 +212,10 @@ select:-webkit-autofill {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-card__section[dense] {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
input[type='number'] {
|
input[type='number'] {
|
||||||
-moz-appearance: textfield;
|
-moz-appearance: textfield;
|
||||||
}
|
}
|
||||||
|
@ -310,6 +314,14 @@ input::-webkit-inner-spin-button {
|
||||||
.no-visible {
|
.no-visible {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-item > .q-item__section:has(.q-checkbox) {
|
||||||
|
max-width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row > .column:has(.q-checkbox) {
|
||||||
|
max-width: fit-content;
|
||||||
|
}
|
||||||
.q-field__inner {
|
.q-field__inner {
|
||||||
.q-field__control {
|
.q-field__control {
|
||||||
min-height: auto !important;
|
min-height: auto !important;
|
||||||
|
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 186 KiB |
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -1,10 +1,10 @@
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'icon';
|
font-family: 'icon';
|
||||||
src: url('fonts/icon.eot?y0x93o');
|
src: url('fonts/icon.eot?uocffs');
|
||||||
src: url('fonts/icon.eot?y0x93o#iefix') format('embedded-opentype'),
|
src: url('fonts/icon.eot?uocffs#iefix') format('embedded-opentype'),
|
||||||
url('fonts/icon.ttf?y0x93o') format('truetype'),
|
url('fonts/icon.ttf?uocffs') format('truetype'),
|
||||||
url('fonts/icon.woff?y0x93o') format('woff'),
|
url('fonts/icon.woff?uocffs') format('woff'),
|
||||||
url('fonts/icon.svg?y0x93o#icon') format('svg');
|
url('fonts/icon.svg?uocffs#icon') format('svg');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: block;
|
font-display: block;
|
||||||
|
@ -25,8 +25,17 @@
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-entry_lastbuys:before {
|
.icon-inactive-car:before {
|
||||||
content: "\e91a";
|
content: "\e978";
|
||||||
|
}
|
||||||
|
.icon-hasItemLost:before {
|
||||||
|
content: "\e957";
|
||||||
|
}
|
||||||
|
.icon-hasItemDelay:before {
|
||||||
|
content: "\e96d";
|
||||||
|
}
|
||||||
|
.icon-add_entries:before {
|
||||||
|
content: "\e953";
|
||||||
}
|
}
|
||||||
.icon-100:before {
|
.icon-100:before {
|
||||||
content: "\e901";
|
content: "\e901";
|
||||||
|
@ -52,6 +61,9 @@
|
||||||
.icon-addperson:before {
|
.icon-addperson:before {
|
||||||
content: "\e908";
|
content: "\e908";
|
||||||
}
|
}
|
||||||
|
.icon-agencia_tributaria:before {
|
||||||
|
content: "\e948";
|
||||||
|
}
|
||||||
.icon-agency:before {
|
.icon-agency:before {
|
||||||
content: "\e92a";
|
content: "\e92a";
|
||||||
}
|
}
|
||||||
|
@ -189,6 +201,9 @@
|
||||||
.icon-entry:before {
|
.icon-entry:before {
|
||||||
content: "\e937";
|
content: "\e937";
|
||||||
}
|
}
|
||||||
|
.icon-entry_lastbuys:before {
|
||||||
|
content: "\e91a";
|
||||||
|
}
|
||||||
.icon-exit:before {
|
.icon-exit:before {
|
||||||
content: "\e938";
|
content: "\e938";
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,11 @@ $dark-shadow-color: black;
|
||||||
$layout-shadow-dark: 0 0 10px 2px #00000033, 0 0px 10px #0000003d;
|
$layout-shadow-dark: 0 0 10px 2px #00000033, 0 0px 10px #0000003d;
|
||||||
$spacing-md: 16px;
|
$spacing-md: 16px;
|
||||||
$color-font-secondary: #777;
|
$color-font-secondary: #777;
|
||||||
|
$width-xs: 400px;
|
||||||
|
$width-sm: 544px;
|
||||||
|
$width-md: 800px;
|
||||||
|
$width-lg: 1280px;
|
||||||
|
$width-xl: 1600px;
|
||||||
.bg-success {
|
.bg-success {
|
||||||
background-color: $positive;
|
background-color: $positive;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import getUpdatedValues from './getUpdatedValues';
|
||||||
import getParamWhere from './getParamWhere';
|
import getParamWhere from './getParamWhere';
|
||||||
import parsePhone from './parsePhone';
|
import parsePhone from './parsePhone';
|
||||||
import isDialogOpened from './isDialogOpened';
|
import isDialogOpened from './isDialogOpened';
|
||||||
|
import toCelsius from './toCelsius';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getUpdatedValues,
|
getUpdatedValues,
|
||||||
|
@ -36,4 +37,5 @@ export {
|
||||||
dashIfEmpty,
|
dashIfEmpty,
|
||||||
dateRange,
|
dateRange,
|
||||||
getParamWhere,
|
getParamWhere,
|
||||||
|
toCelsius,
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default function toCelsius(value) {
|
||||||
|
return value ? `${value}°C` : '';
|
||||||
|
}
|
|
@ -2,12 +2,14 @@ globals:
|
||||||
lang:
|
lang:
|
||||||
es: Spanish
|
es: Spanish
|
||||||
en: English
|
en: English
|
||||||
quantity: Quantity
|
|
||||||
language: Language
|
language: Language
|
||||||
|
quantity: Quantity
|
||||||
entity: Entity
|
entity: Entity
|
||||||
|
preview: Preview
|
||||||
user: User
|
user: User
|
||||||
details: Details
|
details: Details
|
||||||
collapseMenu: Collapse left menu
|
collapseMenu: Collapse lateral menu
|
||||||
|
advancedMenu: Advanced menu
|
||||||
backToDashboard: Return to dashboard
|
backToDashboard: Return to dashboard
|
||||||
notifications: Notifications
|
notifications: Notifications
|
||||||
userPanel: User panel
|
userPanel: User panel
|
||||||
|
@ -35,7 +37,6 @@ globals:
|
||||||
confirm: Confirm
|
confirm: Confirm
|
||||||
assign: Assign
|
assign: Assign
|
||||||
back: Back
|
back: Back
|
||||||
downloadPdf: Download PDF
|
|
||||||
yes: 'Yes'
|
yes: 'Yes'
|
||||||
no: 'No'
|
no: 'No'
|
||||||
noChanges: No changes to save
|
noChanges: No changes to save
|
||||||
|
@ -59,6 +60,7 @@ globals:
|
||||||
downloadCSVSuccess: CSV downloaded successfully
|
downloadCSVSuccess: CSV downloaded successfully
|
||||||
reference: Reference
|
reference: Reference
|
||||||
agency: Agency
|
agency: Agency
|
||||||
|
entry: Entry
|
||||||
warehouseOut: Warehouse Out
|
warehouseOut: Warehouse Out
|
||||||
warehouseIn: Warehouse In
|
warehouseIn: Warehouse In
|
||||||
landed: Landed
|
landed: Landed
|
||||||
|
@ -67,11 +69,11 @@ globals:
|
||||||
amount: Amount
|
amount: Amount
|
||||||
packages: Packages
|
packages: Packages
|
||||||
download: Download
|
download: Download
|
||||||
|
downloadPdf: Download PDF
|
||||||
selectRows: 'Select all { numberRows } row(s)'
|
selectRows: 'Select all { numberRows } row(s)'
|
||||||
allRows: 'All { numberRows } row(s)'
|
allRows: 'All { numberRows } row(s)'
|
||||||
markAll: Mark all
|
markAll: Mark all
|
||||||
requiredField: Required field
|
requiredField: Required field
|
||||||
valueCantBeEmpty: Value cannot be empty
|
|
||||||
class: clase
|
class: clase
|
||||||
type: Type
|
type: Type
|
||||||
reason: reason
|
reason: reason
|
||||||
|
@ -81,6 +83,9 @@ globals:
|
||||||
warehouse: Warehouse
|
warehouse: Warehouse
|
||||||
company: Company
|
company: Company
|
||||||
fieldRequired: Field required
|
fieldRequired: Field required
|
||||||
|
valueCantBeEmpty: Value cannot be empty
|
||||||
|
Value can't be blank: Value cannot be blank
|
||||||
|
Value can't be null: Value cannot be null
|
||||||
allowedFilesText: 'Allowed file types: { allowedContentTypes }'
|
allowedFilesText: 'Allowed file types: { allowedContentTypes }'
|
||||||
smsSent: SMS sent
|
smsSent: SMS sent
|
||||||
confirmDeletion: Confirm deletion
|
confirmDeletion: Confirm deletion
|
||||||
|
@ -130,6 +135,26 @@ globals:
|
||||||
medium: Medium
|
medium: Medium
|
||||||
big: Big
|
big: Big
|
||||||
email: Email
|
email: Email
|
||||||
|
supplier: Supplier
|
||||||
|
ticketList: Ticket List
|
||||||
|
created: Created
|
||||||
|
worker: Worker
|
||||||
|
now: Now
|
||||||
|
name: Name
|
||||||
|
new: New
|
||||||
|
comment: Comment
|
||||||
|
observations: Observations
|
||||||
|
goToModuleIndex: Go to module index
|
||||||
|
createInvoiceIn: Create invoice in
|
||||||
|
myAccount: My account
|
||||||
|
noOne: No one
|
||||||
|
maxTemperature: Max
|
||||||
|
minTemperature: Min
|
||||||
|
changePass: Change password
|
||||||
|
deleteConfirmTitle: Delete selected elements
|
||||||
|
changeState: Change state
|
||||||
|
raid: 'Raid {daysInForward} days'
|
||||||
|
isVies: Vies
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Login
|
logIn: Login
|
||||||
addressEdit: Update address
|
addressEdit: Update address
|
||||||
|
@ -151,13 +176,14 @@ globals:
|
||||||
subRoles: Subroles
|
subRoles: Subroles
|
||||||
inheritedRoles: Inherited Roles
|
inheritedRoles: Inherited Roles
|
||||||
customers: Customers
|
customers: Customers
|
||||||
|
customerCreate: New customer
|
||||||
|
createCustomer: Create customer
|
||||||
|
createOrder: New order
|
||||||
list: List
|
list: List
|
||||||
webPayments: Web Payments
|
webPayments: Web Payments
|
||||||
extendedList: Extended list
|
extendedList: Extended list
|
||||||
notifications: Notifications
|
notifications: Notifications
|
||||||
defaulter: Defaulter
|
defaulter: Defaulter
|
||||||
customerCreate: New customer
|
|
||||||
createOrder: New order
|
|
||||||
fiscalData: Fiscal data
|
fiscalData: Fiscal data
|
||||||
billingData: Billing data
|
billingData: Billing data
|
||||||
consignees: Consignees
|
consignees: Consignees
|
||||||
|
@ -193,27 +219,28 @@ globals:
|
||||||
claims: Claims
|
claims: Claims
|
||||||
claimCreate: New claim
|
claimCreate: New claim
|
||||||
lines: Lines
|
lines: Lines
|
||||||
photos: Photos
|
|
||||||
development: Development
|
development: Development
|
||||||
|
photos: Photos
|
||||||
action: Action
|
action: Action
|
||||||
invoiceOuts: Invoice out
|
invoiceOuts: Invoice out
|
||||||
negativeBases: Negative Bases
|
negativeBases: Negative Bases
|
||||||
globalInvoicing: Global invoicing
|
globalInvoicing: Global invoicing
|
||||||
invoiceOutCreate: Create invoice out
|
invoiceOutCreate: Create invoice out
|
||||||
|
order: Orders
|
||||||
|
orderList: List
|
||||||
|
orderCreate: New order
|
||||||
|
catalog: Catalog
|
||||||
|
volume: Volume
|
||||||
shelving: Shelving
|
shelving: Shelving
|
||||||
shelvingList: Shelving List
|
shelvingList: Shelving List
|
||||||
shelvingCreate: New shelving
|
shelvingCreate: New shelving
|
||||||
invoiceIns: Invoices In
|
invoiceIns: Invoices In
|
||||||
invoiceInCreate: Create invoice in
|
invoiceInCreate: Create invoice in
|
||||||
vat: VAT
|
vat: VAT
|
||||||
|
labeler: Labeler
|
||||||
dueDay: Due day
|
dueDay: Due day
|
||||||
intrastat: Intrastat
|
intrastat: Intrastat
|
||||||
corrective: Corrective
|
corrective: Corrective
|
||||||
order: Orders
|
|
||||||
orderList: List
|
|
||||||
orderCreate: New order
|
|
||||||
catalog: Catalog
|
|
||||||
volume: Volume
|
|
||||||
workers: Workers
|
workers: Workers
|
||||||
workerCreate: New worker
|
workerCreate: New worker
|
||||||
department: Department
|
department: Department
|
||||||
|
@ -226,10 +253,10 @@ globals:
|
||||||
wagonsList: Wagons List
|
wagonsList: Wagons List
|
||||||
wagonCreate: Create wagon
|
wagonCreate: Create wagon
|
||||||
wagonEdit: Edit wagon
|
wagonEdit: Edit wagon
|
||||||
|
wagonCounter: Trolley counter
|
||||||
typesList: Types List
|
typesList: Types List
|
||||||
typeCreate: Create type
|
typeCreate: Create type
|
||||||
typeEdit: Edit type
|
typeEdit: Edit type
|
||||||
wagonCounter: Trolley counter
|
|
||||||
roadmap: Roadmap
|
roadmap: Roadmap
|
||||||
stops: Stops
|
stops: Stops
|
||||||
routes: Routes
|
routes: Routes
|
||||||
|
@ -238,21 +265,16 @@ globals:
|
||||||
routeCreate: New route
|
routeCreate: New route
|
||||||
RouteRoadmap: Roadmaps
|
RouteRoadmap: Roadmaps
|
||||||
RouteRoadmapCreate: Create roadmap
|
RouteRoadmapCreate: Create roadmap
|
||||||
|
RouteExtendedList: Router
|
||||||
autonomous: Autonomous
|
autonomous: Autonomous
|
||||||
suppliers: Suppliers
|
suppliers: Suppliers
|
||||||
supplier: Supplier
|
supplier: Supplier
|
||||||
expedition: Expedition
|
|
||||||
services: Service
|
|
||||||
components: Components
|
|
||||||
pictures: Pictures
|
|
||||||
packages: Packages
|
|
||||||
tracking: Tracking
|
|
||||||
labeler: Labeler
|
|
||||||
supplierCreate: New supplier
|
supplierCreate: New supplier
|
||||||
accounts: Accounts
|
accounts: Accounts
|
||||||
addresses: Addresses
|
addresses: Addresses
|
||||||
agencyTerm: Agency agreement
|
agencyTerm: Agency agreement
|
||||||
travel: Travels
|
travel: Travels
|
||||||
|
create: Create
|
||||||
extraCommunity: Extra community
|
extraCommunity: Extra community
|
||||||
travelCreate: New travel
|
travelCreate: New travel
|
||||||
history: Log
|
history: Log
|
||||||
|
@ -260,14 +282,13 @@ globals:
|
||||||
items: Items
|
items: Items
|
||||||
diary: Diary
|
diary: Diary
|
||||||
tags: Tags
|
tags: Tags
|
||||||
create: Create
|
|
||||||
buyRequest: Buy requests
|
|
||||||
fixedPrice: Fixed prices
|
fixedPrice: Fixed prices
|
||||||
|
buyRequest: Buy requests
|
||||||
wasteBreakdown: Waste breakdown
|
wasteBreakdown: Waste breakdown
|
||||||
itemCreate: New item
|
itemCreate: New item
|
||||||
barcode: Barcodes
|
|
||||||
tax: Tax
|
tax: Tax
|
||||||
botanical: Botanical
|
botanical: Botanical
|
||||||
|
barcode: Barcodes
|
||||||
itemTypeCreate: New item type
|
itemTypeCreate: New item type
|
||||||
family: Item Type
|
family: Item Type
|
||||||
lastEntries: Last entries
|
lastEntries: Last entries
|
||||||
|
@ -283,13 +304,20 @@ globals:
|
||||||
formation: Formation
|
formation: Formation
|
||||||
locations: Locations
|
locations: Locations
|
||||||
warehouses: Warehouses
|
warehouses: Warehouses
|
||||||
saleTracking: Sale tracking
|
|
||||||
roles: Roles
|
roles: Roles
|
||||||
connections: Connections
|
connections: Connections
|
||||||
acls: ACLs
|
acls: ACLs
|
||||||
mailForwarding: Mail forwarding
|
mailForwarding: Mail forwarding
|
||||||
mailAlias: Mail alias
|
mailAlias: Mail alias
|
||||||
privileges: Privileges
|
privileges: Privileges
|
||||||
|
observation: Notes
|
||||||
|
expedition: Expedition
|
||||||
|
saleTracking: Sale tracking
|
||||||
|
services: Service
|
||||||
|
tracking: Tracking
|
||||||
|
components: Components
|
||||||
|
pictures: Pictures
|
||||||
|
packages: Packages
|
||||||
ldap: LDAP
|
ldap: LDAP
|
||||||
samba: Samba
|
samba: Samba
|
||||||
twoFactor: Two factor
|
twoFactor: Two factor
|
||||||
|
@ -298,30 +326,19 @@ globals:
|
||||||
ticketsMonitor: Tickets monitor
|
ticketsMonitor: Tickets monitor
|
||||||
clientsActionsMonitor: Clients and actions
|
clientsActionsMonitor: Clients and actions
|
||||||
serial: Serial
|
serial: Serial
|
||||||
|
business: Business
|
||||||
medical: Mutual
|
medical: Mutual
|
||||||
pit: IRPF
|
pit: IRPF
|
||||||
RouteExtendedList: Router
|
|
||||||
wasteRecalc: Waste recaclulate
|
wasteRecalc: Waste recaclulate
|
||||||
operator: Operator
|
operator: Operator
|
||||||
parking: Parking
|
parking: Parking
|
||||||
supplier: Supplier
|
vehicleList: Vehicles
|
||||||
created: Created
|
vehicle: Vehicle
|
||||||
worker: Worker
|
|
||||||
now: Now
|
|
||||||
name: Name
|
|
||||||
new: New
|
|
||||||
comment: Comment
|
|
||||||
observations: Observations
|
|
||||||
goToModuleIndex: Go to module index
|
|
||||||
unsavedPopup:
|
unsavedPopup:
|
||||||
title: Unsaved changes will be lost
|
title: Unsaved changes will be lost
|
||||||
subtitle: Are you sure exit without saving?
|
subtitle: Are you sure exit without saving?
|
||||||
createInvoiceIn: Create invoice in
|
|
||||||
myAccount: My account
|
|
||||||
noOne: No one
|
|
||||||
maxTemperature: Max
|
|
||||||
minTemperature: Min
|
|
||||||
params:
|
params:
|
||||||
|
description: Description
|
||||||
clientFk: Client id
|
clientFk: Client id
|
||||||
salesPersonFk: Sales person
|
salesPersonFk: Sales person
|
||||||
warehouseFk: Warehouse
|
warehouseFk: Warehouse
|
||||||
|
@ -338,19 +355,19 @@ globals:
|
||||||
supplierFk: Supplier
|
supplierFk: Supplier
|
||||||
supplierRef: Supplier ref
|
supplierRef: Supplier ref
|
||||||
serial: Serial
|
serial: Serial
|
||||||
amount: Importe
|
amount: Amount
|
||||||
awbCode: AWB
|
awbCode: AWB
|
||||||
correctedFk: Rectified
|
correctedFk: Rectified
|
||||||
correctingFk: Rectificative
|
correctingFk: Rectificative
|
||||||
daysOnward: Days onward
|
daysOnward: Days onward
|
||||||
countryFk: Country
|
countryFk: Country
|
||||||
|
countryCodeFk: Country
|
||||||
companyFk: Company
|
companyFk: Company
|
||||||
changePass: Change password
|
model: Model
|
||||||
setPass: Set password
|
fuel: Fuel
|
||||||
deleteConfirmTitle: Delete selected elements
|
active: Active
|
||||||
changeState: Change state
|
inactive: Inactive
|
||||||
raid: 'Raid {daysInForward} days'
|
deliveryPoint: Delivery point
|
||||||
isVies: Vies
|
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Access denied
|
statusUnauthorized: Access denied
|
||||||
statusInternalServerError: An internal server error has ocurred
|
statusInternalServerError: An internal server error has ocurred
|
||||||
|
@ -370,7 +387,7 @@ login:
|
||||||
loginError: Invalid username or password
|
loginError: Invalid username or password
|
||||||
fieldRequired: This field is required
|
fieldRequired: This field is required
|
||||||
twoFactorRequired: Two-factor verification required
|
twoFactorRequired: Two-factor verification required
|
||||||
twoFactorRequired:
|
twoFactor:
|
||||||
validate: Validate
|
validate: Validate
|
||||||
insert: Enter the verification code
|
insert: Enter the verification code
|
||||||
explanation: >-
|
explanation: >-
|
||||||
|
@ -446,65 +463,9 @@ ticket:
|
||||||
service: Service
|
service: Service
|
||||||
attender: Attender
|
attender: Attender
|
||||||
ok: Ok
|
ok: Ok
|
||||||
|
consigneeStreet: Street
|
||||||
create:
|
create:
|
||||||
address: Address
|
address: Address
|
||||||
invoiceOut:
|
|
||||||
card:
|
|
||||||
issued: Issued
|
|
||||||
customerCard: Customer card
|
|
||||||
ticketList: Ticket List
|
|
||||||
summary:
|
|
||||||
issued: Issued
|
|
||||||
dued: Due
|
|
||||||
booked: Booked
|
|
||||||
taxBreakdown: Tax breakdown
|
|
||||||
taxableBase: Taxable base
|
|
||||||
rate: Rate
|
|
||||||
fee: Fee
|
|
||||||
tickets: Tickets
|
|
||||||
totalWithVat: Amount
|
|
||||||
globalInvoices:
|
|
||||||
errors:
|
|
||||||
chooseValidClient: Choose a valid client
|
|
||||||
chooseValidCompany: Choose a valid company
|
|
||||||
chooseValidPrinter: Choose a valid printer
|
|
||||||
chooseValidSerialType: Choose a serial type
|
|
||||||
fillDates: Invoice date and the max date should be filled
|
|
||||||
invoiceDateLessThanMaxDate: Invoice date can not be less than max date
|
|
||||||
invoiceWithFutureDate: Exists an invoice with a future date
|
|
||||||
noTicketsToInvoice: There are not tickets to invoice
|
|
||||||
criticalInvoiceError: 'Critical invoicing error, process stopped'
|
|
||||||
invalidSerialTypeForAll: The serial type must be global when invoicing all clients
|
|
||||||
table:
|
|
||||||
addressId: Address id
|
|
||||||
streetAddress: Street
|
|
||||||
statusCard:
|
|
||||||
percentageText: '{getPercentage}% {getAddressNumber} of {getNAddresses}'
|
|
||||||
pdfsNumberText: '{nPdfs} of {totalPdfs} PDFs'
|
|
||||||
negativeBases:
|
|
||||||
clientId: Client Id
|
|
||||||
base: Base
|
|
||||||
active: Active
|
|
||||||
hasToInvoice: Has to Invoice
|
|
||||||
verifiedData: Verified Data
|
|
||||||
comercial: Comercial
|
|
||||||
errors:
|
|
||||||
downloadCsvFailed: CSV download failed
|
|
||||||
shelving:
|
|
||||||
list:
|
|
||||||
parking: Parking
|
|
||||||
priority: Priority
|
|
||||||
newShelving: New Shelving
|
|
||||||
summary:
|
|
||||||
recyclable: Recyclable
|
|
||||||
parking:
|
|
||||||
pickingOrder: Picking order
|
|
||||||
sector: Sector
|
|
||||||
row: Row
|
|
||||||
column: Column
|
|
||||||
searchBar:
|
|
||||||
info: You can search by parking code
|
|
||||||
label: Search parking...
|
|
||||||
department:
|
department:
|
||||||
chat: Chat
|
chat: Chat
|
||||||
bossDepartment: Boss Department
|
bossDepartment: Boss Department
|
||||||
|
@ -516,6 +477,24 @@ department:
|
||||||
hasToSendMail: Send check-ins by email
|
hasToSendMail: Send check-ins by email
|
||||||
departmentRemoved: Department removed
|
departmentRemoved: Department removed
|
||||||
worker:
|
worker:
|
||||||
|
pageTitles:
|
||||||
|
workers: Workers
|
||||||
|
list: List
|
||||||
|
basicData: Basic data
|
||||||
|
summary: Summary
|
||||||
|
notifications: Notifications
|
||||||
|
workerCreate: New worker
|
||||||
|
department: Department
|
||||||
|
pda: PDA
|
||||||
|
notes: Notas
|
||||||
|
dms: My documentation
|
||||||
|
pbx: Private Branch Exchange
|
||||||
|
log: Log
|
||||||
|
calendar: Calendar
|
||||||
|
timeControl: Time control
|
||||||
|
locker: Locker
|
||||||
|
balance: Balance
|
||||||
|
medical: Medical
|
||||||
list:
|
list:
|
||||||
department: Department
|
department: Department
|
||||||
schedule: Schedule
|
schedule: Schedule
|
||||||
|
@ -531,15 +510,24 @@ worker:
|
||||||
role: Role
|
role: Role
|
||||||
sipExtension: Extension
|
sipExtension: Extension
|
||||||
locker: Locker
|
locker: Locker
|
||||||
fiDueDate: FI due date
|
fiDueDate: DNI expiration date
|
||||||
sex: Sex
|
sex: Sex
|
||||||
seniority: Seniority
|
seniority: Antiquity
|
||||||
fi: DNI/NIE/NIF
|
fi: DNI/NIE/NIF
|
||||||
birth: Birth
|
birth: Birth
|
||||||
isFreelance: Freelance
|
isFreelance: Freelance
|
||||||
isSsDiscounted: SS Bonification
|
isSsDiscounted: SS Bonification
|
||||||
hasMachineryAuthorized: Machinery authorized
|
hasMachineryAuthorized: Machinery authorized
|
||||||
isDisable: Disable
|
isDisable: Disable
|
||||||
|
business: Business
|
||||||
|
started: Started
|
||||||
|
ended: Ended
|
||||||
|
reasonEnd: Reason End
|
||||||
|
department: Departament
|
||||||
|
workerBusinessCategory: Worker Business Category
|
||||||
|
notes: Notes
|
||||||
|
workCenter: Center
|
||||||
|
professionalCategory: Professional Category
|
||||||
notificationsManager:
|
notificationsManager:
|
||||||
activeNotifications: Active notifications
|
activeNotifications: Active notifications
|
||||||
availableNotifications: Available notifications
|
availableNotifications: Available notifications
|
||||||
|
@ -598,6 +586,23 @@ worker:
|
||||||
sizeLimit: Size limit
|
sizeLimit: Size limit
|
||||||
isOnReservationMode: Reservation mode
|
isOnReservationMode: Reservation mode
|
||||||
machine: Machine
|
machine: Machine
|
||||||
|
business:
|
||||||
|
tableVisibleColumns:
|
||||||
|
started: Start Date
|
||||||
|
ended: End Date
|
||||||
|
company: Company
|
||||||
|
reasonEnd: Reason for Termination
|
||||||
|
department: Department
|
||||||
|
professionalCategory: Professional Category
|
||||||
|
calendarType: Work Calendar
|
||||||
|
workCenter: Work Center
|
||||||
|
payrollCategories: Contract Category
|
||||||
|
occupationCode: Contribution Code
|
||||||
|
rate: Rate
|
||||||
|
businessType: Contract Type
|
||||||
|
amount: Salary
|
||||||
|
basicSalary: Transport Workers Salary
|
||||||
|
notes: Notes
|
||||||
wagon:
|
wagon:
|
||||||
type:
|
type:
|
||||||
submit: Submit
|
submit: Submit
|
||||||
|
@ -630,6 +635,8 @@ wagon:
|
||||||
name: Name
|
name: Name
|
||||||
|
|
||||||
supplier:
|
supplier:
|
||||||
|
search: Search supplier
|
||||||
|
searchInfo: Search supplier by id or name
|
||||||
list:
|
list:
|
||||||
payMethod: Pay method
|
payMethod: Pay method
|
||||||
account: Account
|
account: Account
|
||||||
|
@ -696,6 +703,9 @@ supplier:
|
||||||
consumption:
|
consumption:
|
||||||
entry: Entry
|
entry: Entry
|
||||||
travel:
|
travel:
|
||||||
|
search: Search travel
|
||||||
|
searchInfo: You can search by travel id or name
|
||||||
|
id: Id
|
||||||
travelList:
|
travelList:
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
ref: Reference
|
ref: Reference
|
||||||
|
@ -704,6 +714,7 @@ travel:
|
||||||
totalEntries: Total entries
|
totalEntries: Total entries
|
||||||
totalEntriesTooltip: Total entries
|
totalEntriesTooltip: Total entries
|
||||||
daysOnward: Landed days onwards
|
daysOnward: Landed days onwards
|
||||||
|
awb: AWB
|
||||||
summary:
|
summary:
|
||||||
entryId: Entry Id
|
entryId: Entry Id
|
||||||
freight: Freight
|
freight: Freight
|
||||||
|
@ -725,62 +736,7 @@ travel:
|
||||||
destination: Destination
|
destination: Destination
|
||||||
thermograph: Thermograph
|
thermograph: Thermograph
|
||||||
travelFileDescription: 'Travel id { travelId }'
|
travelFileDescription: 'Travel id { travelId }'
|
||||||
item:
|
carrier: Carrier
|
||||||
descriptor:
|
|
||||||
buyer: Buyer
|
|
||||||
color: Color
|
|
||||||
category: Category
|
|
||||||
available: Available
|
|
||||||
warehouseText: 'Calculated on the warehouse of { warehouseName }'
|
|
||||||
itemDiary: Item diary
|
|
||||||
list:
|
|
||||||
id: Identifier
|
|
||||||
stems: Stems
|
|
||||||
category: Category
|
|
||||||
typeName: Type
|
|
||||||
isActive: Active
|
|
||||||
userName: Buyer
|
|
||||||
weightByPiece: Weight/Piece
|
|
||||||
stemMultiplier: Multiplier
|
|
||||||
fixedPrice:
|
|
||||||
itemFk: Item ID
|
|
||||||
groupingPrice: Grouping price
|
|
||||||
packingPrice: Packing price
|
|
||||||
hasMinPrice: Has min price
|
|
||||||
minPrice: Min price
|
|
||||||
started: Started
|
|
||||||
ended: Ended
|
|
||||||
create:
|
|
||||||
priority: Priority
|
|
||||||
buyRequest:
|
|
||||||
requester: Requester
|
|
||||||
requested: Requested
|
|
||||||
attender: Atender
|
|
||||||
achieved: Achieved
|
|
||||||
concept: Concept
|
|
||||||
summary:
|
|
||||||
otherData: Other data
|
|
||||||
tax: Tax
|
|
||||||
botanical: Botanical
|
|
||||||
barcode: Barcode
|
|
||||||
completeName: Complete name
|
|
||||||
family: Familiy
|
|
||||||
stems: Stems
|
|
||||||
multiplier: Multiplier
|
|
||||||
buyer: Buyer
|
|
||||||
doPhoto: Do photo
|
|
||||||
intrastatCode: Intrastat code
|
|
||||||
ref: Reference
|
|
||||||
relevance: Relevance
|
|
||||||
weight: Weight (gram)/stem
|
|
||||||
units: Units/box
|
|
||||||
expense: Expense
|
|
||||||
generic: Generic
|
|
||||||
recycledPlastic: Recycled plastic
|
|
||||||
nonRecycledPlastic: Non recycled plastic
|
|
||||||
minSalesQuantity: Min sales quantity
|
|
||||||
genus: Genus
|
|
||||||
specie: Specie
|
|
||||||
components:
|
components:
|
||||||
topbar: {}
|
topbar: {}
|
||||||
itemsFilterPanel:
|
itemsFilterPanel:
|
||||||
|
|
|
@ -5,9 +5,11 @@ globals:
|
||||||
language: Idioma
|
language: Idioma
|
||||||
quantity: Cantidad
|
quantity: Cantidad
|
||||||
entity: Entidad
|
entity: Entidad
|
||||||
|
preview: Vista previa
|
||||||
user: Usuario
|
user: Usuario
|
||||||
details: Detalles
|
details: Detalles
|
||||||
collapseMenu: Contraer menú lateral
|
collapseMenu: Contraer menú lateral
|
||||||
|
advancedMenu: Menú avanzado
|
||||||
backToDashboard: Volver al tablón
|
backToDashboard: Volver al tablón
|
||||||
notifications: Notificaciones
|
notifications: Notificaciones
|
||||||
userPanel: Panel de usuario
|
userPanel: Panel de usuario
|
||||||
|
@ -53,11 +55,12 @@ globals:
|
||||||
today: Hoy
|
today: Hoy
|
||||||
yesterday: Ayer
|
yesterday: Ayer
|
||||||
dateFormat: es-ES
|
dateFormat: es-ES
|
||||||
noSelectedRows: No tienes ninguna línea seleccionada
|
|
||||||
microsip: Abrir en MicroSIP
|
microsip: Abrir en MicroSIP
|
||||||
|
noSelectedRows: No tienes ninguna línea seleccionada
|
||||||
downloadCSVSuccess: Descarga de CSV exitosa
|
downloadCSVSuccess: Descarga de CSV exitosa
|
||||||
reference: Referencia
|
reference: Referencia
|
||||||
agency: Agencia
|
agency: Agencia
|
||||||
|
entry: Entrada
|
||||||
warehouseOut: Alm. salida
|
warehouseOut: Alm. salida
|
||||||
warehouseIn: Alm. entrada
|
warehouseIn: Alm. entrada
|
||||||
landed: F. entrega
|
landed: F. entrega
|
||||||
|
@ -132,6 +135,26 @@ globals:
|
||||||
medium: Mediano/a
|
medium: Mediano/a
|
||||||
big: Grande
|
big: Grande
|
||||||
email: Correo
|
email: Correo
|
||||||
|
supplier: Proveedor
|
||||||
|
ticketList: Listado de tickets
|
||||||
|
created: Fecha creación
|
||||||
|
worker: Trabajador
|
||||||
|
now: Ahora
|
||||||
|
name: Nombre
|
||||||
|
new: Nuevo
|
||||||
|
comment: Comentario
|
||||||
|
observations: Observaciones
|
||||||
|
goToModuleIndex: Ir al índice del módulo
|
||||||
|
createInvoiceIn: Crear factura recibida
|
||||||
|
myAccount: Mi cuenta
|
||||||
|
noOne: Nadie
|
||||||
|
maxTemperature: Máx
|
||||||
|
minTemperature: Mín
|
||||||
|
changePass: Cambiar contraseña
|
||||||
|
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||||
|
changeState: Cambiar estado
|
||||||
|
raid: 'Redada {daysInForward} días'
|
||||||
|
isVies: Vies
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Inicio de sesión
|
logIn: Inicio de sesión
|
||||||
addressEdit: Modificar consignatario
|
addressEdit: Modificar consignatario
|
||||||
|
@ -154,17 +177,17 @@ globals:
|
||||||
inheritedRoles: Roles heredados
|
inheritedRoles: Roles heredados
|
||||||
customers: Clientes
|
customers: Clientes
|
||||||
customerCreate: Nuevo cliente
|
customerCreate: Nuevo cliente
|
||||||
|
createCustomer: Crear cliente
|
||||||
createOrder: Nuevo pedido
|
createOrder: Nuevo pedido
|
||||||
list: Listado
|
list: Listado
|
||||||
webPayments: Pagos Web
|
webPayments: Pagos Web
|
||||||
extendedList: Listado extendido
|
extendedList: Listado extendido
|
||||||
notifications: Notificaciones
|
notifications: Notificaciones
|
||||||
defaulter: Morosos
|
defaulter: Morosos
|
||||||
createCustomer: Crear cliente
|
|
||||||
fiscalData: Datos fiscales
|
fiscalData: Datos fiscales
|
||||||
billingData: Forma de pago
|
billingData: Forma de pago
|
||||||
consignees: Consignatarios
|
consignees: Consignatarios
|
||||||
'address-create': Nuevo consignatario
|
address-create: Nuevo consignatario
|
||||||
notes: Notas
|
notes: Notas
|
||||||
credits: Créditos
|
credits: Créditos
|
||||||
greuges: Greuges
|
greuges: Greuges
|
||||||
|
@ -230,10 +253,10 @@ globals:
|
||||||
wagonsList: Listado vagones
|
wagonsList: Listado vagones
|
||||||
wagonCreate: Crear tipo
|
wagonCreate: Crear tipo
|
||||||
wagonEdit: Editar tipo
|
wagonEdit: Editar tipo
|
||||||
|
wagonCounter: Contador de carros
|
||||||
typesList: Listado tipos
|
typesList: Listado tipos
|
||||||
typeCreate: Crear tipo
|
typeCreate: Crear tipo
|
||||||
typeEdit: Editar tipo
|
typeEdit: Editar tipo
|
||||||
wagonCounter: Contador de carros
|
|
||||||
roadmap: Troncales
|
roadmap: Troncales
|
||||||
stops: Paradas
|
stops: Paradas
|
||||||
routes: Rutas
|
routes: Rutas
|
||||||
|
@ -242,8 +265,8 @@ globals:
|
||||||
routeCreate: Nueva ruta
|
routeCreate: Nueva ruta
|
||||||
RouteRoadmap: Troncales
|
RouteRoadmap: Troncales
|
||||||
RouteRoadmapCreate: Crear troncal
|
RouteRoadmapCreate: Crear troncal
|
||||||
autonomous: Autónomos
|
|
||||||
RouteExtendedList: Enrutador
|
RouteExtendedList: Enrutador
|
||||||
|
autonomous: Autónomos
|
||||||
suppliers: Proveedores
|
suppliers: Proveedores
|
||||||
supplier: Proveedor
|
supplier: Proveedor
|
||||||
supplierCreate: Nuevo proveedor
|
supplierCreate: Nuevo proveedor
|
||||||
|
@ -303,29 +326,19 @@ globals:
|
||||||
ticketsMonitor: Monitor de tickets
|
ticketsMonitor: Monitor de tickets
|
||||||
clientsActionsMonitor: Clientes y acciones
|
clientsActionsMonitor: Clientes y acciones
|
||||||
serial: Facturas por serie
|
serial: Facturas por serie
|
||||||
|
business: Contratos
|
||||||
medical: Mutua
|
medical: Mutua
|
||||||
pit: IRPF
|
pit: IRPF
|
||||||
wasteRecalc: Recalcular mermas
|
wasteRecalc: Recalcular mermas
|
||||||
operator: Operario
|
operator: Operario
|
||||||
parking: Parking
|
parking: Parking
|
||||||
supplier: Proveedor
|
vehicleList: Vehículos
|
||||||
created: Fecha creación
|
vehicle: Vehículo
|
||||||
worker: Trabajador
|
|
||||||
now: Ahora
|
|
||||||
name: Nombre
|
|
||||||
new: Nuevo
|
|
||||||
comment: Comentario
|
|
||||||
observations: Observaciones
|
|
||||||
goToModuleIndex: Ir al índice del módulo
|
|
||||||
unsavedPopup:
|
unsavedPopup:
|
||||||
title: Los cambios que no haya guardado se perderán
|
title: Los cambios que no haya guardado se perderán
|
||||||
subtitle: ¿Seguro que quiere salir sin guardar?
|
subtitle: ¿Seguro que quiere salir sin guardar?
|
||||||
createInvoiceIn: Crear factura recibida
|
|
||||||
myAccount: Mi cuenta
|
|
||||||
noOne: Nadie
|
|
||||||
maxTemperature: Máx
|
|
||||||
minTemperature: Mín
|
|
||||||
params:
|
params:
|
||||||
|
description: Descripción
|
||||||
clientFk: Id cliente
|
clientFk: Id cliente
|
||||||
salesPersonFk: Comercial
|
salesPersonFk: Comercial
|
||||||
warehouseFk: Almacén
|
warehouseFk: Almacén
|
||||||
|
@ -339,20 +352,15 @@ globals:
|
||||||
from: Desde
|
from: Desde
|
||||||
to: Hasta
|
to: Hasta
|
||||||
supplierFk: Proveedor
|
supplierFk: Proveedor
|
||||||
supplierRef: Ref. proveedor
|
supplierRef: Nº factura
|
||||||
serial: Serie
|
serial: Serie
|
||||||
amount: Importe
|
amount: Importe
|
||||||
awbCode: AWB
|
awbCode: AWB
|
||||||
daysOnward: Días adelante
|
daysOnward: Días adelante
|
||||||
packing: ITP
|
packing: ITP
|
||||||
countryFk: País
|
countryFk: País
|
||||||
|
countryCodeFk: País
|
||||||
companyFk: Empresa
|
companyFk: Empresa
|
||||||
changePass: Cambiar contraseña
|
|
||||||
setPass: Establecer contraseña
|
|
||||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
|
||||||
changeState: Cambiar estado
|
|
||||||
raid: 'Redada {daysInForward} días'
|
|
||||||
isVies: Vies
|
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Acceso denegado
|
statusUnauthorized: Acceso denegado
|
||||||
statusInternalServerError: Ha ocurrido un error interno del servidor
|
statusInternalServerError: Ha ocurrido un error interno del servidor
|
||||||
|
@ -445,13 +453,18 @@ ticket:
|
||||||
purchaseRequest: Petición de compra
|
purchaseRequest: Petición de compra
|
||||||
service: Servicio
|
service: Servicio
|
||||||
attender: Consignatario
|
attender: Consignatario
|
||||||
|
consigneeStreet: Dirección
|
||||||
create:
|
create:
|
||||||
address: Dirección
|
address: Dirección
|
||||||
invoiceOut:
|
order:
|
||||||
card:
|
field:
|
||||||
issued: Fecha emisión
|
salesPersonFk: Comercial
|
||||||
customerCard: Ficha del cliente
|
form:
|
||||||
ticketList: Listado de tickets
|
clientFk: Cliente
|
||||||
|
addressFk: Dirección
|
||||||
|
agencyModeFk: Agencia
|
||||||
|
list:
|
||||||
|
newOrder: Nuevo Pedido
|
||||||
summary:
|
summary:
|
||||||
issued: Fecha
|
issued: Fecha
|
||||||
dued: Fecha límite
|
dued: Fecha límite
|
||||||
|
@ -462,47 +475,6 @@ invoiceOut:
|
||||||
fee: Cuota
|
fee: Cuota
|
||||||
tickets: Tickets
|
tickets: Tickets
|
||||||
totalWithVat: Importe
|
totalWithVat: Importe
|
||||||
globalInvoices:
|
|
||||||
errors:
|
|
||||||
chooseValidClient: Selecciona un cliente válido
|
|
||||||
chooseValidCompany: Selecciona una empresa válida
|
|
||||||
chooseValidPrinter: Selecciona una impresora válida
|
|
||||||
chooseValidSerialType: Selecciona una tipo de serie válida
|
|
||||||
fillDates: La fecha de la factura y la fecha máxima deben estar completas
|
|
||||||
invoiceDateLessThanMaxDate: La fecha de la factura no puede ser menor que la fecha máxima
|
|
||||||
invoiceWithFutureDate: Existe una factura con una fecha futura
|
|
||||||
noTicketsToInvoice: No existen tickets para facturar
|
|
||||||
criticalInvoiceError: Error crítico en la facturación proceso detenido
|
|
||||||
invalidSerialTypeForAll: El tipo de serie debe ser global cuando se facturan todos los clientes
|
|
||||||
table:
|
|
||||||
addressId: Id dirección
|
|
||||||
streetAddress: Dirección fiscal
|
|
||||||
statusCard:
|
|
||||||
percentageText: '{getPercentage}% {getAddressNumber} de {getNAddresses}'
|
|
||||||
pdfsNumberText: '{nPdfs} de {totalPdfs} PDFs'
|
|
||||||
negativeBases:
|
|
||||||
clientId: Id cliente
|
|
||||||
base: Base
|
|
||||||
active: Activo
|
|
||||||
hasToInvoice: Facturar
|
|
||||||
verifiedData: Datos comprobados
|
|
||||||
comercial: Comercial
|
|
||||||
errors:
|
|
||||||
downloadCsvFailed: Error al descargar CSV
|
|
||||||
shelving:
|
|
||||||
list:
|
|
||||||
parking: Parking
|
|
||||||
priority: Prioridad
|
|
||||||
newShelving: Nuevo Carro
|
|
||||||
summary:
|
|
||||||
recyclable: Reciclable
|
|
||||||
parking:
|
|
||||||
pickingOrder: Orden de recogida
|
|
||||||
row: Fila
|
|
||||||
column: Columna
|
|
||||||
searchBar:
|
|
||||||
info: Puedes buscar por código de parking
|
|
||||||
label: Buscar parking...
|
|
||||||
department:
|
department:
|
||||||
chat: Chat
|
chat: Chat
|
||||||
bossDepartment: Jefe de departamento
|
bossDepartment: Jefe de departamento
|
||||||
|
@ -514,6 +486,26 @@ department:
|
||||||
hasToSendMail: Enviar fichadas por mail
|
hasToSendMail: Enviar fichadas por mail
|
||||||
departmentRemoved: Departamento eliminado
|
departmentRemoved: Departamento eliminado
|
||||||
worker:
|
worker:
|
||||||
|
pageTitles:
|
||||||
|
workers: Trabajadores
|
||||||
|
list: Listado
|
||||||
|
basicData: Datos básicos
|
||||||
|
summary: Resumen
|
||||||
|
notifications: Notificaciones
|
||||||
|
workerCreate: Nuevo trabajador
|
||||||
|
department: Departamentos
|
||||||
|
pda: PDA
|
||||||
|
notes: Notas
|
||||||
|
dms: Mi documentación
|
||||||
|
pbx: Centralita
|
||||||
|
log: Historial
|
||||||
|
calendar: Calendario
|
||||||
|
timeControl: Control de horario
|
||||||
|
locker: Taquilla
|
||||||
|
balance: Balance
|
||||||
|
business: Contrato
|
||||||
|
formation: Formación
|
||||||
|
medical: Mutua
|
||||||
list:
|
list:
|
||||||
department: Departamento
|
department: Departamento
|
||||||
schedule: Horario
|
schedule: Horario
|
||||||
|
@ -538,6 +530,15 @@ worker:
|
||||||
isSsDiscounted: Bonificación SS
|
isSsDiscounted: Bonificación SS
|
||||||
hasMachineryAuthorized: Autorizado para maquinaria
|
hasMachineryAuthorized: Autorizado para maquinaria
|
||||||
isDisable: Deshabilitado
|
isDisable: Deshabilitado
|
||||||
|
business: Contrato
|
||||||
|
started: Antigüedad
|
||||||
|
ended: Fin
|
||||||
|
reasonEnd: Motivo finalización
|
||||||
|
department: Departamento
|
||||||
|
workerBusinessCategory: Categoria profesional
|
||||||
|
notes: Notas
|
||||||
|
workCenter: Centro
|
||||||
|
professionalCategory: Categoria profesional
|
||||||
notificationsManager:
|
notificationsManager:
|
||||||
activeNotifications: Notificaciones activas
|
activeNotifications: Notificaciones activas
|
||||||
availableNotifications: Notificaciones disponibles
|
availableNotifications: Notificaciones disponibles
|
||||||
|
@ -584,6 +585,23 @@ worker:
|
||||||
debit: Debe
|
debit: Debe
|
||||||
credit: Haber
|
credit: Haber
|
||||||
concept: Concepto
|
concept: Concepto
|
||||||
|
business:
|
||||||
|
tableVisibleColumns:
|
||||||
|
started: Fecha inicio
|
||||||
|
ended: Fecha fin
|
||||||
|
company: Empresa
|
||||||
|
reasonEnd: Motivo finalización
|
||||||
|
department: Departamento
|
||||||
|
professionalCategory: Categoria profesional
|
||||||
|
calendarType: Calendario laboral
|
||||||
|
workCenter: Centro
|
||||||
|
payrollCategories: Categoria contrato
|
||||||
|
occupationCode: Cotización
|
||||||
|
rate: Tarifa
|
||||||
|
businessType: Contrato
|
||||||
|
amount: Salario
|
||||||
|
basicSalary: Salario transportistas
|
||||||
|
notes: Notas
|
||||||
operator:
|
operator:
|
||||||
numberOfWagons: Número de vagones
|
numberOfWagons: Número de vagones
|
||||||
train: tren
|
train: tren
|
||||||
|
@ -596,7 +614,6 @@ worker:
|
||||||
sizeLimit: Tamaño límite
|
sizeLimit: Tamaño límite
|
||||||
isOnReservationMode: Modo de reserva
|
isOnReservationMode: Modo de reserva
|
||||||
machine: Máquina
|
machine: Máquina
|
||||||
|
|
||||||
wagon:
|
wagon:
|
||||||
type:
|
type:
|
||||||
submit: Guardar
|
submit: Guardar
|
||||||
|
@ -627,6 +644,8 @@ wagon:
|
||||||
volume: Volumen
|
volume: Volumen
|
||||||
name: Nombre
|
name: Nombre
|
||||||
supplier:
|
supplier:
|
||||||
|
search: Buscar proveedor
|
||||||
|
searchInfo: Buscar proveedor por id o nombre
|
||||||
list:
|
list:
|
||||||
payMethod: Método de pago
|
payMethod: Método de pago
|
||||||
account: Cuenta
|
account: Cuenta
|
||||||
|
@ -634,6 +653,7 @@ supplier:
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
nif: NIF/CIF
|
nif: NIF/CIF
|
||||||
account: Cuenta
|
account: Cuenta
|
||||||
|
|
||||||
summary:
|
summary:
|
||||||
responsible: Responsable
|
responsible: Responsable
|
||||||
verified: Verificado
|
verified: Verificado
|
||||||
|
@ -692,6 +712,9 @@ supplier:
|
||||||
consumption:
|
consumption:
|
||||||
entry: Entrada
|
entry: Entrada
|
||||||
travel:
|
travel:
|
||||||
|
search: Buscar envío
|
||||||
|
searchInfo: Buscar envío por id o nombre
|
||||||
|
id: Id
|
||||||
travelList:
|
travelList:
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
ref: Referencia
|
ref: Referencia
|
||||||
|
@ -700,6 +723,7 @@ travel:
|
||||||
totalEntries: ∑
|
totalEntries: ∑
|
||||||
totalEntriesTooltip: Entradas totales
|
totalEntriesTooltip: Entradas totales
|
||||||
daysOnward: Días de llegada en adelante
|
daysOnward: Días de llegada en adelante
|
||||||
|
awb: AWB
|
||||||
summary:
|
summary:
|
||||||
entryId: Id entrada
|
entryId: Id entrada
|
||||||
freight: Porte
|
freight: Porte
|
||||||
|
@ -721,62 +745,7 @@ travel:
|
||||||
destination: Destino
|
destination: Destino
|
||||||
thermograph: Termógrafo
|
thermograph: Termógrafo
|
||||||
travelFileDescription: 'Id envío { travelId }'
|
travelFileDescription: 'Id envío { travelId }'
|
||||||
item:
|
carrier: Transportista
|
||||||
descriptor:
|
|
||||||
buyer: Comprador
|
|
||||||
color: Color
|
|
||||||
category: Categoría
|
|
||||||
available: Disponible
|
|
||||||
warehouseText: 'Calculado sobre el almacén de { warehouseName }'
|
|
||||||
itemDiary: Registro de compra-venta
|
|
||||||
list:
|
|
||||||
id: Identificador
|
|
||||||
stems: Tallos
|
|
||||||
category: Reino
|
|
||||||
typeName: Tipo
|
|
||||||
isActive: Activo
|
|
||||||
weightByPiece: Peso (gramos)/tallo
|
|
||||||
userName: Comprador
|
|
||||||
stemMultiplier: Multiplicador
|
|
||||||
fixedPrice:
|
|
||||||
itemFk: ID Artículo
|
|
||||||
groupingPrice: Precio grouping
|
|
||||||
packingPrice: Precio packing
|
|
||||||
hasMinPrice: Tiene precio mínimo
|
|
||||||
minPrice: Precio min
|
|
||||||
started: Inicio
|
|
||||||
ended: Fin
|
|
||||||
create:
|
|
||||||
priority: Prioridad
|
|
||||||
summary:
|
|
||||||
otherData: Otros datos
|
|
||||||
tax: IVA
|
|
||||||
botanical: Botánico
|
|
||||||
barcode: Código de barras
|
|
||||||
completeName: Nombre completo
|
|
||||||
family: Familia
|
|
||||||
stems: Tallos
|
|
||||||
multiplier: Multiplicador
|
|
||||||
buyer: Comprador
|
|
||||||
doPhoto: Hacer foto
|
|
||||||
intrastatCode: Código intrastat
|
|
||||||
ref: Referencia
|
|
||||||
relevance: Relevancia
|
|
||||||
weight: Peso (gramos)/tallo
|
|
||||||
units: Unidades/caja
|
|
||||||
expense: Gasto
|
|
||||||
generic: Genérico
|
|
||||||
recycledPlastic: Plástico reciclado
|
|
||||||
nonRecycledPlastic: Plástico no reciclado
|
|
||||||
minSalesQuantity: Cantidad mínima de venta
|
|
||||||
genus: Genus
|
|
||||||
specie: Specie
|
|
||||||
buyRequest:
|
|
||||||
requester: Solicitante
|
|
||||||
requested: Solicitado
|
|
||||||
attender: Comprador
|
|
||||||
achieved: Conseguido
|
|
||||||
concept: Concepto
|
|
||||||
components:
|
components:
|
||||||
topbar: {}
|
topbar: {}
|
||||||
itemsFilterPanel:
|
itemsFilterPanel:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import Navbar from 'src/components/NavBar.vue';
|
import Navbar from 'src/components/NavBar.vue';
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QLayout view="hHh LpR fFf" v-shortcut>
|
<QLayout view="hHh LpR fFf">
|
||||||
<Navbar />
|
<Navbar />
|
||||||
<RouterView></RouterView>
|
<RouterView></RouterView>
|
||||||
<QFooter v-if="$q.platform.is.mobile"></QFooter>
|
<QFooter v-if="$q.platform.is.mobile"></QFooter>
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Dark, Quasar } from 'quasar';
|
import { Dark, Quasar } from 'quasar';
|
||||||
import { computed } from 'vue';
|
import { computed, onMounted } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { localeEquivalence } from 'src/i18n/index';
|
||||||
|
import quasarLang from 'src/utils/quasarLang';
|
||||||
|
import { langs } from 'src/boot/defaults/constants.js';
|
||||||
|
|
||||||
const { t, locale } = useI18n();
|
const { t, locale } = useI18n();
|
||||||
|
|
||||||
const userLocale = computed({
|
const userLocale = computed({
|
||||||
get() {
|
get() {
|
||||||
return locale.value;
|
return locale.value;
|
||||||
|
@ -12,18 +14,9 @@ const userLocale = computed({
|
||||||
set(value) {
|
set(value) {
|
||||||
locale.value = value;
|
locale.value = value;
|
||||||
|
|
||||||
if (value === 'en') value = 'en-GB';
|
value = localeEquivalence[value] ?? value;
|
||||||
|
|
||||||
// FIXME: Dynamic imports from absolute paths are not compatible with vite:
|
quasarLang(value);
|
||||||
// https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations
|
|
||||||
try {
|
|
||||||
const langList = import.meta.glob('../../node_modules/quasar/lang/*.mjs');
|
|
||||||
langList[`../../node_modules/quasar/lang/${value}.mjs`]().then((lang) => {
|
|
||||||
Quasar.lang.set(lang.default);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -35,7 +28,6 @@ const darkMode = computed({
|
||||||
Dark.set(value);
|
Dark.set(value);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const langs = ['en', 'es'];
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
import exprBuilder from './Alias/AliasExprBuilder';
|
||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -31,15 +32,6 @@ const columns = computed(() => [
|
||||||
create: true,
|
create: true,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const exprBuilder = (param, value) => {
|
|
||||||
switch (param) {
|
|
||||||
case 'search':
|
|
||||||
return /^\d+$/.test(value)
|
|
||||||
? { id: value }
|
|
||||||
: { alias: { like: `%${value}%` } };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -46,7 +46,7 @@ const killSession = async ({ userId, created }) => {
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
:data-key="urlPath"
|
:data-key="urlPath"
|
||||||
ref="paginateRef"
|
ref="paginateRef"
|
||||||
:filter="filter"
|
:user-filter="filter"
|
||||||
:url="urlPath"
|
:url="urlPath"
|
||||||
order="created DESC"
|
order="created DESC"
|
||||||
auto-load
|
auto-load
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
export default (param, value) => {
|
||||||
|
switch (param) {
|
||||||
|
case 'search':
|
||||||
|
return /^\d+$/.test(value)
|
||||||
|
? { id: value }
|
||||||
|
: {
|
||||||
|
or: [
|
||||||
|
{ name: { like: `%${value}%` } },
|
||||||
|
{ nickname: { like: `%${value}%` } },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
case 'name':
|
||||||
|
case 'nickname':
|
||||||
|
return { [param]: { like: `%${value}%` } };
|
||||||
|
case 'roleFk':
|
||||||
|
return { [param]: value };
|
||||||
|
}
|
||||||
|
};
|
|
@ -4,15 +4,16 @@ import { computed, ref } from 'vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import AccountSummary from './Card/AccountSummary.vue';
|
import AccountSummary from './Card/AccountSummary.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
|
import exprBuilder from './AccountExprBuilder.js';
|
||||||
|
import filter from './Card/AccountFilter.js';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const filter = {
|
const tableRef = ref();
|
||||||
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
|
|
||||||
};
|
|
||||||
const dataKey = 'AccountList';
|
const dataKey = 'AccountList';
|
||||||
const roles = ref([]);
|
const roles = ref([]);
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -117,25 +118,6 @@ const columns = computed(() => [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function exprBuilder(param, value) {
|
|
||||||
switch (param) {
|
|
||||||
case 'search':
|
|
||||||
return /^\d+$/.test(value)
|
|
||||||
? { id: value }
|
|
||||||
: {
|
|
||||||
or: [
|
|
||||||
{ name: { like: `%${value}%` } },
|
|
||||||
{ nickname: { like: `%${value}%` } },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
case 'name':
|
|
||||||
case 'nickname':
|
|
||||||
return { [param]: { like: `%${value}%` } };
|
|
||||||
case 'roleFk':
|
|
||||||
return { [param]: value };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="VnRoles" @on-fetch="(data) => (roles = data)" auto-load />
|
<FetchData url="VnRoles" @on-fetch="(data) => (roles = data)" auto-load />
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
export default (param, value) => {
|
||||||
|
switch (param) {
|
||||||
|
case 'search':
|
||||||
|
return /^\d+$/.test(value)
|
||||||
|
? { id: value }
|
||||||
|
: { alias: { like: `%${value}%` } };
|
||||||
|
}
|
||||||
|
};
|
|
@ -1,21 +1,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||||
import AliasDescriptor from './AliasDescriptor.vue';
|
import AliasDescriptor from './AliasDescriptor.vue';
|
||||||
const { t } = useI18n();
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnCardBeta
|
<VnCardBeta
|
||||||
data-key="Alias"
|
data-key="Alias"
|
||||||
base-url="MailAliases"
|
url="MailAliases"
|
||||||
:descriptor="AliasDescriptor"
|
:descriptor="AliasDescriptor"
|
||||||
search-data-key="AccountAliasList"
|
search-data-key="AccountAliasList"
|
||||||
:searchbar-props="{
|
|
||||||
url: 'MailAliases',
|
|
||||||
info: t('mailAlias.searchInfo'),
|
|
||||||
label: t('mailAlias.search'),
|
|
||||||
searchUrl: 'table',
|
|
||||||
}"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { useQuasar } from 'quasar';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
|
||||||
|
@ -29,9 +28,6 @@ const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = ref(useCardDescription());
|
|
||||||
const setData = (entity) => (data.value = useCardDescription(entity.alias, entity.id));
|
|
||||||
|
|
||||||
const removeAlias = () => {
|
const removeAlias = () => {
|
||||||
quasar
|
quasar
|
||||||
.dialog({
|
.dialog({
|
||||||
|
@ -56,10 +52,8 @@ const removeAlias = () => {
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
:url="`MailAliases/${entityId}`"
|
:url="`MailAliases/${entityId}`"
|
||||||
module="Alias"
|
module="Alias"
|
||||||
@on-fetch="setData"
|
data-key="Alias"
|
||||||
data-key="aliasData"
|
title="alias"
|
||||||
:title="data.title"
|
|
||||||
:subtitle="data.subtitle"
|
|
||||||
>
|
>
|
||||||
<template #menu>
|
<template #menu>
|
||||||
<QItem v-ripple clickable @click="removeAlias()">
|
<QItem v-ripple clickable @click="removeAlias()">
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import CardSummary from 'components/ui/CardSummary.vue';
|
import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
@ -18,20 +16,15 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { store } = useArrayData('Alias');
|
|
||||||
const alias = ref(store.data);
|
|
||||||
const entityId = computed(() => $props.id || route.params.id);
|
const entityId = computed(() => $props.id || route.params.id);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardSummary
|
<CardSummary ref="summary" :url="`MailAliases/${entityId}`" data-key="Alias">
|
||||||
ref="summary"
|
<template #header="{ entity: alias }">
|
||||||
:url="`MailAliases/${entityId}`"
|
{{ alias.id }} - {{ alias.alias }}
|
||||||
@on-fetch="(data) => (alias = data)"
|
</template>
|
||||||
data-key="MailAliasesSummary"
|
<template #body="{ entity: alias }">
|
||||||
>
|
|
||||||
<template #header> {{ alias.id }} - {{ alias.alias }} </template>
|
|
||||||
<template #body>
|
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<QCardSection class="q-pa-none">
|
<QCardSection class="q-pa-none">
|
||||||
<router-link
|
<router-link
|
||||||
|
|
|
@ -69,7 +69,7 @@ const fetchAliases = () => paginateRef.value.fetch();
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
ref="paginateRef"
|
ref="paginateRef"
|
||||||
data-key="AliasUsers"
|
data-key="AliasUsers"
|
||||||
:filter="filter"
|
:user-filter="filter"
|
||||||
:url="urlPath"
|
:url="urlPath"
|
||||||
:limit="0"
|
:limit="0"
|
||||||
auto-load
|
auto-load
|
||||||
|
|
|
@ -1,46 +1,20 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
|
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import { ref, watch } from 'vue';
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const { t } = useI18n();
|
|
||||||
const formModelRef = ref(null);
|
|
||||||
|
|
||||||
const accountFilter = {
|
|
||||||
where: { id: route.params.id },
|
|
||||||
fields: ['id', 'email', 'nickname', 'name', 'accountStateFk', 'packages', 'pickup'],
|
|
||||||
include: [],
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => route.params.id,
|
|
||||||
() => formModelRef.value.reset()
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FormModel
|
<FormModel :url-update="`VnUsers/${$route.params.id}/update-user`" model="Account">
|
||||||
ref="formModelRef"
|
|
||||||
url="VnUsers/preview"
|
|
||||||
:url-update="`VnUsers/${route.params.id}/update-user`"
|
|
||||||
:filter="accountFilter"
|
|
||||||
model="Accounts"
|
|
||||||
auto-load
|
|
||||||
@on-data-saved="formModelRef.fetch()"
|
|
||||||
>
|
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<div class="q-gutter-y-sm">
|
<div class="q-gutter-y-sm">
|
||||||
<VnInput v-model="data.name" :label="t('account.card.nickname')" />
|
<VnInput v-model="data.name" :label="$t('account.card.nickname')" />
|
||||||
<VnInput v-model="data.nickname" :label="t('account.card.alias')" />
|
<VnInput v-model="data.nickname" :label="$t('account.card.alias')" />
|
||||||
<VnInput v-model="data.email" :label="t('globals.params.email')" />
|
<VnInput v-model="data.email" :label="$t('globals.params.email')" />
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Languages"
|
url="Languages"
|
||||||
v-model="data.lang"
|
v-model="data.lang"
|
||||||
:label="t('account.card.lang')"
|
:label="$t('account.card.lang')"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="code"
|
option-label="code"
|
||||||
/>
|
/>
|
||||||
|
@ -49,7 +23,7 @@ watch(
|
||||||
table="user"
|
table="user"
|
||||||
column="twoFactor"
|
column="twoFactor"
|
||||||
v-model="data.twoFactor"
|
v-model="data.twoFactor"
|
||||||
:label="t('account.card.twoFactor')"
|
:label="$t('account.card.twoFactor')"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="code"
|
option-label="code"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||||
import AccountDescriptor from './AccountDescriptor.vue';
|
import AccountDescriptor from './AccountDescriptor.vue';
|
||||||
|
import filter from './AccountFilter.js';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnCardBeta data-key="AccountId" :descriptor="AccountDescriptor" />
|
<VnCardBeta
|
||||||
|
url="VnUsers/preview"
|
||||||
|
:id-in-where="true"
|
||||||
|
data-key="Account"
|
||||||
|
:descriptor="AccountDescriptor"
|
||||||
|
:filter="filter"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,36 +1,18 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
|
||||||
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
|
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
import filter from './AccountFilter.js';
|
||||||
import useHasAccount from 'src/composables/useHasAccount.js';
|
import useHasAccount from 'src/composables/useHasAccount.js';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({ id: { type: Number, default: null } });
|
||||||
id: {
|
|
||||||
type: Number,
|
|
||||||
required: false,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const entityId = computed(() => $props.id || route.params.id);
|
||||||
const entityId = computed(() => {
|
|
||||||
return $props.id || route.params.id;
|
|
||||||
});
|
|
||||||
const data = ref(useCardDescription());
|
|
||||||
const hasAccount = ref();
|
const hasAccount = ref();
|
||||||
const setData = (entity) => (data.value = useCardDescription(entity.nickname, entity.id));
|
|
||||||
|
|
||||||
const filter = {
|
|
||||||
where: { id: entityId },
|
|
||||||
fields: ['id', 'nickname', 'name', 'role'],
|
|
||||||
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
hasAccount.value = await useHasAccount(entityId.value);
|
hasAccount.value = await useHasAccount(entityId.value);
|
||||||
|
@ -43,10 +25,8 @@ onMounted(async () => {
|
||||||
:url="`VnUsers/preview`"
|
:url="`VnUsers/preview`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
module="Account"
|
module="Account"
|
||||||
@on-fetch="setData"
|
data-key="Account"
|
||||||
data-key="AccountId"
|
title="nickname"
|
||||||
:title="data.title"
|
|
||||||
:subtitle="data.subtitle"
|
|
||||||
>
|
>
|
||||||
<template #menu>
|
<template #menu>
|
||||||
<AccountDescriptorMenu :entity-id="entityId" />
|
<AccountDescriptorMenu :entity-id="entityId" />
|
||||||
|
@ -62,7 +42,7 @@ onMounted(async () => {
|
||||||
<QIcon name="vn:claims" />
|
<QIcon name="vn:claims" />
|
||||||
</div>
|
</div>
|
||||||
<div class="text-grey-5" style="opacity: 0.4">
|
<div class="text-grey-5" style="opacity: 0.4">
|
||||||
{{ t('account.imageNotFound') }}
|
{{ $t('account.imageNotFound') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -70,8 +50,8 @@ onMounted(async () => {
|
||||||
</VnImg>
|
</VnImg>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('account.card.nickname')" :value="entity.name" />
|
<VnLv :label="$t('account.card.nickname')" :value="entity.name" />
|
||||||
<VnLv :label="t('account.card.role')" :value="entity.role.name" />
|
<VnLv :label="$t('account.card.role')" :value="entity.role?.name" />
|
||||||
</template>
|
</template>
|
||||||
<template #actions="{ entity }">
|
<template #actions="{ entity }">
|
||||||
<QCardActions class="q-gutter-x-md">
|
<QCardActions class="q-gutter-x-md">
|
||||||
|
@ -84,7 +64,7 @@ onMounted(async () => {
|
||||||
size="sm"
|
size="sm"
|
||||||
class="fill-icon"
|
class="fill-icon"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('account.card.deactivated') }}</QTooltip>
|
<QTooltip>{{ $t('account.card.deactivated') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -95,7 +75,7 @@ onMounted(async () => {
|
||||||
size="sm"
|
size="sm"
|
||||||
class="fill-icon"
|
class="fill-icon"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('account.card.enabled') }}</QTooltip>
|
<QTooltip>{{ $t('account.card.enabled') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue