Compare commits
334 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9f562faa4 | ||
|
|
b8b76cb96c | ||
|
|
fa958cbbfe | ||
|
|
2146672916 | ||
|
|
f96460f332 | ||
|
|
04c70876d0 | ||
|
|
bc6a94eede | ||
|
|
f288b0ee22 | ||
|
|
e54692928b | ||
|
|
0fd8bcb1b1 | ||
|
|
07b18836f5 | ||
|
|
ff08d19d79 | ||
|
|
bd6f300c8d | ||
|
|
ac2fbaf6f7 | ||
|
|
f409acc7fd | ||
|
|
06dcb20b2b | ||
|
|
f4fed0db9d | ||
|
|
8430f500ef | ||
|
|
68584243f4 | ||
|
|
c8f5c3ed9e | ||
|
|
994d7e17aa | ||
|
|
fd1dd6dddd | ||
|
|
1e9b82ba1e | ||
|
|
312795618e | ||
|
|
35b5645d6f | ||
|
|
a49d845f50 | ||
|
|
9d44540ca8 | ||
|
|
cc95d3bd44 | ||
|
|
648c47cde2 | ||
|
|
17cf6e7696 | ||
|
|
7326ffbae6 | ||
|
|
b2f73c4fba | ||
|
|
6628d43e12 | ||
|
|
596132b2af | ||
|
|
a064b8e07e | ||
|
|
a55102b0ae | ||
|
|
9b75993ac1 | ||
|
|
d5e750c1f0 | ||
|
|
8801990d4a | ||
|
|
e8cda88a33 | ||
|
|
a240391a28 | ||
|
|
42660a7dd1 | ||
|
|
f186d9f8be | ||
|
|
71a74c5437 | ||
|
|
6fe4d982f5 | ||
|
|
5ec032d8d6 | ||
|
|
3f58f9a5f5 | ||
|
|
2718a66fb0 | ||
|
|
4c737371e3 | ||
|
|
ee7a3d0bdf | ||
|
|
181af581e5 | ||
|
|
85fcd64220 | ||
|
|
11e2f5d83d | ||
|
|
cbc723fa38 | ||
|
|
da41668b3f | ||
|
|
df008abec9 | ||
|
|
8a97c5109f | ||
|
|
d767302c4a | ||
|
|
2fdb06fabe | ||
|
|
32bb04939f | ||
|
|
9cddc9cce0 | ||
|
|
95c310119f | ||
|
|
ebe1facbd1 | ||
|
|
ed023cd62a | ||
|
|
b1ca423a59 | ||
|
|
85d25862eb | ||
|
|
b8c56c5c24 | ||
|
|
276771a8b7 | ||
|
|
b2239351f6 | ||
|
|
b021992552 | ||
|
|
f5be07d028 | ||
|
|
1202b86529 | ||
|
|
29c99f2dd9 | ||
|
|
3033e84f45 | ||
|
|
0e218abbf4 | ||
|
|
0cf7961d7d | ||
|
|
ca02937461 | ||
|
|
fa7e0a107b | ||
|
|
9ccffd73ba | ||
|
|
f68ad181e4 | ||
|
|
23bd6085a8 | ||
|
|
18966476e4 | ||
|
|
e4325e39bf | ||
|
|
584c2e5de2 | ||
|
|
eccc992cfa | ||
|
|
f293e80d0d | ||
|
|
eea2a758b0 | ||
|
|
8d7d4ab4ac | ||
|
|
f9105806ba | ||
|
|
acd278f5b4 | ||
|
|
a4a6fac224 | ||
|
|
b2b7064007 | ||
|
|
4a56fbb135 | ||
|
|
e1fcb0ecba | ||
|
|
ee5e091118 | ||
|
|
9f46f8ec31 | ||
|
|
8c737ff0ae | ||
|
|
a8ef681cf1 | ||
|
|
494c8b6867 | ||
|
|
262b5600d8 | ||
|
|
a06d3c9365 | ||
|
|
1861bd68d1 | ||
|
|
348561c812 | ||
|
|
bf4a52b3c1 | ||
|
|
1950023f37 | ||
|
|
a2798a02b3 | ||
|
|
5fcb5a3a3e | ||
|
|
ba41b29538 | ||
|
|
8a0916a47f | ||
|
|
d187ed6f73 | ||
|
|
13a57406d9 | ||
|
|
68c1ac3e70 | ||
|
|
2f267a9f2c | ||
|
|
3bc6504ae6 | ||
|
|
c7f293ceca | ||
|
|
66e60e96ad | ||
|
|
54a9beb37f | ||
|
|
779cc7d9e8 | ||
|
|
c1b3df9c3b | ||
|
|
80379cdd79 | ||
|
|
e2e5f3f885 | ||
|
|
d6fbf02092 | ||
|
|
7a88dd1aae | ||
|
|
91c3ac56fa | ||
|
|
521aa81591 | ||
|
|
d70fee6125 | ||
|
|
7d21cb7d70 | ||
|
|
1a8fad26e5 | ||
|
|
d69050f006 | ||
|
|
abe1e80844 | ||
|
|
58e897db31 | ||
|
|
b7ed6734a0 | ||
|
|
7d5a866a5c | ||
|
|
23becf6494 | ||
|
|
64ee2c1526 | ||
|
|
c033c0fbc5 | ||
|
|
f8ddfeb7d0 | ||
|
|
bc42d19dff | ||
|
|
c4f7c57c24 | ||
|
|
c0bf829dc0 | ||
|
|
51cd61c932 | ||
|
|
4ab77de591 | ||
|
|
acc6633271 | ||
|
|
2336617077 | ||
|
|
836e9b846a | ||
|
|
897efde14d | ||
|
|
98f7147378 | ||
|
|
fd01746f7d | ||
|
|
54b8f564e4 | ||
|
|
591284c972 | ||
|
|
9e0dae2adf | ||
|
|
4155203e88 | ||
|
|
24a92e69f2 | ||
|
|
4ec171d93b | ||
|
|
c9cd4c51e8 | ||
|
|
e0f4b6daf2 | ||
|
|
608988c67c | ||
|
|
9f6854c87b | ||
|
|
8cee795d70 | ||
|
|
8da4d0b0f1 | ||
|
|
75ef93f0e2 | ||
|
|
c0dc5f50e3 | ||
|
|
a54668e030 | ||
|
|
53f0ec6c63 | ||
|
|
af03a1b4e3 | ||
|
|
f645498743 | ||
|
|
b3c948f0c7 | ||
|
|
b955eb01b4 | ||
|
|
39640d254a | ||
|
|
2386457cf5 | ||
|
|
206257ed3b | ||
|
|
45944ae8c9 | ||
|
|
53d15b0d45 | ||
|
|
a630fc5556 | ||
|
|
532eb842b3 | ||
|
|
d315617d87 | ||
|
|
2c32a4891b | ||
|
|
d869dbe97b | ||
|
|
1ece04ed3e | ||
|
|
b8a298fc28 | ||
|
|
2b9fe61d79 | ||
|
|
7fdf109e14 | ||
|
|
95751103a2 | ||
|
|
2209f49696 | ||
|
|
c7a2c8209a | ||
|
|
e1b00f5081 | ||
|
|
8ca4c5d7fa | ||
|
|
cfbf59cd48 | ||
|
|
6a09209659 | ||
|
|
962f471f0f | ||
|
|
cec5f6e6e7 | ||
|
|
82acaa35e1 | ||
|
|
cc7cea7139 | ||
|
|
eaea73a955 | ||
|
|
77e966dfe1 | ||
|
|
b052e97b73 | ||
|
|
92a5c27da4 | ||
|
|
09b8a05b5a | ||
|
|
9949d12317 | ||
|
|
e5d55f27b5 | ||
|
|
bfde72eed8 | ||
|
|
8fbd08d57f | ||
|
|
20bddb43b6 | ||
|
|
b38e0f611b | ||
|
|
c84fbcaba1 | ||
|
|
8f752d575a | ||
|
|
2fe9ae513d | ||
|
|
0001604552 | ||
|
|
5cb93b1a2c | ||
|
|
a04dcffc4c | ||
|
|
50c99f7a1e | ||
|
|
86f3179bc0 | ||
|
|
6336e7568f | ||
|
|
2b9e0932bd | ||
|
|
f0f199335c | ||
|
|
9c7c9f4b6d | ||
|
|
9001ceaed8 | ||
|
|
ab82e85c57 | ||
|
|
2effe5ef50 | ||
|
|
006a2a5dca | ||
|
|
43b1ad78a3 | ||
|
|
d9c9466953 | ||
|
|
6b3fb00cc0 | ||
|
|
8d2bdb171b | ||
|
|
3fc24677c5 | ||
|
|
5d7eabbfa9 | ||
|
|
a2ada7d88e | ||
|
|
b741e29374 | ||
|
|
3a6af12446 | ||
|
|
b490ab96be | ||
|
|
08d50f90d6 | ||
|
|
ca462f51ec | ||
|
|
44721019fa | ||
|
|
29bbf4badb | ||
|
|
8ed81e9aed | ||
|
|
15ba2a1caf | ||
|
|
aad22f2e2d | ||
|
|
7a11b18037 | ||
|
|
241322fa30 | ||
|
|
f0461270de | ||
|
|
c85a5eb208 | ||
|
|
801cd724ac | ||
|
|
e7567fdaac | ||
|
|
1dbfe24111 | ||
|
|
da2bec67bf | ||
|
|
f3d8ca5711 | ||
|
|
299d838ab9 | ||
|
|
e3340fe408 | ||
|
|
79a9b534f9 | ||
|
|
9a49d1c69e | ||
|
|
352551e421 | ||
|
|
bf5c61bd86 | ||
|
|
f8902efcea | ||
|
|
3183baf560 | ||
|
|
4433f0f57f | ||
|
|
eacadc01bd | ||
|
|
9ccbca2678 | ||
|
|
d2db8c68f3 | ||
|
|
ef166a930a | ||
|
|
20252c61c6 | ||
|
|
54dcdb49d3 | ||
|
|
0adb6413e4 | ||
|
|
f41416645f | ||
|
|
4468a5be2d | ||
|
|
68b711038c | ||
|
|
8f3c71ca07 | ||
|
|
0c360e48cc | ||
|
|
40e75b491b | ||
|
|
47182c3e99 | ||
|
|
cc2261d711 | ||
|
|
c6bdb49569 | ||
|
|
82a76a5e3a | ||
|
|
fd7e9c9d3b | ||
|
|
05a21e8586 | ||
|
|
49c3ff9043 | ||
|
|
afc5df7f09 | ||
|
|
e118e5bcd5 | ||
|
|
95ffeeefcd | ||
|
|
dba41e7732 | ||
|
|
a715fccd47 | ||
|
|
4f6e1ffc9a | ||
|
|
c07efad729 | ||
|
|
f65993d097 | ||
|
|
f65ab128f9 | ||
|
|
b2a7fee021 | ||
|
|
bcba161ab5 | ||
|
|
2f04ddc5de | ||
|
|
25d567fd2e | ||
|
|
84fa129396 | ||
|
|
e6bc52acc6 | ||
|
|
fc3fc7fa9b | ||
|
|
3a4f18ef2d | ||
|
|
2653db5404 | ||
|
|
6435d2f283 | ||
|
|
4c8e930eaa | ||
|
|
fcd5183189 | ||
|
|
1c062f0310 | ||
|
|
042fafe281 | ||
|
|
f5307c9a42 | ||
|
|
9156c25f32 | ||
|
|
30d0c28f72 | ||
|
|
39bd490d43 | ||
|
|
3015d06219 | ||
|
|
a0c814775a | ||
|
|
bff56ccc96 | ||
|
|
34e5a86a79 | ||
|
|
1719da3402 | ||
|
|
8640b94714 | ||
|
|
5593a9fa80 | ||
|
|
b4bffcde2b | ||
|
|
ff6e1d535b | ||
|
|
4139626814 | ||
|
|
d8dcc1a5dd | ||
|
|
0aca25802c | ||
|
|
0fdafdf1a6 | ||
|
|
0ccdc1ffb7 | ||
|
|
f455892a12 | ||
|
|
06c1f55969 | ||
|
|
2890c7d43c | ||
|
|
dfab2e5fed | ||
|
|
4fc31f60b8 | ||
|
|
480a45a7ef | ||
|
|
50df34a4dc | ||
|
|
880d87707e | ||
|
|
382492c284 | ||
|
|
b24a0ea2d7 | ||
|
|
d0df81796a | ||
|
|
190b1a64e8 | ||
|
|
899699a38a | ||
|
|
ff2e4b9d3a | ||
|
|
8bb6898520 | ||
|
|
c3c7dfded8 | ||
|
|
6613abb024 | ||
|
|
c9c4c2f2a2 |
@@ -9,13 +9,13 @@ orbs:
|
|||||||
jobs:
|
jobs:
|
||||||
imex-api-deploy:
|
imex-api-deploy:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:18.18.2
|
- image: cimg/node:22.13.1
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- eb/setup
|
- eb/setup
|
||||||
- run:
|
- run:
|
||||||
command: |
|
command: |
|
||||||
eb init imex-online-production-api -r ca-central-1 -p "Node.js 18 running on 64bit Amazon Linux 2"
|
eb init imex-online-production-api -r ca-central-1 -p "Node.js 22 running on 64bit Amazon Linux 2"
|
||||||
eb status --verbose
|
eb status --verbose
|
||||||
eb deploy
|
eb deploy
|
||||||
eb status
|
eb status
|
||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
|
|
||||||
imex-hasura-migrate:
|
imex-hasura-migrate:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:18.18.2
|
- image: cimg/node:22.13.1
|
||||||
parameters:
|
parameters:
|
||||||
secret:
|
secret:
|
||||||
type: string
|
type: string
|
||||||
@@ -52,7 +52,7 @@ jobs:
|
|||||||
pipeline_number: << pipeline.number >>
|
pipeline_number: << pipeline.number >>
|
||||||
imex-app-build:
|
imex-app-build:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:18.18.2
|
- image: cimg/node:22.13.1
|
||||||
resource_class: large
|
resource_class: large
|
||||||
working_directory: ~/repo/client
|
working_directory: ~/repo/client
|
||||||
steps:
|
steps:
|
||||||
@@ -77,7 +77,7 @@ jobs:
|
|||||||
|
|
||||||
imex-app-beta-build:
|
imex-app-beta-build:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:18.18.2
|
- image: cimg/node:22.13.1
|
||||||
resource_class: large
|
resource_class: large
|
||||||
working_directory: ~/repo/client
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ jobs:
|
|||||||
- eb/setup
|
- eb/setup
|
||||||
- run:
|
- run:
|
||||||
command: |
|
command: |
|
||||||
eb init romeonline-productionapi -r us-east-2 -p "Node.js 18 running on 64bit Amazon Linux 2"
|
eb init romeonline-productionapi -r us-east-2 -p "Node.js 22 on 64bit Amazon Linux 2"
|
||||||
eb status --verbose
|
eb status --verbose
|
||||||
eb deploy
|
eb deploy
|
||||||
eb status
|
eb status
|
||||||
@@ -126,7 +126,7 @@ jobs:
|
|||||||
pipeline_number: << pipeline.number >>
|
pipeline_number: << pipeline.number >>
|
||||||
rome-hasura-migrate:
|
rome-hasura-migrate:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:18.18.2
|
- image: cimg/node:22.13.1
|
||||||
parameters:
|
parameters:
|
||||||
secret:
|
secret:
|
||||||
type: string
|
type: string
|
||||||
@@ -150,7 +150,7 @@ jobs:
|
|||||||
pipeline_number: << pipeline.number >>
|
pipeline_number: << pipeline.number >>
|
||||||
rome-app-build:
|
rome-app-build:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:18.18.2
|
- image: cimg/node:22.13.1
|
||||||
|
|
||||||
working_directory: ~/repo/client
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
@@ -179,40 +179,9 @@ jobs:
|
|||||||
job_type: deployment
|
job_type: deployment
|
||||||
pipeline_number: << pipeline.number >>
|
pipeline_number: << pipeline.number >>
|
||||||
|
|
||||||
promanager-app-build:
|
|
||||||
docker:
|
|
||||||
- image: cimg/node:18.18.2
|
|
||||||
|
|
||||||
working_directory: ~/repo/client
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- checkout:
|
|
||||||
path: ~/repo
|
|
||||||
- run:
|
|
||||||
name: Install Dependencies
|
|
||||||
command: npm i
|
|
||||||
|
|
||||||
- run: npm run build:production:promanager
|
|
||||||
|
|
||||||
- aws-cli/setup:
|
|
||||||
aws_access_key_id: AWS_ACCESS_KEY_ID
|
|
||||||
aws_secret_access_key: AWS_SECRET_ACCESS_KEY
|
|
||||||
region: AWS_REGION
|
|
||||||
|
|
||||||
- aws-s3/sync:
|
|
||||||
from: dist
|
|
||||||
to: "s3://promanager-production/"
|
|
||||||
arguments: "--exclude '*.map'"
|
|
||||||
- jira/notify:
|
|
||||||
environment: Production (ProManager) - Front End
|
|
||||||
environment_type: production
|
|
||||||
pipeline_id: << pipeline.id >>
|
|
||||||
job_type: deployment
|
|
||||||
pipeline_number: << pipeline.number >>
|
|
||||||
|
|
||||||
test-rome-hasura-migrate:
|
test-rome-hasura-migrate:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:18.18.2
|
- image: cimg/node:22.13.1
|
||||||
parameters:
|
parameters:
|
||||||
secret:
|
secret:
|
||||||
type: string
|
type: string
|
||||||
@@ -239,7 +208,7 @@ jobs:
|
|||||||
|
|
||||||
test-rome-app-build:
|
test-rome-app-build:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:18.18.2
|
- image: cimg/node:22.13.1
|
||||||
|
|
||||||
working_directory: ~/repo/client
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
@@ -268,40 +237,9 @@ jobs:
|
|||||||
job_type: deployment
|
job_type: deployment
|
||||||
pipeline_number: << pipeline.number >>
|
pipeline_number: << pipeline.number >>
|
||||||
|
|
||||||
test-promanager-app-build:
|
|
||||||
docker:
|
|
||||||
- image: cimg/node:18.18.2
|
|
||||||
|
|
||||||
working_directory: ~/repo/client
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- checkout:
|
|
||||||
path: ~/repo
|
|
||||||
- run:
|
|
||||||
name: Install Dependencies
|
|
||||||
command: npm i
|
|
||||||
|
|
||||||
- run: npm run build:test:promanager
|
|
||||||
|
|
||||||
- aws-cli/setup:
|
|
||||||
aws_access_key_id: AWS_ACCESS_KEY_ID
|
|
||||||
aws_secret_access_key: AWS_SECRET_ACCESS_KEY
|
|
||||||
region: AWS_REGION
|
|
||||||
|
|
||||||
- aws-s3/sync:
|
|
||||||
from: dist
|
|
||||||
to: "s3://promanager-testing/"
|
|
||||||
arguments: "--exclude '*.map'"
|
|
||||||
- jira/notify:
|
|
||||||
environment: Test (ProManager) - Front End
|
|
||||||
environment_type: testing
|
|
||||||
pipeline_id: << pipeline.id >>
|
|
||||||
job_type: deployment
|
|
||||||
pipeline_number: << pipeline.number >>
|
|
||||||
|
|
||||||
test-hasura-migrate:
|
test-hasura-migrate:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:18.18.2
|
- image: cimg/node:22.13.1
|
||||||
parameters:
|
parameters:
|
||||||
secret:
|
secret:
|
||||||
type: string
|
type: string
|
||||||
@@ -328,7 +266,7 @@ jobs:
|
|||||||
|
|
||||||
imex-test-app-build:
|
imex-test-app-build:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:18.18.2
|
- image: cimg/node:22.13.1
|
||||||
resource_class: large
|
resource_class: large
|
||||||
working_directory: ~/repo/client
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
@@ -348,7 +286,7 @@ jobs:
|
|||||||
|
|
||||||
imex-test-app-beta-build:
|
imex-test-app-beta-build:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:18.18.2
|
- image: cimg/node:22.13.1
|
||||||
resource_class: large
|
resource_class: large
|
||||||
working_directory: ~/repo/client
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
@@ -458,14 +396,6 @@ workflows:
|
|||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: test-AIO
|
only: test-AIO
|
||||||
- test-promanager-app-build:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only: test-AIO
|
|
||||||
- promanager-app-build:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only: master-AIO
|
|
||||||
- test-rome-hasura-migrate:
|
- test-rome-hasura-migrate:
|
||||||
secret: ${HASURA_ROME_TEST_SECRET}
|
secret: ${HASURA_ROME_TEST_SECRET}
|
||||||
filters:
|
filters:
|
||||||
|
|||||||
79
.gitattributes
vendored
79
.gitattributes
vendored
@@ -1 +1,80 @@
|
|||||||
|
# Ensure all text files use LF for line endings
|
||||||
* text eol=lf
|
* text eol=lf
|
||||||
|
|
||||||
|
# Binary files should not be modified by Git
|
||||||
|
*.png binary
|
||||||
|
*.jpg binary
|
||||||
|
*.jpeg binary
|
||||||
|
*.gif binary
|
||||||
|
*.ico binary
|
||||||
|
*.webp binary
|
||||||
|
*.svg binary
|
||||||
|
|
||||||
|
# Fonts
|
||||||
|
*.woff binary
|
||||||
|
*.woff2 binary
|
||||||
|
*.ttf binary
|
||||||
|
*.otf binary
|
||||||
|
*.eot binary
|
||||||
|
|
||||||
|
# Videos
|
||||||
|
*.mp4 binary
|
||||||
|
*.mov binary
|
||||||
|
*.avi binary
|
||||||
|
*.mkv binary
|
||||||
|
*.webm binary
|
||||||
|
|
||||||
|
# Audio
|
||||||
|
*.mp3 binary
|
||||||
|
*.wav binary
|
||||||
|
*.ogg binary
|
||||||
|
*.flac binary
|
||||||
|
|
||||||
|
# Archives and compressed files
|
||||||
|
*.zip binary
|
||||||
|
*.gz binary
|
||||||
|
*.tar binary
|
||||||
|
*.7z binary
|
||||||
|
*.rar binary
|
||||||
|
|
||||||
|
# PDF and documents
|
||||||
|
*.pdf binary
|
||||||
|
*.doc binary
|
||||||
|
*.docx binary
|
||||||
|
*.xls binary
|
||||||
|
*.xlsx binary
|
||||||
|
*.ppt binary
|
||||||
|
*.pptx binary
|
||||||
|
|
||||||
|
# Exclude JSON and other data files from text processing, if necessary
|
||||||
|
*.json text
|
||||||
|
*.xml text
|
||||||
|
*.csv text
|
||||||
|
|
||||||
|
# Scripts and code files should maintain LF endings
|
||||||
|
*.js text eol=lf
|
||||||
|
*.jsx text eol=lf
|
||||||
|
*.ts text eol=lf
|
||||||
|
*.tsx text eol=lf
|
||||||
|
*.css text eol=lf
|
||||||
|
*.scss text eol=lf
|
||||||
|
*.html text eol=lf
|
||||||
|
*.yml text eol=lf
|
||||||
|
*.yaml text eol=lf
|
||||||
|
*.md text eol=lf
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.py text eol=lf
|
||||||
|
*.rb text eol=lf
|
||||||
|
*.java text eol=lf
|
||||||
|
*.php text eol=lf
|
||||||
|
|
||||||
|
# Git configuration files
|
||||||
|
.gitattributes text eol=lf
|
||||||
|
.gitignore text eol=lf
|
||||||
|
*.gitattributes text eol=lf
|
||||||
|
|
||||||
|
# Exclude some other potential binary files
|
||||||
|
*.db binary
|
||||||
|
*.sqlite binary
|
||||||
|
*.exe binary
|
||||||
|
*.dll binary
|
||||||
|
|||||||
5
.platform/hooks/predeploy/01-install-dd.sh
Normal file
5
.platform/hooks/predeploy/01-install-dd.sh
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DD_API_KEY=58d91898a70c6fd659f6eea768a57976 DD_SITE="us3.datadoghq.com" bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
|
||||||
|
|
||||||
|
echo "Datadog agent installed."
|
||||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -38,5 +38,6 @@
|
|||||||
"smartscheduling",
|
"smartscheduling",
|
||||||
"timetickets",
|
"timetickets",
|
||||||
"touchtime"
|
"touchtime"
|
||||||
]
|
],
|
||||||
|
"eslint.workingDirectories": ["./", "./client"]
|
||||||
}
|
}
|
||||||
|
|||||||
16
Dockerfile
16
Dockerfile
@@ -3,11 +3,10 @@ FROM amazonlinux:2023
|
|||||||
|
|
||||||
# Install Git and Node.js (Amazon Linux 2023 uses the DNF package manager)
|
# Install Git and Node.js (Amazon Linux 2023 uses the DNF package manager)
|
||||||
RUN dnf install -y git \
|
RUN dnf install -y git \
|
||||||
&& curl -sL https://rpm.nodesource.com/setup_20.x | bash - \
|
&& curl -sL https://rpm.nodesource.com/setup_22.x | bash - \
|
||||||
&& dnf install -y nodejs \
|
&& dnf install -y nodejs \
|
||||||
&& dnf clean all
|
&& dnf clean all
|
||||||
|
|
||||||
|
|
||||||
# Install dependencies required by node-canvas
|
# Install dependencies required by node-canvas
|
||||||
RUN dnf install -y \
|
RUN dnf install -y \
|
||||||
gcc \
|
gcc \
|
||||||
@@ -19,9 +18,22 @@ RUN dnf install -y \
|
|||||||
libpng-devel \
|
libpng-devel \
|
||||||
make \
|
make \
|
||||||
python3 \
|
python3 \
|
||||||
|
fontconfig \
|
||||||
|
freetype \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
|
wget \
|
||||||
|
unzip \
|
||||||
&& dnf clean all
|
&& dnf clean all
|
||||||
|
|
||||||
|
# Install Montserrat fonts
|
||||||
|
RUN cd /tmp \
|
||||||
|
&& wget https://images.imex.online/fonts/montserrat.zip -O montserrat.zip \
|
||||||
|
&& unzip montserrat.zip -d montserrat \
|
||||||
|
&& mv montserrat/montserrat/*.ttf /usr/share/fonts \
|
||||||
|
&& fc-cache -fv \
|
||||||
|
&& rm -rf /tmp/montserrat /tmp/montserrat.zip \
|
||||||
|
&& echo "Montserrat fonts installed and cached successfully."
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
@@ -10,5 +10,8 @@
|
|||||||
"courtesycars": "date",
|
"courtesycars": "date",
|
||||||
"media": "date",
|
"media": "date",
|
||||||
"visualboard": "date",
|
"visualboard": "date",
|
||||||
"scoreboard": "date"
|
"scoreboard": "date",
|
||||||
|
"checklist": "date",
|
||||||
|
"smartscheduling" :"date",
|
||||||
|
"roguard": "date"
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +0,0 @@
|
|||||||
VITE_APP_GRAPHQL_ENDPOINT=https://db.dev.imex.online/v1/graphql
|
|
||||||
VITE_APP_GRAPHQL_ENDPOINT_WS=wss://db.dev.imex.online/v1/graphql
|
|
||||||
VITE_APP_GA_CODE=231099835
|
|
||||||
VITE_APP_FIREBASE_CONFIG={"apiKey":"AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc","authDomain":"imex-dev.firebaseapp.com","databaseURL":"https://imex-dev.firebaseio.com","projectId":"imex-dev","storageBucket":"imex-dev.appspot.com","messagingSenderId":"759548147434","appId":"1:759548147434:web:e8239868a48ceb36700993","measurementId":"G-K5XRBVVB4S"}
|
|
||||||
VITE_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/io-test
|
|
||||||
VITE_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/io-test
|
|
||||||
VITE_APP_CLOUDINARY_API_KEY=957865933348715
|
|
||||||
VITE_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
|
||||||
VITE_APP_FIREBASE_PUBLIC_VAPID_KEY='BG3tzU7L2BXlGZ_3VLK4PNaRceoEXEnmHfxcVbRMF5o5g05ejslhVPki9kBM9cBBT-08Ad9kN3HSpS6JmrWD6h4'
|
|
||||||
VITE_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
|
||||||
VITE_APP_AXIOS_BASE_API_URL=/api/
|
|
||||||
VITE_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
|
||||||
VITE_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
|
||||||
VITE_APP_INSTANCE=PROMANAGER
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
GENERATE_SOURCEMAP=true
|
|
||||||
VITE_APP_GRAPHQL_ENDPOINT=https://db.romeonline.io/v1/graphql
|
|
||||||
VITE_APP_GRAPHQL_ENDPOINT_WS=wss://db.romeonline.io/v1/graphql
|
|
||||||
VITE_APP_GA_CODE=231103507
|
|
||||||
VITE_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
|
|
||||||
VITE_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/bodyshop
|
|
||||||
VITE_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/bodyshop
|
|
||||||
VITE_APP_CLOUDINARY_API_KEY=473322739956866
|
|
||||||
VITE_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
|
||||||
VITE_APP_FIREBASE_PUBLIC_VAPID_KEY='BMgZT1NZztW2DsJl8Mg2L04hgY9FzAg6b8fbzgNAfww2VDzH3VE63Ot9EaP_U7KWS2JT-7HPHaw0T_Tw_5vkZc8'
|
|
||||||
VITE_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
|
||||||
VITE_APP_AXIOS_BASE_API_URL=https://api.romeonline.io/
|
|
||||||
VITE_APP_REPORTS_SERVER_URL=https://reports.romeonline.io
|
|
||||||
VITE_APP_SPLIT_API=et9pjkik6bn67he5evpmpr1agoo7gactphgk
|
|
||||||
VITE_APP_INSTANCE=PROMANAGER
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
VITE_APP_GRAPHQL_ENDPOINT=https://db.test.romeonline.io/v1/graphql
|
|
||||||
VITE_APP_GRAPHQL_ENDPOINT_WS=wss://db.test.romeonline.io/v1/graphql
|
|
||||||
VITE_APP_GA_CODE=231099835
|
|
||||||
VITE_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
|
|
||||||
VITE_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/bodyshop
|
|
||||||
VITE_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/bodyshop
|
|
||||||
VITE_APP_CLOUDINARY_API_KEY=473322739956866
|
|
||||||
VITE_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
|
||||||
VITE_APP_FIREBASE_PUBLIC_VAPID_KEY='BN2GcDPjipR5MTEosO5dT4CfQ3cmrdBIsI4juoOQrRijn_5aRiHlwj1mlq0W145mOusx6xynEKl_tvYJhpCc9lo'
|
|
||||||
VITE_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
|
||||||
VITE_APP_AXIOS_BASE_API_URL=https://api.test.romeonline.io/
|
|
||||||
VITE_APP_REPORTS_SERVER_URL=https://reports.test.romeonline.io
|
|
||||||
VITE_APP_IS_TEST=true
|
|
||||||
VITE_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
|
||||||
VITE_APP_INSTANCE=PROMANAGER
|
|
||||||
21
client/eslint.config.js
Normal file
21
client/eslint.config.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import globals from "globals";
|
||||||
|
import pluginJs from "@eslint/js";
|
||||||
|
import pluginReact from "eslint-plugin-react";
|
||||||
|
|
||||||
|
/** @type {import('eslint').Linter.Config[]} */
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
files: ["**/*.{js,mjs,cjs,jsx}"]
|
||||||
|
},
|
||||||
|
{ languageOptions: { globals: globals.browser } },
|
||||||
|
pluginJs.configs.recommended,
|
||||||
|
{
|
||||||
|
...pluginReact.configs.flat.recommended,
|
||||||
|
rules: {
|
||||||
|
...pluginReact.configs.flat.recommended.rules,
|
||||||
|
"react/prop-types": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pluginReact.configs.flat["jsx-runtime"]
|
||||||
|
];
|
||||||
@@ -1,29 +1,26 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8" />
|
||||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
||||||
<meta http-equiv="Pragma" content="no-cache">
|
<meta http-equiv="Pragma" content="no-cache" />
|
||||||
<meta http-equiv="Expires" content="0">
|
<meta http-equiv="Expires" content="0" />
|
||||||
<% if (env.VITE_APP_INSTANCE === 'IMEX') { %>
|
<% if (env.VITE_APP_INSTANCE === 'IMEX') { %>
|
||||||
<link rel="icon" href="/favicon.png"/>
|
<link rel="icon" href="/favicon.png" />
|
||||||
<% } %> <% if (env.VITE_APP_INSTANCE === 'ROME') { %>
|
<% } %> <% if (env.VITE_APP_INSTANCE === 'ROME') { %>
|
||||||
<link rel="icon" href="/ro-favicon.png"/>
|
<link rel="icon" href="/ro-favicon.png" />
|
||||||
<% } %> <% if (env.VITE_APP_INSTANCE === 'PROMANAGER') { %>
|
<% } %>
|
||||||
<link rel="icon" href="/pm/pm-favicon.ico"/>
|
|
||||||
<% } %>
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="theme-color" content="#1690ff"/>
|
<meta name="theme-color" content="#1690ff" />
|
||||||
<!-- <link rel="apple-touch-icon" href="logo192.png" /> -->
|
<!-- <link rel="apple-touch-icon" href="logo192.png" /> -->
|
||||||
<!-- TODO:AIo Update the individual logos for each.-->
|
<link rel="apple-touch-icon" href="/logo192.png" />
|
||||||
<link rel="apple-touch-icon" href="/logo192.png"/>
|
<link rel="mask-icon" href="/mask-icon.svg" color="#FFFFFF" />
|
||||||
<link rel="mask-icon" href="/mask-icon.svg" color="#FFFFFF">
|
<!--
|
||||||
<!--
|
|
||||||
manifest.json provides metadata used when your web app is installed on a
|
manifest.json provides metadata used when your web app is installed on a
|
||||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||||
-->
|
-->
|
||||||
<!--
|
<!--
|
||||||
Notice the use of %PUBLIC_URL% in the tags above.
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
It will be replaced with the URL of the `public` folder during the build.
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
Only files inside the `public` folder can be referenced from the HTML.
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
@@ -32,95 +29,100 @@
|
|||||||
work correctly both with client-side routing and a non-root public URL.
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
Learn how to configure a non-root public URL by running `npm run build`.
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
-->
|
-->
|
||||||
<% if (env.VITE_APP_INSTANCE === 'IMEX') { %>
|
<% if (env.VITE_APP_INSTANCE === 'IMEX') { %>
|
||||||
<meta name="description" content="ImEX Online"/>
|
<meta name="description" content="ImEX Online" />
|
||||||
<title>ImEX Online</title>
|
<title>ImEX Online</title>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.$crisp = [];
|
window.$crisp = [];
|
||||||
window.CRISP_WEBSITE_ID = '36724f62-2eb0-4b29-9cdd-9905fb99913e';
|
window.CRISP_WEBSITE_ID = "36724f62-2eb0-4b29-9cdd-9905fb99913e";
|
||||||
(function () {
|
(function () {
|
||||||
d = document;
|
d = document;
|
||||||
s = d.createElement('script');
|
s = d.createElement("script");
|
||||||
s.src = 'https://client.crisp.chat/l.js';
|
s.src = "https://client.crisp.chat/l.js";
|
||||||
s.async = 1;
|
s.async = 1;
|
||||||
d.getElementsByTagName('head')[0].appendChild(s);
|
d.getElementsByTagName("head")[0].appendChild(s);
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
<% } %> <% if (env.VITE_APP_INSTANCE === 'ROME') { %>
|
<% } %> <% if (env.VITE_APP_INSTANCE === 'ROME') { %>
|
||||||
<meta name="description" content="Rome Online"/>
|
<meta name="description" content="Rome Online" />
|
||||||
<title>Rome Online</title>
|
<title>Rome Online</title>
|
||||||
<script type="text/javascript" id="zsiqchat">
|
<script type="text/javascript" id="zsiqchat">
|
||||||
var $zoho = $zoho || {};
|
var $zoho = $zoho || {};
|
||||||
$zoho.salesiq = $zoho.salesiq || {
|
$zoho.salesiq = $zoho.salesiq || {
|
||||||
widgetcode: "siq01bb8ac617280bdacddfeb528f07734dadc64ef3f05efef9f769c1ec171af666",
|
widgetcode: "siq01bb8ac617280bdacddfeb528f07734dadc64ef3f05efef9f769c1ec171af666",
|
||||||
values: {},
|
values: {},
|
||||||
ready: function () {
|
ready: function () {}
|
||||||
}
|
};
|
||||||
};
|
var d = document;
|
||||||
var d = document;
|
s = d.createElement("script");
|
||||||
s = d.createElement("script");
|
s.type = "text/javascript";
|
||||||
s.type = "text/javascript";
|
s.id = "zsiqscript";
|
||||||
s.id = "zsiqscript";
|
s.defer = true;
|
||||||
s.defer = true;
|
s.src = "https://salesiq.zohopublic.com/widget";
|
||||||
s.src = "https://salesiq.zohopublic.com/widget";
|
t = d.getElementsByTagName("script")[0];
|
||||||
t = d.getElementsByTagName("script")[0];
|
t.parentNode.insertBefore(s, t);
|
||||||
t.parentNode.insertBefore(s, t);
|
</script>
|
||||||
</script>
|
<script type="text/javascript">
|
||||||
|
window.$crisp = [];
|
||||||
|
window.CRISP_WEBSITE_ID = "36724f62-2eb0-4b29-9cdd-9905fb99913e";
|
||||||
|
(function () {
|
||||||
|
d = document;
|
||||||
|
s = d.createElement("script");
|
||||||
|
s.src = "https://client.crisp.chat/l.js";
|
||||||
|
s.async = 1;
|
||||||
|
d.getElementsByTagName("head")[0].appendChild(s);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<% } %>
|
||||||
|
<script>
|
||||||
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var e = [
|
||||||
|
"debug",
|
||||||
|
"destroy",
|
||||||
|
"do",
|
||||||
|
"help",
|
||||||
|
"identify",
|
||||||
|
"is",
|
||||||
|
"off",
|
||||||
|
"on",
|
||||||
|
"ready",
|
||||||
|
"render",
|
||||||
|
"reset",
|
||||||
|
"safe",
|
||||||
|
"set"
|
||||||
|
];
|
||||||
|
if (window.noticeable) console.warn("Noticeable SDK code snippet loaded more than once");
|
||||||
|
else {
|
||||||
|
var n = (window.noticeable = window.noticeable || []);
|
||||||
|
|
||||||
<% } %> <% if (env.VITE_APP_INSTANCE === 'PROMANAGER') { %>
|
function t(e) {
|
||||||
<title>ProManager</title>
|
return function () {
|
||||||
<meta name="description" content="ProManager"/>
|
var t = Array.prototype.slice.call(arguments);
|
||||||
|
return t.unshift(e), n.push(t), n;
|
||||||
<% } %>
|
};
|
||||||
<script>
|
|
||||||
!(function () {
|
|
||||||
'use strict';
|
|
||||||
var e = [
|
|
||||||
'debug',
|
|
||||||
'destroy',
|
|
||||||
'do',
|
|
||||||
'help',
|
|
||||||
'identify',
|
|
||||||
'is',
|
|
||||||
'off',
|
|
||||||
'on',
|
|
||||||
'ready',
|
|
||||||
'render',
|
|
||||||
'reset',
|
|
||||||
'safe',
|
|
||||||
'set',
|
|
||||||
];
|
|
||||||
if (window.noticeable) console.warn('Noticeable SDK code snippet loaded more than once');
|
|
||||||
else {
|
|
||||||
var n = (window.noticeable = window.noticeable || []);
|
|
||||||
|
|
||||||
function t(e) {
|
|
||||||
return function () {
|
|
||||||
var t = Array.prototype.slice.call(arguments);
|
|
||||||
return t.unshift(e), n.push(t), n;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
!(function () {
|
|
||||||
for (var o = 0; o < e.length; o++) {
|
|
||||||
var r = e[o];
|
|
||||||
n[r] = t(r);
|
|
||||||
}
|
}
|
||||||
})(),
|
|
||||||
(function () {
|
|
||||||
var e = document.createElement('script');
|
|
||||||
(e.async = !0), (e.src = 'https://sdk.noticeable.io/l.js');
|
|
||||||
var n = document.head;
|
|
||||||
n.insertBefore(e, n.firstChild);
|
|
||||||
})();
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
||||||
<div id="root"></div>
|
|
||||||
|
|
||||||
<script type="module" src="src/index.jsx"></script>
|
!(function () {
|
||||||
</body>
|
for (var o = 0; o < e.length; o++) {
|
||||||
|
var r = e[o];
|
||||||
|
n[r] = t(r);
|
||||||
|
}
|
||||||
|
})(),
|
||||||
|
(function () {
|
||||||
|
var e = document.createElement("script");
|
||||||
|
(e.async = !0), (e.src = "https://sdk.noticeable.io/l.js");
|
||||||
|
var n = document.head;
|
||||||
|
n.insertBefore(e, n.firstChild);
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
|
<div id="root"></div>
|
||||||
|
|
||||||
|
<script type="module" src="src/index.jsx"></script>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
9662
client/package-lock.json
generated
9662
client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -8,75 +8,74 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"proxy": "http://localhost:4000",
|
"proxy": "http://localhost:4000",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/pro-layout": "^7.19.12",
|
"@ant-design/pro-layout": "^7.22.0",
|
||||||
"@apollo/client": "^3.11.8",
|
"@apollo/client": "^3.12.6",
|
||||||
"@emotion/is-prop-valid": "^1.3.1",
|
"@emotion/is-prop-valid": "^1.3.1",
|
||||||
"@fingerprintjs/fingerprintjs": "^4.5.0",
|
"@fingerprintjs/fingerprintjs": "^4.5.1",
|
||||||
"@jsreport/browser-client": "^3.1.0",
|
"@jsreport/browser-client": "^3.1.0",
|
||||||
"@reduxjs/toolkit": "^2.2.7",
|
"@reduxjs/toolkit": "^2.5.0",
|
||||||
"@sentry/cli": "^2.36.2",
|
"@sentry/cli": "^2.40.0",
|
||||||
"@sentry/react": "^7.114.0",
|
"@sentry/react": "^7.114.0",
|
||||||
"@splitsoftware/splitio-react": "^1.13.0",
|
"@splitsoftware/splitio-react": "^1.13.0",
|
||||||
"@tanem/react-nprogress": "^5.0.51",
|
"@tanem/react-nprogress": "^5.0.53",
|
||||||
"@vitejs/plugin-react": "^4.3.1",
|
"@vitejs/plugin-react": "^4.3.4",
|
||||||
"antd": "^5.20.1",
|
"antd": "^5.23.1",
|
||||||
"apollo-link-logger": "^2.0.1",
|
"apollo-link-logger": "^2.0.1",
|
||||||
"apollo-link-sentry": "^3.3.0",
|
"apollo-link-sentry": "^3.3.0",
|
||||||
"autosize": "^6.0.1",
|
"autosize": "^6.0.1",
|
||||||
"axios": "^1.7.7",
|
"axios": "^1.7.9",
|
||||||
"classnames": "^2.5.1",
|
"classnames": "^2.5.1",
|
||||||
"css-box-model": "^1.2.1",
|
"css-box-model": "^1.2.1",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"dayjs-business-days2": "^1.2.2",
|
"dayjs-business-days2": "^1.2.3",
|
||||||
"dinero.js": "^1.9.1",
|
"dinero.js": "^1.9.1",
|
||||||
"dotenv": "^16.4.5",
|
"dotenv": "^16.4.7",
|
||||||
"env-cmd": "^10.1.0",
|
"env-cmd": "^10.1.0",
|
||||||
"exifr": "^7.1.3",
|
"exifr": "^7.1.3",
|
||||||
"firebase": "^10.13.2",
|
"firebase": "^10.13.2",
|
||||||
"graphql": "^16.9.0",
|
"graphql": "^16.10.0",
|
||||||
"i18next": "^23.15.1",
|
"i18next": "^23.15.1",
|
||||||
"i18next-browser-languagedetector": "^8.0.0",
|
"i18next-browser-languagedetector": "^8.0.2",
|
||||||
"immutability-helper": "^3.1.1",
|
"immutability-helper": "^3.1.1",
|
||||||
"libphonenumber-js": "^1.11.9",
|
"libphonenumber-js": "^1.11.18",
|
||||||
"logrocket": "^8.1.2",
|
"logrocket": "^8.1.2",
|
||||||
"markerjs2": "^2.32.2",
|
"markerjs2": "^2.32.3",
|
||||||
"memoize-one": "^6.0.0",
|
"memoize-one": "^6.0.0",
|
||||||
"normalize-url": "^8.0.1",
|
"normalize-url": "^8.0.1",
|
||||||
"object-hash": "^3.0.0",
|
"object-hash": "^3.0.0",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"query-string": "^9.1.0",
|
"query-string": "^9.1.1",
|
||||||
"raf-schd": "^4.0.3",
|
"raf-schd": "^4.0.3",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-big-calendar": "^1.14.1",
|
"react-big-calendar": "^1.17.1",
|
||||||
"react-color": "^2.19.3",
|
"react-color": "^2.19.3",
|
||||||
"react-cookie": "^7.2.0",
|
"react-cookie": "^7.2.2",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-drag-listview": "^2.0.0",
|
"react-drag-listview": "^2.0.0",
|
||||||
"react-grid-gallery": "^1.0.1",
|
"react-grid-gallery": "^1.0.1",
|
||||||
"react-grid-layout": "1.3.4",
|
"react-grid-layout": "1.3.4",
|
||||||
"react-i18next": "^14.1.3",
|
"react-i18next": "^14.1.3",
|
||||||
"react-icons": "^5.3.0",
|
"react-icons": "^5.4.0",
|
||||||
"react-image-lightbox": "^5.1.4",
|
"react-image-lightbox": "^5.1.4",
|
||||||
"react-markdown": "^9.0.1",
|
"react-markdown": "^9.0.3",
|
||||||
"react-number-format": "^5.4.2",
|
"react-number-format": "^5.4.3",
|
||||||
"react-popopo": "^2.1.9",
|
"react-popopo": "^2.1.9",
|
||||||
"react-product-fruits": "^2.2.61",
|
"react-product-fruits": "^2.2.61",
|
||||||
"react-redux": "^9.1.2",
|
"react-redux": "^9.2.0",
|
||||||
"react-resizable": "^3.0.5",
|
"react-resizable": "^3.0.5",
|
||||||
"react-router-dom": "^6.26.2",
|
"react-router-dom": "^6.26.2",
|
||||||
"react-sticky": "^6.0.3",
|
"react-sticky": "^6.0.3",
|
||||||
"react-virtualized": "^9.22.5",
|
|
||||||
"react-virtuoso": "^4.10.4",
|
"react-virtuoso": "^4.10.4",
|
||||||
"recharts": "^2.12.7",
|
"recharts": "^2.15.0",
|
||||||
"redux": "^5.0.1",
|
"redux": "^5.0.1",
|
||||||
"redux-actions": "^3.0.3",
|
"redux-actions": "^3.0.3",
|
||||||
"redux-persist": "^6.0.0",
|
"redux-persist": "^6.0.0",
|
||||||
"redux-saga": "^1.3.0",
|
"redux-saga": "^1.3.0",
|
||||||
"redux-state-sync": "^3.1.4",
|
"redux-state-sync": "^3.1.4",
|
||||||
"reselect": "^5.1.1",
|
"reselect": "^5.1.1",
|
||||||
"sass": "^1.79.3",
|
"sass": "^1.83.4",
|
||||||
"socket.io-client": "^4.8.0",
|
"socket.io-client": "^4.8.1",
|
||||||
"styled-components": "^6.1.13",
|
"styled-components": "^6.1.14",
|
||||||
"subscriptions-transport-ws": "^0.11.0",
|
"subscriptions-transport-ws": "^0.11.0",
|
||||||
"use-memo-one": "^1.1.3",
|
"use-memo-one": "^1.1.3",
|
||||||
"userpilot": "^1.3.6",
|
"userpilot": "^1.3.6",
|
||||||
@@ -90,29 +89,18 @@
|
|||||||
"build": "dotenvx run --env-file=.env.development.imex -- vite build",
|
"build": "dotenvx run --env-file=.env.development.imex -- vite build",
|
||||||
"start:imex": "dotenvx run --env-file=.env.development.imex -- vite",
|
"start:imex": "dotenvx run --env-file=.env.development.imex -- vite",
|
||||||
"start:rome": "dotenvx run --env-file=.env.development.rome -- vite",
|
"start:rome": "dotenvx run --env-file=.env.development.rome -- vite",
|
||||||
"start:promanager": "dotenvx run --env-file=.env.development.promanager -- vite",
|
|
||||||
"preview:imex": "dotenvx run --env-file=.env.development.imex -- vite preview",
|
"preview:imex": "dotenvx run --env-file=.env.development.imex -- vite preview",
|
||||||
"preview:rome": "dotenvx run --env-file=.env.development.rome -- vite preview",
|
"preview:rome": "dotenvx run --env-file=.env.development.rome -- vite preview",
|
||||||
"preview:promanager": "dotenvx run --env-file=.env.development.promanager -- vite preview",
|
|
||||||
"build:test:imex": "env-cmd -f .env.test.imex npm run build",
|
"build:test:imex": "env-cmd -f .env.test.imex npm run build",
|
||||||
"build:test:rome": "env-cmd -f .env.test.rome npm run build",
|
"build:test:rome": "env-cmd -f .env.test.rome npm run build",
|
||||||
"build:test:promanager": "env-cmd -f .env.test.promanager npm run build",
|
|
||||||
"build:production:imex": "env-cmd -f .env.production.imex npm run build",
|
"build:production:imex": "env-cmd -f .env.production.imex npm run build",
|
||||||
"build:production:rome": "env-cmd -f .env.production.rome npm run build",
|
"build:production:rome": "env-cmd -f .env.production.rome npm run build",
|
||||||
"build:production:promanager": "env-cmd -f .env.production.promanager npm run build",
|
|
||||||
"test": "cypress open",
|
"test": "cypress open",
|
||||||
"eject": "react-scripts eject",
|
"eject": "react-scripts eject",
|
||||||
"madge": "madge --image ./madge-graph.svg --extensions js,jsx,ts,tsx --circular .",
|
"madge": "madge --image ./madge-graph.svg --extensions js,jsx,ts,tsx --circular .",
|
||||||
"eulaize": "node src/utils/eulaize.js",
|
"eulaize": "node src/utils/eulaize.js",
|
||||||
"sentry:sourcemaps:imex": "sentry-cli sourcemaps inject --org imex --project imexonline ./build && sentry-cli sourcemaps upload --org imex --project imexonline ./build"
|
"sentry:sourcemaps:imex": "sentry-cli sourcemaps inject --org imex --project imexonline ./build && sentry-cli sourcemaps upload --org imex --project imexonline ./build"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
|
||||||
"extends": [
|
|
||||||
"react-app",
|
|
||||||
"react-app/jest",
|
|
||||||
"plugin:cypress/recommended"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
"production": [
|
"production": [
|
||||||
">0.2%",
|
">0.2%",
|
||||||
@@ -132,33 +120,36 @@
|
|||||||
"@rollup/rollup-linux-x64-gnu": "4.6.1"
|
"@rollup/rollup-linux-x64-gnu": "4.6.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ant-design/icons": "^5.5.1",
|
"@ant-design/icons": "^5.5.2",
|
||||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||||
"@babel/preset-react": "^7.24.7",
|
"@babel/preset-react": "^7.26.3",
|
||||||
"@dotenvx/dotenvx": "^1.14.1",
|
"@dotenvx/dotenvx": "^1.33.0",
|
||||||
"@emotion/babel-plugin": "^11.12.0",
|
"@emotion/babel-plugin": "^11.13.5",
|
||||||
"@emotion/react": "^11.13.3",
|
"@emotion/react": "^11.14.0",
|
||||||
|
"@eslint/js": "^9.18.0",
|
||||||
"@sentry/webpack-plugin": "^2.22.4",
|
"@sentry/webpack-plugin": "^2.22.4",
|
||||||
"@testing-library/cypress": "^10.0.2",
|
"@testing-library/cypress": "^10.0.2",
|
||||||
"browserslist": "^4.23.3",
|
"browserslist": "^4.24.4",
|
||||||
"browserslist-to-esbuild": "^2.1.1",
|
"browserslist-to-esbuild": "^2.1.1",
|
||||||
"chalk": "^5.3.0",
|
"chalk": "^5.4.1",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"cypress": "^13.14.2",
|
"cypress": "^13.17.0",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.1",
|
||||||
"eslint-config-react-app": "^7.0.1",
|
"eslint-config-react-app": "^7.0.1",
|
||||||
"eslint-plugin-cypress": "^2.15.1",
|
"eslint-plugin-cypress": "^2.15.1",
|
||||||
"memfs": "^4.12.0",
|
"eslint-plugin-react": "^7.37.4",
|
||||||
|
"globals": "^15.14.0",
|
||||||
|
"memfs": "^4.17.0",
|
||||||
"os-browserify": "^0.3.0",
|
"os-browserify": "^0.3.0",
|
||||||
"react-error-overlay": "6.0.11",
|
"react-error-overlay": "6.0.11",
|
||||||
"redux-logger": "^3.0.6",
|
"redux-logger": "^3.0.6",
|
||||||
"source-map-explorer": "^2.5.3",
|
"source-map-explorer": "^2.5.3",
|
||||||
"vite": "^5.4.7",
|
"vite": "^6.0.7",
|
||||||
"vite-plugin-babel": "^1.2.0",
|
"vite-plugin-babel": "^1.3.0",
|
||||||
"vite-plugin-eslint": "^1.8.1",
|
"vite-plugin-eslint": "^1.8.1",
|
||||||
"vite-plugin-node-polyfills": "^0.22.0",
|
"vite-plugin-node-polyfills": "^0.23.0",
|
||||||
"vite-plugin-pwa": "^0.20.5",
|
"vite-plugin-pwa": "^0.21.1",
|
||||||
"vite-plugin-style-import": "^2.0.0",
|
"vite-plugin-style-import": "^2.0.0",
|
||||||
"workbox-window": "^7.1.0"
|
"workbox-window": "^7.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB |
@@ -22,6 +22,7 @@ import Eula from "../components/eula/eula.component";
|
|||||||
import InstanceRenderMgr from "../utils/instanceRenderMgr";
|
import InstanceRenderMgr from "../utils/instanceRenderMgr";
|
||||||
import ProductFruitsWrapper from "./ProductFruitsWrapper.jsx";
|
import ProductFruitsWrapper from "./ProductFruitsWrapper.jsx";
|
||||||
import { SocketProvider } from "../contexts/SocketIO/socketContext.jsx";
|
import { SocketProvider } from "../contexts/SocketIO/socketContext.jsx";
|
||||||
|
import { NotificationProvider } from "../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const ResetPassword = lazy(() => import("../pages/reset-password/reset-password.component"));
|
const ResetPassword = lazy(() => import("../pages/reset-password/reset-password.component"));
|
||||||
const ManagePage = lazy(() => import("../pages/manage/manage.page.container"));
|
const ManagePage = lazy(() => import("../pages/manage/manage.page.container"));
|
||||||
@@ -96,8 +97,7 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline
|
|||||||
LogRocket.init(
|
LogRocket.init(
|
||||||
InstanceRenderMgr({
|
InstanceRenderMgr({
|
||||||
imex: "gvfvfw/bodyshopapp",
|
imex: "gvfvfw/bodyshopapp",
|
||||||
rome: "rome-online/rome-online",
|
rome: "rome-online/rome-online"
|
||||||
promanager: "" // TODO: AIO Add in log rocket for promanager instances.
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -134,8 +134,7 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline
|
|||||||
<LoadingSpinner
|
<LoadingSpinner
|
||||||
message={InstanceRenderMgr({
|
message={InstanceRenderMgr({
|
||||||
imex: t("titles.imexonline"),
|
imex: t("titles.imexonline"),
|
||||||
rome: t("titles.romeonline"),
|
rome: t("titles.romeonline")
|
||||||
promanager: t("titles.promanager")
|
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@@ -144,88 +143,88 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline
|
|||||||
currentUser={currentUser}
|
currentUser={currentUser}
|
||||||
workspaceCode={InstanceRenderMgr({
|
workspaceCode={InstanceRenderMgr({
|
||||||
imex: null,
|
imex: null,
|
||||||
rome: "9BkbEseqNqxw8jUH",
|
rome: "9BkbEseqNqxw8jUH"
|
||||||
promanager: "aoJoEifvezYI0Z0P"
|
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
<NotificationProvider>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route
|
<Route
|
||||||
path="*"
|
path="*"
|
||||||
element={
|
element={
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<LandingPage />
|
<LandingPage />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/signin"
|
path="/signin"
|
||||||
element={
|
element={
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<SignInPage />
|
<SignInPage />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/resetpassword"
|
path="/resetpassword"
|
||||||
element={
|
element={
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<ResetPassword />
|
<ResetPassword />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/csi/:surveyId"
|
path="/csi/:surveyId"
|
||||||
element={
|
element={
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<CsiPage />
|
<CsiPage />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/disclaimer"
|
path="/disclaimer"
|
||||||
element={
|
element={
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<DisclaimerPage />
|
<DisclaimerPage />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/mp/:paymentIs"
|
path="/mp/:paymentIs"
|
||||||
element={
|
element={
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<MobilePaymentContainer />
|
<MobilePaymentContainer />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/manage/*"
|
path="/manage/*"
|
||||||
element={
|
element={
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<SocketProvider bodyshop={bodyshop}>
|
<SocketProvider bodyshop={bodyshop}>
|
||||||
<PrivateRoute isAuthorized={currentUser.authorized} />
|
<PrivateRoute isAuthorized={currentUser.authorized} />
|
||||||
</SocketProvider>
|
</SocketProvider>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Route path="*" element={<ManagePage />} />
|
<Route path="*" element={<ManagePage />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route
|
<Route
|
||||||
path="/tech/*"
|
path="/tech/*"
|
||||||
element={
|
element={
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<SocketProvider bodyshop={bodyshop}>
|
<SocketProvider bodyshop={bodyshop}>
|
||||||
<PrivateRoute isAuthorized={currentUser.authorized} />
|
<PrivateRoute isAuthorized={currentUser.authorized} />
|
||||||
</SocketProvider>
|
</SocketProvider>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Route path="*" element={<TechPageContainer />} />
|
<Route path="*" element={<TechPageContainer />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/edit/*" element={<PrivateRoute isAuthorized={currentUser.authorized} />}>
|
<Route path="/edit/*" element={<PrivateRoute isAuthorized={currentUser.authorized} />}>
|
||||||
<Route path="*" element={<DocumentEditorContainer />} />
|
<Route path="*" element={<DocumentEditorContainer />} />
|
||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
|
</NotificationProvider>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,13 @@
|
|||||||
border-bottom: 1px solid #74695c !important;
|
border-bottom: 1px solid #74695c !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: This was added because the newest release of ant was making the text color and the background color the same on a selected header
|
||||||
|
// Tried all available tokens (https://ant.design/components/menu?locale=en-US) and even reverted all our custom styles, to no avail
|
||||||
|
// This should be kept an eye on, especially if implementing DARK MODE
|
||||||
|
.ant-menu-submenu-title {
|
||||||
|
color: rgba(255, 255, 255, 0.65) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.imex-table-header {
|
.imex-table-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|||||||
@@ -26,13 +26,11 @@ const defaultTheme = {
|
|||||||
token: {
|
token: {
|
||||||
colorPrimary: InstanceRenderMgr({
|
colorPrimary: InstanceRenderMgr({
|
||||||
imex: "#1890ff",
|
imex: "#1890ff",
|
||||||
rome: "#326ade",
|
rome: "#326ade"
|
||||||
promanager: "#1d69a6"
|
|
||||||
}),
|
}),
|
||||||
colorInfo: InstanceRenderMgr({
|
colorInfo: InstanceRenderMgr({
|
||||||
imex: "#1890ff",
|
imex: "#1890ff",
|
||||||
rome: "#326ade",
|
rome: "#326ade"
|
||||||
promanager: "#1d69a6"
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -85,6 +85,17 @@ export function AccountingPayablesTableComponent({ bodyshop, loading, payments,
|
|||||||
sortOrder: state.sortedInfo.columnKey === "amount" && state.sortedInfo.order,
|
sortOrder: state.sortedInfo.columnKey === "amount" && state.sortedInfo.order,
|
||||||
render: (text, record) => <CurrencyFormatter>{record.amount}</CurrencyFormatter>
|
render: (text, record) => <CurrencyFormatter>{record.amount}</CurrencyFormatter>
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t("payments.fields.type"),
|
||||||
|
dataIndex: "type",
|
||||||
|
key: "type",
|
||||||
|
sorter: (a, b) => a.type.localeCompare(b.type),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "type" && state.sortedInfo.order,
|
||||||
|
filters: bodyshop.md_payment_types.map((s) => {
|
||||||
|
return { text: s, value: [s] };
|
||||||
|
}),
|
||||||
|
onFilter: (value, record) => value.includes(record.type)
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t("payments.fields.memo"),
|
title: t("payments.fields.memo"),
|
||||||
dataIndex: "memo",
|
dataIndex: "memo",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import AllocationsAssignmentComponent from "./allocations-assignment.component";
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { INSERT_ALLOCATION } from "../../graphql/allocations.queries";
|
import { INSERT_ALLOCATION } from "../../graphql/allocations.queries";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { notification } from "antd";
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function AllocationsAssignmentContainer({ jobLineId, hours, refetch }) {
|
export default function AllocationsAssignmentContainer({ jobLineId, hours, refetch }) {
|
||||||
const visibilityState = useState(false);
|
const visibilityState = useState(false);
|
||||||
@@ -14,6 +14,7 @@ export default function AllocationsAssignmentContainer({ jobLineId, hours, refet
|
|||||||
employeeid: null
|
employeeid: null
|
||||||
});
|
});
|
||||||
const [insertAllocation] = useMutation(INSERT_ALLOCATION);
|
const [insertAllocation] = useMutation(INSERT_ALLOCATION);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleAssignment = () => {
|
const handleAssignment = () => {
|
||||||
insertAllocation({ variables: { alloc: { ...assignment } } })
|
insertAllocation({ variables: { alloc: { ...assignment } } })
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import AllocationsBulkAssignment from "./allocations-bulk-assignment.component";
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { INSERT_ALLOCATION } from "../../graphql/allocations.queries";
|
import { INSERT_ALLOCATION } from "../../graphql/allocations.queries";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { notification } from "antd";
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function AllocationsBulkAssignmentContainer({ jobLines, refetch }) {
|
export default function AllocationsBulkAssignmentContainer({ jobLines, refetch }) {
|
||||||
const visibilityState = useState(false);
|
const visibilityState = useState(false);
|
||||||
@@ -12,6 +12,7 @@ export default function AllocationsBulkAssignmentContainer({ jobLines, refetch }
|
|||||||
employeeid: null
|
employeeid: null
|
||||||
});
|
});
|
||||||
const [insertAllocation] = useMutation(INSERT_ALLOCATION);
|
const [insertAllocation] = useMutation(INSERT_ALLOCATION);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleAssignment = () => {
|
const handleAssignment = () => {
|
||||||
const allocs = jobLines.reduce((acc, value) => {
|
const allocs = jobLines.reduce((acc, value) => {
|
||||||
|
|||||||
@@ -2,12 +2,13 @@ import React from "react";
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { DELETE_ALLOCATION } from "../../graphql/allocations.queries";
|
import { DELETE_ALLOCATION } from "../../graphql/allocations.queries";
|
||||||
import AllocationsLabelComponent from "./allocations-employee-label.component";
|
import AllocationsLabelComponent from "./allocations-employee-label.component";
|
||||||
import { notification } from "antd";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function AllocationsLabelContainer({ allocation, refetch }) {
|
export default function AllocationsLabelContainer({ allocation, refetch }) {
|
||||||
const [deleteAllocation] = useMutation(DELETE_ALLOCATION);
|
const [deleteAllocation] = useMutation(DELETE_ALLOCATION);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleClick = (e) => {
|
const handleClick = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { DeleteFilled } from "@ant-design/icons";
|
import { DeleteFilled } from "@ant-design/icons";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, notification, Popconfirm } from "antd";
|
import { Button, Popconfirm } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { DELETE_BILL } from "../../graphql/bills.queries";
|
import { DELETE_BILL } from "../../graphql/bills.queries";
|
||||||
@@ -9,6 +9,7 @@ import { insertAuditTrail } from "../../redux/application/application.actions";
|
|||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({});
|
const mapStateToProps = createStructuredSelector({});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
@@ -21,6 +22,7 @@ export function BillDeleteButton({ bill, jobid, callback, insertAuditTrail }) {
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [deleteBill] = useMutation(DELETE_BILL);
|
const [deleteBill] = useMutation(DELETE_BILL);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleDelete = async () => {
|
const handleDelete = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useApolloClient, useMutation } from "@apollo/client";
|
import { useApolloClient, useMutation } from "@apollo/client";
|
||||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Button, Checkbox, Form, Modal, notification, Space } from "antd";
|
import { Button, Checkbox, Form, Modal, Space } from "antd";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import React, { useEffect, useMemo, useState } from "react";
|
import React, { useEffect, useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -24,6 +24,7 @@ import BillFormContainer from "../bill-form/bill-form.container";
|
|||||||
import { CalculateBillTotal } from "../bill-form/bill-form.totals.utility";
|
import { CalculateBillTotal } from "../bill-form/bill-form.totals.utility";
|
||||||
import { handleUpload as handleLocalUpload } from "../documents-local-upload/documents-local-upload.utility";
|
import { handleUpload as handleLocalUpload } from "../documents-local-upload/documents-local-upload.utility";
|
||||||
import { handleUpload } from "../documents-upload/documents-upload.utility";
|
import { handleUpload } from "../documents-upload/documents-upload.utility";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
billEnterModal: selectBillEnterModal,
|
billEnterModal: selectBillEnterModal,
|
||||||
@@ -49,6 +50,7 @@ function BillEnterModalContainer({ billEnterModal, toggleModalVisible, bodyshop,
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
const [generateLabel, setGenerateLabel] = useLocalStorage("enter_bill_generate_label", false);
|
const [generateLabel, setGenerateLabel] = useLocalStorage("enter_bill_generate_label", false);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
treatments: { Enhanced_Payroll }
|
treatments: { Enhanced_Payroll }
|
||||||
@@ -291,7 +293,8 @@ function BillEnterModalContainer({ billEnterModal, toggleModalVisible, bodyshop,
|
|||||||
jobid: values.jobid,
|
jobid: values.jobid,
|
||||||
invoice_number: remainingValues.invoice_number,
|
invoice_number: remainingValues.invoice_number,
|
||||||
vendorid: remainingValues.vendorid
|
vendorid: remainingValues.vendorid
|
||||||
}
|
},
|
||||||
|
notification
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -305,7 +308,8 @@ function BillEnterModalContainer({ billEnterModal, toggleModalVisible, bodyshop,
|
|||||||
billId: billId,
|
billId: billId,
|
||||||
tagsArray: null,
|
tagsArray: null,
|
||||||
callback: null
|
callback: null
|
||||||
}
|
},
|
||||||
|
notification
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -325,7 +329,9 @@ function BillEnterModalContainer({ billEnterModal, toggleModalVisible, bodyshop,
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
"p"
|
"p",
|
||||||
|
null,
|
||||||
|
notification
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -228,7 +228,6 @@ export function BillEnterModalLinesComponent({
|
|||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)
|
)
|
||||||
//Do not need to set for promanager as it will default to Rome.
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -462,7 +461,6 @@ export function BillEnterModalLinesComponent({
|
|||||||
|
|
||||||
...InstanceRenderManager({
|
...InstanceRenderManager({
|
||||||
rome: [],
|
rome: [],
|
||||||
promanager: [],
|
|
||||||
imex: [
|
imex: [
|
||||||
{
|
{
|
||||||
title: t("billlines.fields.federal_tax_applicable"),
|
title: t("billlines.fields.federal_tax_applicable"),
|
||||||
@@ -475,8 +473,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
valuePropName: "checked",
|
valuePropName: "checked",
|
||||||
initialValue: InstanceRenderManager({
|
initialValue: InstanceRenderManager({
|
||||||
imex: true,
|
imex: true,
|
||||||
rome: false,
|
rome: false
|
||||||
promanager: false
|
|
||||||
}),
|
}),
|
||||||
name: [field.name, "applicable_taxes", "federal"]
|
name: [field.name, "applicable_taxes", "federal"]
|
||||||
};
|
};
|
||||||
@@ -503,7 +500,6 @@ export function BillEnterModalLinesComponent({
|
|||||||
|
|
||||||
...InstanceRenderManager({
|
...InstanceRenderManager({
|
||||||
rome: [],
|
rome: [],
|
||||||
promanager: [],
|
|
||||||
imex: [
|
imex: [
|
||||||
{
|
{
|
||||||
title: t("billlines.fields.local_tax_applicable"),
|
title: t("billlines.fields.local_tax_applicable"),
|
||||||
@@ -629,11 +625,15 @@ const EditableCell = ({
|
|||||||
wrapper,
|
wrapper,
|
||||||
...restProps
|
...restProps
|
||||||
}) => {
|
}) => {
|
||||||
|
const propsFinal = formItemProps && formItemProps(record);
|
||||||
|
if (propsFinal && "key" in propsFinal) {
|
||||||
|
delete propsFinal.key;
|
||||||
|
}
|
||||||
if (additional)
|
if (additional)
|
||||||
return (
|
return (
|
||||||
<td {...restProps}>
|
<td {...restProps}>
|
||||||
<div size="small">
|
<div size="small">
|
||||||
<Form.Item name={dataIndex} labelCol={{ span: 0 }} {...(formItemProps && formItemProps(record))}>
|
<Form.Item name={dataIndex} labelCol={{ span: 0 }} {...propsFinal}>
|
||||||
{(formInput && formInput(record, record.name)) || children}
|
{(formInput && formInput(record, record.name)) || children}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{additional && additional(record, record.name)}
|
{additional && additional(record, record.name)}
|
||||||
@@ -644,7 +644,7 @@ const EditableCell = ({
|
|||||||
return (
|
return (
|
||||||
<wrapper>
|
<wrapper>
|
||||||
<td {...restProps}>
|
<td {...restProps}>
|
||||||
<Form.Item labelCol={{ span: 0 }} name={dataIndex} {...(formItemProps && formItemProps(record))}>
|
<Form.Item labelCol={{ span: 0 }} name={dataIndex} {...propsFinal}>
|
||||||
{(formInput && formInput(record, record.name)) || children}
|
{(formInput && formInput(record, record.name)) || children}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</td>
|
</td>
|
||||||
@@ -652,7 +652,7 @@ const EditableCell = ({
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<td {...restProps}>
|
<td {...restProps}>
|
||||||
<Form.Item labelCol={{ span: 0 }} name={dataIndex} {...(formItemProps && formItemProps(record))}>
|
<Form.Item labelCol={{ span: 0 }} name={dataIndex} {...propsFinal}>
|
||||||
{(formInput && formInput(record, record.name)) || children}
|
{(formInput && formInput(record, record.name)) || children}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { gql, useMutation } from "@apollo/client";
|
import { gql, useMutation } from "@apollo/client";
|
||||||
import { Button, notification } from "antd";
|
import { Button } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
@@ -8,6 +8,7 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { selectAuthLevel, selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectAuthLevel, selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
|
import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -24,6 +25,7 @@ export function BillMarkExportedButton({ currentUser, bodyshop, authLevel, bill
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const [updateBill] = useMutation(gql`
|
const [updateBill] = useMutation(gql`
|
||||||
mutation UPDATE_BILL($billId: uuid!) {
|
mutation UPDATE_BILL($billId: uuid!) {
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ import React, { useState } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function BillPrintButton({ billid }) {
|
export default function BillPrintButton({ billid }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const Templates = TemplateList("job_special");
|
const Templates = TemplateList("job_special");
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const submitHandler = async () => {
|
const submitHandler = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -20,7 +22,9 @@ export default function BillPrintButton({ billid }) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
"p"
|
"p",
|
||||||
|
null,
|
||||||
|
notification
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("Warning: Error generating a document.");
|
console.warn("Warning: Error generating a document.");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { gql, useMutation } from "@apollo/client";
|
import { gql, useMutation } from "@apollo/client";
|
||||||
import { Button, notification } from "antd";
|
import { Button } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
@@ -7,6 +7,7 @@ import { connect } from "react-redux";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectAuthLevel, selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectAuthLevel, selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
|
import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -21,6 +22,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(BillMarkForReexportB
|
|||||||
export function BillMarkForReexportButton({ bodyshop, authLevel, bill }) {
|
export function BillMarkForReexportButton({ bodyshop, authLevel, bill }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const [updateBill] = useMutation(gql`
|
const [updateBill] = useMutation(gql`
|
||||||
mutation UPDATE_BILL($billId: uuid!) {
|
mutation UPDATE_BILL($billId: uuid!) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { FileAddFilled } from "@ant-design/icons";
|
import { FileAddFilled } from "@ant-design/icons";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, notification, Tooltip } from "antd";
|
import { Button, Tooltip } from "antd";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import dayjs from "./../../utils/day";
|
import dayjs from "./../../utils/day";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
@@ -11,6 +11,7 @@ import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selecto
|
|||||||
import { CalculateBillTotal } from "../bill-form/bill-form.totals.utility";
|
import { CalculateBillTotal } from "../bill-form/bill-form.totals.utility";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -25,6 +26,7 @@ export function BilllineAddInventory({ currentUser, bodyshop, billline, disabled
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const { billid } = queryString.parse(useLocation().search);
|
const { billid } = queryString.parse(useLocation().search);
|
||||||
const [insertInventoryLine] = useMutation(INSERT_INVENTORY_AND_CREDIT);
|
const [insertInventoryLine] = useMutation(INSERT_INVENTORY_AND_CREDIT);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const addToInventory = async () => {
|
const addToInventory = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { EditFilled, SyncOutlined } from "@ant-design/icons";
|
|||||||
import { Button, Card, Checkbox, Input, Space, Table } from "antd";
|
import { Button, Card, Checkbox, Input, Space, Table } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { FaTasks } from "react-icons/fa";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
@@ -13,8 +14,10 @@ import { alphaSort, dateSort } from "../../utils/sorters";
|
|||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import BillDeleteButton from "../bill-delete-button/bill-delete-button.component";
|
import BillDeleteButton from "../bill-delete-button/bill-delete-button.component";
|
||||||
import BillDetailEditReturnComponent from "../bill-detail-edit/bill-detail-edit-return.component";
|
import BillDetailEditReturnComponent from "../bill-detail-edit/bill-detail-edit-return.component";
|
||||||
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
|
import LockerWrapperComponent from "../lock-wrapper/lock-wrapper.component";
|
||||||
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
||||||
import { FaTasks } from "react-icons/fa";
|
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
@@ -170,6 +173,8 @@ export function BillsListTableComponent({
|
|||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
|
const hasBillsAccess = HasFeatureAccess({ bodyshop, featureName: "bills" });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
title={t("bills.labels.bills")}
|
title={t("bills.labels.bills")}
|
||||||
@@ -181,6 +186,7 @@ export function BillsListTableComponent({
|
|||||||
{job && job.converted ? (
|
{job && job.converted ? (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
|
disabled={!hasBillsAccess}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setBillEnterContext({
|
setBillEnterContext({
|
||||||
actions: { refetch: billsQuery.refetch },
|
actions: { refetch: billsQuery.refetch },
|
||||||
@@ -190,9 +196,10 @@ export function BillsListTableComponent({
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("jobs.actions.postbills")}
|
<LockerWrapperComponent featureName="bills">{t("jobs.actions.postbills")}</LockerWrapperComponent>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
disabled={!hasBillsAccess}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setReconciliationContext({
|
setReconciliationContext({
|
||||||
actions: { refetch: billsQuery.refetch },
|
actions: { refetch: billsQuery.refetch },
|
||||||
@@ -203,7 +210,7 @@ export function BillsListTableComponent({
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("jobs.actions.reconcile")}
|
<LockerWrapperComponent featureName="bills"> {t("jobs.actions.reconcile")}</LockerWrapperComponent>
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -211,6 +218,7 @@ export function BillsListTableComponent({
|
|||||||
<Input.Search
|
<Input.Search
|
||||||
placeholder={t("general.labels.search")}
|
placeholder={t("general.labels.search")}
|
||||||
value={searchText}
|
value={searchText}
|
||||||
|
disabled={!hasBillsAccess}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setSearchText(e.target.value);
|
setSearchText(e.target.value);
|
||||||
@@ -226,8 +234,13 @@ export function BillsListTableComponent({
|
|||||||
}}
|
}}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={filteredBills}
|
dataSource={hasBillsAccess ? filteredBills : []}
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
|
locale={{
|
||||||
|
...(!hasBillsAccess && {
|
||||||
|
emptyText: <UpsellComponent upsell={upsellEnum().bills.general} />
|
||||||
|
})
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { selectCaBcEtfTableConvert } from "../../redux/modals/modals.selectors";
|
|||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import CaBcEtfTableModalComponent from "./ca-bc-etf-table.modal.component";
|
import CaBcEtfTableModalComponent from "./ca-bc-etf-table.modal.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
caBcEtfTableModal: selectCaBcEtfTableConvert
|
caBcEtfTableModal: selectCaBcEtfTableConvert
|
||||||
@@ -25,6 +26,7 @@ export function ContractsFindModalContainer({ caBcEtfTableModal, toggleModalVisi
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const EtfTemplate = TemplateList("special").ca_bc_etf_table;
|
const EtfTemplate = TemplateList("special").ca_bc_etf_table;
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleFinish = async (values) => {
|
const handleFinish = async (values) => {
|
||||||
logImEXEvent("ca_bc_etf_table_parse");
|
logImEXEvent("ca_bc_etf_table_parse");
|
||||||
@@ -53,7 +55,9 @@ export function ContractsFindModalContainer({ caBcEtfTableModal, toggleModalVisi
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
values.sendby === "email" ? "e" : "p"
|
values.sendby === "email" ? "e" : "p",
|
||||||
|
null,
|
||||||
|
notification
|
||||||
);
|
);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { DeleteFilled, CopyFilled } from "@ant-design/icons";
|
import { CopyFilled, DeleteFilled } from "@ant-design/icons";
|
||||||
import { useLazyQuery, useMutation } from "@apollo/client";
|
import { useLazyQuery, useMutation } from "@apollo/client";
|
||||||
import { Button, Card, Col, Form, Input, Row, Space, Spin, Statistic, message, notification } from "antd";
|
import { Button, Card, Col, Form, Input, message, Row, Space, Spin, Statistic } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -15,6 +15,7 @@ import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
|||||||
import CurrencyFormItemComponent from "../form-items-formatted/currency-form-item.component";
|
import CurrencyFormItemComponent from "../form-items-formatted/currency-form-item.component";
|
||||||
import JobSearchSelectComponent from "../job-search-select/job-search-select.component";
|
import JobSearchSelectComponent from "../job-search-select/job-search-select.component";
|
||||||
import { getCurrentUser } from "../../firebase/firebase.utils";
|
import { getCurrentUser } from "../../firebase/firebase.utils";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
cardPaymentModal: selectCardPayment,
|
cardPaymentModal: selectCardPayment,
|
||||||
@@ -23,7 +24,14 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
insertAuditTrail: ({ jobid, operation, type }) => dispatch(insertAuditTrail({ jobid, operation, type })),
|
insertAuditTrail: ({ jobid, operation, type }) =>
|
||||||
|
dispatch(
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid,
|
||||||
|
operation,
|
||||||
|
type
|
||||||
|
})
|
||||||
|
),
|
||||||
toggleModalVisible: () => dispatch(toggleModalVisible("cardPayment"))
|
toggleModalVisible: () => dispatch(toggleModalVisible("cardPayment"))
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -39,33 +47,42 @@ const CardPaymentModalComponent = ({
|
|||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [paymentLink, setPaymentLink] = useState();
|
const [paymentLink, setPaymentLink] = useState();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
// const [insertPayment] = useMutation(INSERT_NEW_PAYMENT);
|
|
||||||
const [insertPaymentResponse] = useMutation(INSERT_PAYMENT_RESPONSE);
|
const [insertPaymentResponse] = useMutation(INSERT_PAYMENT_RESPONSE);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const [, { data, refetch, queryLoading }] = useLazyQuery(QUERY_RO_AND_OWNER_BY_JOB_PKS, {
|
const [, { data, refetch, queryLoading }] = useLazyQuery(QUERY_RO_AND_OWNER_BY_JOB_PKS, {
|
||||||
variables: { jobids: [context.jobid] },
|
variables: { jobids: [context.jobid] },
|
||||||
skip: !context?.jobid
|
skip: !context?.jobid
|
||||||
});
|
});
|
||||||
|
|
||||||
//Initialize the intellipay window.
|
const collectIPayFields = () => {
|
||||||
|
const iPayFields = document.querySelectorAll(".ipayfield");
|
||||||
|
const iPayData = {};
|
||||||
|
iPayFields.forEach((field) => {
|
||||||
|
iPayData[field.dataset.ipayname] = field.value;
|
||||||
|
});
|
||||||
|
return iPayData;
|
||||||
|
};
|
||||||
|
|
||||||
const SetIntellipayCallbackFunctions = () => {
|
const SetIntellipayCallbackFunctions = () => {
|
||||||
console.log("*** Set IntelliPay callback functions.");
|
console.log("*** Set IntelliPay callback functions.");
|
||||||
|
|
||||||
window.intellipay.runOnClose(() => {
|
window.intellipay.runOnClose(() => {
|
||||||
//window.intellipay.initialize();
|
//window.intellipay.initialize();
|
||||||
});
|
});
|
||||||
|
|
||||||
window.intellipay.runOnApproval(async function (response) {
|
window.intellipay.runOnApproval(() => {
|
||||||
//2024-04-25: Nothing is going to happen here anymore. We'll completely rely on the callback.
|
//2024-04-25: Nothing is going to happen here anymore. We'll completely rely on the callback.
|
||||||
//Add a slight delay to allow the refetch to properly get the data.
|
//Add a slight delay to allow the refetch to properly get the data.
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (actions && actions.refetch && typeof actions.refetch === "function") actions.refetch();
|
if (actions?.refetch) actions.refetch();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
toggleModalVisible();
|
toggleModalVisible();
|
||||||
}, 750);
|
}, 750);
|
||||||
});
|
});
|
||||||
|
|
||||||
window.intellipay.runOnNonApproval(async function (response) {
|
window.intellipay.runOnNonApproval(async (response) => {
|
||||||
// Mutate unsuccessful payment
|
// Mutate unsuccessful payment
|
||||||
|
|
||||||
const { payments } = form.getFieldsValue();
|
const { payments } = form.getFieldsValue();
|
||||||
@@ -98,30 +115,39 @@ const CardPaymentModalComponent = ({
|
|||||||
//Validate
|
//Validate
|
||||||
try {
|
try {
|
||||||
await form.validateFields();
|
await form.validateFields();
|
||||||
} catch (error) {
|
} catch {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const iPayData = collectIPayFields();
|
||||||
|
const { payments } = form.getFieldsValue();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.post("/intellipay/lightbox_credentials", {
|
const response = await axios.post("/intellipay/lightbox_credentials", {
|
||||||
bodyshop,
|
bodyshop,
|
||||||
refresh: !!window.intellipay,
|
refresh: !!window.intellipay,
|
||||||
paymentSplitMeta: form.getFieldsValue()
|
paymentSplitMeta: form.getFieldsValue(),
|
||||||
|
iPayData: iPayData,
|
||||||
|
comment: btoa(JSON.stringify({ payments, userEmail: currentUser.email }))
|
||||||
});
|
});
|
||||||
|
|
||||||
if (window.intellipay) {
|
if (window.intellipay) {
|
||||||
// eslint-disable-next-line no-eval
|
// eslint-disable-next-line no-eval
|
||||||
eval(response.data);
|
eval(response.data);
|
||||||
SetIntellipayCallbackFunctions();
|
pollForIntelliPay(() => {
|
||||||
window.intellipay.autoOpen();
|
SetIntellipayCallbackFunctions();
|
||||||
|
window.intellipay.autoOpen();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
var rg = document.createRange();
|
const rg = document.createRange();
|
||||||
let node = rg.createContextualFragment(response.data);
|
const node = rg.createContextualFragment(response.data);
|
||||||
document.documentElement.appendChild(node);
|
document.documentElement.appendChild(node);
|
||||||
SetIntellipayCallbackFunctions();
|
pollForIntelliPay(() => {
|
||||||
window.intellipay.isAutoOpen = true;
|
SetIntellipayCallbackFunctions();
|
||||||
window.intellipay.initialize();
|
window.intellipay.isAutoOpen = true;
|
||||||
|
window.intellipay.initialize();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notification.open({
|
notification.open({
|
||||||
@@ -137,25 +163,27 @@ const CardPaymentModalComponent = ({
|
|||||||
//Validate
|
//Validate
|
||||||
try {
|
try {
|
||||||
await form.validateFields();
|
await form.validateFields();
|
||||||
} catch (error) {
|
} catch {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const iPayData = collectIPayFields();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { payments } = form.getFieldsValue();
|
const { payments } = form.getFieldsValue();
|
||||||
const response = await axios.post("/intellipay/generate_payment_url", {
|
const response = await axios.post("/intellipay/generate_payment_url", {
|
||||||
bodyshop,
|
bodyshop,
|
||||||
amount: payments?.reduce((acc, val) => {
|
amount: payments.reduce((acc, val) => acc + (val?.amount || 0), 0),
|
||||||
return acc + (val?.amount || 0);
|
account: payments && data?.jobs?.length > 0 ? data.jobs.map((j) => j.ro_number).join(", ") : null,
|
||||||
}, 0),
|
|
||||||
account: payments && data && data.jobs.length > 0 ? data.jobs.map((j) => j.ro_number).join(", ") : null,
|
|
||||||
comment: btoa(JSON.stringify({ payments, userEmail: currentUser.email })),
|
comment: btoa(JSON.stringify({ payments, userEmail: currentUser.email })),
|
||||||
paymentSplitMeta: form.getFieldsValue()
|
paymentSplitMeta: form.getFieldsValue(),
|
||||||
|
iPayData: iPayData
|
||||||
});
|
});
|
||||||
if (response.data) {
|
|
||||||
setPaymentLink(response.data?.shorUrl);
|
if (response?.data?.shorUrl) {
|
||||||
navigator.clipboard.writeText(response.data?.shorUrl);
|
setPaymentLink(response.data.shorUrl);
|
||||||
|
await navigator.clipboard.writeText(response.data.shorUrl);
|
||||||
message.success(t("general.actions.copied"));
|
message.success(t("general.actions.copied"));
|
||||||
}
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
@@ -179,67 +207,44 @@ const CardPaymentModalComponent = ({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Form.List name={["payments"]}>
|
<Form.List name={["payments"]}>
|
||||||
{(fields, { add, remove, move }) => {
|
{(fields, { add, remove }) => (
|
||||||
return (
|
<div>
|
||||||
<div>
|
{fields.map((field, index) => (
|
||||||
{fields.map((field, index) => (
|
<Form.Item key={field.key}>
|
||||||
<Form.Item key={field.key}>
|
<Row gutter={[16, 16]}>
|
||||||
<Row gutter={[16, 16]}>
|
<Col span={16}>
|
||||||
<Col span={16}>
|
<Form.Item
|
||||||
<Form.Item
|
key={`${index}jobid`}
|
||||||
key={`${index}jobid`}
|
label={t("jobs.fields.ro_number")}
|
||||||
label={t("jobs.fields.ro_number")}
|
name={[field.name, "jobid"]}
|
||||||
name={[field.name, "jobid"]}
|
rules={[{ required: true }]}
|
||||||
rules={[
|
>
|
||||||
{
|
<JobSearchSelectComponent notExported={false} clm_no />
|
||||||
required: true
|
</Form.Item>
|
||||||
//message: t("general.validation.required"),
|
</Col>
|
||||||
}
|
<Col span={6}>
|
||||||
]}
|
<Form.Item
|
||||||
>
|
key={`${index}amount`}
|
||||||
<JobSearchSelectComponent notExported={false} clm_no />
|
label={t("payments.fields.amount")}
|
||||||
</Form.Item>
|
name={[field.name, "amount"]}
|
||||||
</Col>
|
rules={[{ required: true }]}
|
||||||
<Col span={6}>
|
>
|
||||||
<Form.Item
|
<CurrencyFormItemComponent />
|
||||||
key={`${index}amount`}
|
</Form.Item>
|
||||||
label={t("payments.fields.amount")}
|
</Col>
|
||||||
name={[field.name, "amount"]}
|
<Col span={2}>
|
||||||
rules={[
|
<DeleteFilled style={{ margin: "1rem" }} onClick={() => remove(field.name)} />
|
||||||
{
|
</Col>
|
||||||
required: true
|
</Row>
|
||||||
//message: t("general.validation.required"),
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<CurrencyFormItemComponent />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={2}>
|
|
||||||
<DeleteFilled
|
|
||||||
style={{ margin: "1rem" }}
|
|
||||||
onClick={() => {
|
|
||||||
remove(field.name);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
</Form.Item>
|
|
||||||
))}
|
|
||||||
<Form.Item>
|
|
||||||
<Button
|
|
||||||
type="dashed"
|
|
||||||
onClick={() => {
|
|
||||||
add();
|
|
||||||
}}
|
|
||||||
style={{ width: "100%" }}
|
|
||||||
>
|
|
||||||
{t("general.actions.add")}
|
|
||||||
</Button>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
))}
|
||||||
);
|
<Form.Item>
|
||||||
}}
|
<Button type="dashed" onClick={() => add()} style={{ width: "100%" }}>
|
||||||
|
{t("general.actions.add")}
|
||||||
|
</Button>
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</Form.List>
|
</Form.List>
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -283,9 +288,7 @@ const CardPaymentModalComponent = ({
|
|||||||
>
|
>
|
||||||
{() => {
|
{() => {
|
||||||
const { payments } = form.getFieldsValue();
|
const { payments } = form.getFieldsValue();
|
||||||
const totalAmountToCharge = payments?.reduce((acc, val) => {
|
const totalAmountToCharge = payments?.reduce((acc, val) => acc + (val?.amount || 0), 0);
|
||||||
return acc + (val?.amount || 0);
|
|
||||||
}, 0);
|
|
||||||
return (
|
return (
|
||||||
<Space style={{ float: "right" }}>
|
<Space style={{ float: "right" }}>
|
||||||
<Statistic title="Amount To Charge" value={totalAmountToCharge} precision={2} />
|
<Statistic title="Amount To Charge" value={totalAmountToCharge} precision={2} />
|
||||||
@@ -348,3 +351,27 @@ const CardPaymentModalComponent = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(CardPaymentModalComponent);
|
export default connect(mapStateToProps, mapDispatchToProps)(CardPaymentModalComponent);
|
||||||
|
|
||||||
|
//Poll for window.IntelliPay.fixAmount for 5 seconds. If it doesn't come up, just try anyways to force the possible error.
|
||||||
|
function pollForIntelliPay(callbackFunction) {
|
||||||
|
const timeout = 5000;
|
||||||
|
const interval = 150; // Poll every 100 milliseconds
|
||||||
|
const startTime = Date.now();
|
||||||
|
|
||||||
|
function checkFixAmount() {
|
||||||
|
if (window.intellipay && window.intellipay.fixAmount !== undefined) {
|
||||||
|
callbackFunction();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Date.now() - startTime >= timeout) {
|
||||||
|
console.log("Stopped polling IntelliPay after 10 seconds. Attemping to set functions anyways.");
|
||||||
|
callbackFunction();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(checkFixAmount, interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkFixAmount();
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||||
import { selectCardPayment } from "../../redux/modals/modals.selectors";
|
import { selectCardPayment } from "../../redux/modals/modals.selectors";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import CardPaymentModalComponent from "./card-payment-modal.component.";
|
import CardPaymentModalComponent from "./card-payment-modal.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
cardPaymentModal: selectCardPayment,
|
cardPaymentModal: selectCardPayment,
|
||||||
@@ -334,29 +334,75 @@ export const registerMessagingHandlers = ({ socket, client }) => {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "tag-added":
|
case "tag-added":
|
||||||
client.cache.modify({
|
// Ensure `job_conversations` is properly formatted
|
||||||
id: client.cache.identify({ __typename: "conversations", id: conversationId }),
|
const formattedJobConversations = job_conversations.map((jc) => ({
|
||||||
fields: {
|
__typename: "job_conversations",
|
||||||
job_conversations: (existing = []) => [...existing, ...job_conversations]
|
jobid: jc.jobid || jc.job?.id,
|
||||||
|
conversationid: conversationId,
|
||||||
|
job: jc.job || {
|
||||||
|
__typename: "jobs",
|
||||||
|
id: data.selectedJob.id,
|
||||||
|
ro_number: data.selectedJob.ro_number,
|
||||||
|
ownr_co_nm: data.selectedJob.ownr_co_nm,
|
||||||
|
ownr_fn: data.selectedJob.ownr_fn,
|
||||||
|
ownr_ln: data.selectedJob.ownr_ln
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
break;
|
|
||||||
|
|
||||||
case "tag-removed":
|
|
||||||
client.cache.modify({
|
client.cache.modify({
|
||||||
id: client.cache.identify({ __typename: "conversations", id: conversationId }),
|
id: client.cache.identify({ __typename: "conversations", id: conversationId }),
|
||||||
fields: {
|
fields: {
|
||||||
job_conversations: (existing = [], { readField }) => {
|
job_conversations: (existing = []) => {
|
||||||
return existing.filter((jobRef) => {
|
// Ensure no duplicates based on both `conversationid` and `jobid`
|
||||||
// Read the `jobid` field safely, even if the structure is normalized
|
const existingLinks = new Set(
|
||||||
const jobId = readField("jobid", jobRef);
|
existing.map((jc) => {
|
||||||
return jobId !== fields.jobId;
|
const jobId = client.cache.readFragment({
|
||||||
|
id: client.cache.identify(jc),
|
||||||
|
fragment: gql`
|
||||||
|
fragment JobConversationLinkAdded on job_conversations {
|
||||||
|
jobid
|
||||||
|
conversationid
|
||||||
|
}
|
||||||
|
`
|
||||||
|
})?.jobid;
|
||||||
|
return `${jobId}:${conversationId}`; // Unique identifier for a job-conversation link
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const newItems = formattedJobConversations.filter((jc) => {
|
||||||
|
const uniqueLink = `${jc.jobid}:${jc.conversationid}`;
|
||||||
|
return !existingLinks.has(uniqueLink);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return [...existing, ...newItems];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "tag-removed":
|
||||||
|
try {
|
||||||
|
const conversationCacheId = client.cache.identify({ __typename: "conversations", id: conversationId });
|
||||||
|
|
||||||
|
// Evict the specific cache entry for job_conversations
|
||||||
|
client.cache.evict({
|
||||||
|
id: conversationCacheId,
|
||||||
|
fieldName: "job_conversations"
|
||||||
|
});
|
||||||
|
|
||||||
|
// Garbage collect evicted entries
|
||||||
|
client.cache.gc();
|
||||||
|
|
||||||
|
logLocal("handleConversationChanged - tag removed - Refetched conversation list after state change", {
|
||||||
|
conversationId,
|
||||||
|
type
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error refetching queries after conversation state change: (Tag Removed)", error);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
logLocal("handleConversationChanged - Unhandled type", { type });
|
logLocal("handleConversationChanged - Unhandled type", { type });
|
||||||
client.cache.modify({
|
client.cache.modify({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { PlusOutlined } from "@ant-design/icons";
|
import { PlusOutlined } from "@ant-design/icons";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Input, notification, Spin, Tag, Tooltip } from "antd";
|
import { Input, Spin, Tag, Tooltip } from "antd";
|
||||||
import React, { useContext, useState } from "react";
|
import React, { useContext, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { UPDATE_CONVERSATION_LABEL } from "../../graphql/conversations.queries";
|
import { UPDATE_CONVERSATION_LABEL } from "../../graphql/conversations.queries";
|
||||||
@@ -8,6 +8,7 @@ import SocketContext from "../../contexts/SocketIO/socketContext.jsx";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors.js";
|
import { selectBodyshop } from "../../redux/user/user.selectors.js";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
@@ -20,6 +21,7 @@ export function ChatLabel({ conversation, bodyshop }) {
|
|||||||
const [editing, setEditing] = useState(false);
|
const [editing, setEditing] = useState(false);
|
||||||
const [value, setValue] = useState(conversation.label);
|
const [value, setValue] = useState(conversation.label);
|
||||||
const { socket } = useContext(SocketContext);
|
const { socket } = useContext(SocketContext);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [updateLabel] = useMutation(UPDATE_CONVERSATION_LABEL);
|
const [updateLabel] = useMutation(UPDATE_CONVERSATION_LABEL);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useRef, useState } from "react";
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import { Virtuoso } from "react-virtuoso";
|
import { Virtuoso } from "react-virtuoso";
|
||||||
import { renderMessage } from "./renderMessage";
|
import { renderMessage } from "./renderMessage";
|
||||||
import "./chat-message-list.styles.scss";
|
import "./chat-message-list.styles.scss";
|
||||||
@@ -16,7 +16,7 @@ export default function ChatMessageListComponent({ messages }) {
|
|||||||
loadedImagesRef.current = 0;
|
loadedImagesRef.current = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
const preloadImages = (imagePaths, onComplete) => {
|
const preloadImages = useCallback((imagePaths, onComplete) => {
|
||||||
resetImageLoadState();
|
resetImageLoadState();
|
||||||
|
|
||||||
if (imagePaths.length === 0) {
|
if (imagePaths.length === 0) {
|
||||||
@@ -34,7 +34,7 @@ export default function ChatMessageListComponent({ messages }) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
}, []);
|
||||||
|
|
||||||
// Ensure all images are loaded on initial render
|
// Ensure all images are loaded on initial render
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -51,7 +51,7 @@ export default function ChatMessageListComponent({ messages }) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, [messages]);
|
}, [messages, preloadImages]);
|
||||||
|
|
||||||
// Handle scrolling when new messages are added
|
// Handle scrolling when new messages are added
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -69,7 +69,7 @@ export default function ChatMessageListComponent({ messages }) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, [messages, atBottom]);
|
}, [messages, atBottom, preloadImages]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="chat">
|
<div className="chat">
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { notification } from "antd";
|
|
||||||
import parsePhoneNumber from "libphonenumber-js";
|
import parsePhoneNumber from "libphonenumber-js";
|
||||||
import React, { useContext } from "react";
|
import React, { useContext } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -10,6 +9,7 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import { searchingForConversation } from "../../redux/messaging/messaging.selectors";
|
import { searchingForConversation } from "../../redux/messaging/messaging.selectors";
|
||||||
import SocketContext from "../../contexts/SocketIO/socketContext.jsx";
|
import SocketContext from "../../contexts/SocketIO/socketContext.jsx";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -23,6 +23,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
export function ChatOpenButton({ bodyshop, searchingForConversation, phone, jobid, openChatByPhone }) {
|
export function ChatOpenButton({ bodyshop, searchingForConversation, phone, jobid, openChatByPhone }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { socket } = useContext(SocketContext);
|
const { socket } = useContext(SocketContext);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
if (!phone) return <></>;
|
if (!phone) return <></>;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { InfoCircleOutlined, MessageOutlined, ShrinkOutlined, SyncOutlined } from "@ant-design/icons";
|
import { InfoCircleOutlined, MessageOutlined, ShrinkOutlined, SyncOutlined } from "@ant-design/icons";
|
||||||
import { useApolloClient, useLazyQuery } from "@apollo/client";
|
import { useApolloClient, useLazyQuery, useQuery } from "@apollo/client";
|
||||||
import { Badge, Card, Col, Row, Space, Tag, Tooltip, Typography } from "antd";
|
import { Badge, Card, Col, Row, Space, Tag, Tooltip, Typography } from "antd";
|
||||||
import React, { useContext, useEffect, useState } from "react";
|
import React, { useContext, useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { CONVERSATION_LIST_QUERY } from "../../graphql/conversations.queries";
|
import { CONVERSATION_LIST_QUERY, UNREAD_CONVERSATION_COUNT } from "../../graphql/conversations.queries";
|
||||||
import { toggleChatVisible } from "../../redux/messaging/messaging.actions";
|
import { toggleChatVisible } from "../../redux/messaging/messaging.actions";
|
||||||
import { selectChatVisible, selectSelectedConversation } from "../../redux/messaging/messaging.selectors";
|
import { selectChatVisible, selectSelectedConversation } from "../../redux/messaging/messaging.selectors";
|
||||||
import ChatConversationListComponent from "../chat-conversation-list/chat-conversation-list.component";
|
import ChatConversationListComponent from "../chat-conversation-list/chat-conversation-list.component";
|
||||||
@@ -38,6 +38,14 @@ export function ChatPopupComponent({ chatVisible, selectedConversation, toggleCh
|
|||||||
...(pollInterval > 0 ? { pollInterval } : {})
|
...(pollInterval > 0 ? { pollInterval } : {})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Query for unread count when chat is not visible
|
||||||
|
const { data: unreadData } = useQuery(UNREAD_CONVERSATION_COUNT, {
|
||||||
|
fetchPolicy: "network-only",
|
||||||
|
nextFetchPolicy: "network-only",
|
||||||
|
skip: chatVisible, // Skip when chat is visible
|
||||||
|
...(pollInterval > 0 ? { pollInterval } : {})
|
||||||
|
});
|
||||||
|
|
||||||
// Socket connection status
|
// Socket connection status
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleSocketStatus = () => {
|
const handleSocketStatus = () => {
|
||||||
@@ -77,23 +85,29 @@ export function ChatPopupComponent({ chatVisible, selectedConversation, toggleCh
|
|||||||
|
|
||||||
// Get unread count from the cache
|
// Get unread count from the cache
|
||||||
const unreadCount = (() => {
|
const unreadCount = (() => {
|
||||||
try {
|
if (chatVisible) {
|
||||||
const cachedData = client.readQuery({
|
try {
|
||||||
query: CONVERSATION_LIST_QUERY,
|
const cachedData = client.readQuery({
|
||||||
variables: { offset: 0 }
|
query: CONVERSATION_LIST_QUERY,
|
||||||
});
|
variables: { offset: 0 }
|
||||||
|
});
|
||||||
|
|
||||||
if (!cachedData?.conversations) return 0;
|
if (!cachedData?.conversations) return 0;
|
||||||
|
|
||||||
// Aggregate unread message count
|
// Aggregate unread message count
|
||||||
return cachedData.conversations.reduce((total, conversation) => {
|
return cachedData.conversations.reduce((total, conversation) => {
|
||||||
const unread = conversation.messages_aggregate?.aggregate?.count || 0;
|
const unread = conversation.messages_aggregate?.aggregate?.count || 0;
|
||||||
return total + unread;
|
return total + unread;
|
||||||
}, 0);
|
}, 0);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn("Unread count not found in cache:", error);
|
console.warn("Unread count not found in cache:", error);
|
||||||
return 0; // Fallback if not in cache
|
return 0; // Fallback if not in cache
|
||||||
|
}
|
||||||
|
} else if (unreadData?.messages_aggregate?.aggregate?.count) {
|
||||||
|
// Use the unread count from the query result
|
||||||
|
return unreadData.messages_aggregate.aggregate.count;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { setEmailOptions } from "../../redux/email/email.actions";
|
import { setEmailOptions } from "../../redux/email/email.actions";
|
||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({});
|
const mapStateToProps = createStructuredSelector({});
|
||||||
|
|
||||||
@@ -15,6 +16,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
|
|
||||||
export function ChatPrintButton({ conversation }) {
|
export function ChatPrintButton({ conversation }) {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const generateDocument = (type) => {
|
const generateDocument = (type) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -27,7 +29,8 @@ export function ChatPrintButton({ conversation }) {
|
|||||||
subject: TemplateList("messaging").conversation_list.subject
|
subject: TemplateList("messaging").conversation_list.subject
|
||||||
},
|
},
|
||||||
type,
|
type,
|
||||||
conversation.id
|
conversation.id,
|
||||||
|
notification
|
||||||
).catch((e) => {
|
).catch((e) => {
|
||||||
console.warn("Something went wrong generating a document.");
|
console.warn("Something went wrong generating a document.");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -52,20 +52,26 @@ export function ChatTagRoContainer({ conversation, bodyshop }) {
|
|||||||
// Find the job details from the search data
|
// Find the job details from the search data
|
||||||
const selectedJob = data?.search_jobs.find((job) => job.id === option.key);
|
const selectedJob = data?.search_jobs.find((job) => job.id === option.key);
|
||||||
if (!selectedJob) return;
|
if (!selectedJob) return;
|
||||||
const newJobConversation = {
|
|
||||||
__typename: "job_conversations",
|
|
||||||
jobid: selectedJob.id,
|
|
||||||
conversationid: conversation.id,
|
|
||||||
job: {
|
|
||||||
__typename: "jobs",
|
|
||||||
...selectedJob
|
|
||||||
}
|
|
||||||
};
|
|
||||||
socket.emit("conversation-modified", {
|
socket.emit("conversation-modified", {
|
||||||
conversationId: conversation.id,
|
conversationId: conversation.id,
|
||||||
bodyshopId: bodyshop.id,
|
bodyshopId: bodyshop.id,
|
||||||
type: "tag-added",
|
type: "tag-added",
|
||||||
job_conversations: [newJobConversation]
|
selectedJob,
|
||||||
|
job_conversations: [
|
||||||
|
{
|
||||||
|
__typename: "job_conversations",
|
||||||
|
jobid: selectedJob.id,
|
||||||
|
conversationid: conversation.id,
|
||||||
|
job: {
|
||||||
|
__typename: "jobs",
|
||||||
|
id: selectedJob.id,
|
||||||
|
ro_number: selectedJob.ro_number,
|
||||||
|
ownr_co_nm: selectedJob.ownr_co_nm,
|
||||||
|
ownr_fn: selectedJob.ownr_fn,
|
||||||
|
ownr_ln: selectedJob.ownr_ln
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ export default function ConflictComponent() {
|
|||||||
{t("general.labels.instanceconflictext", {
|
{t("general.labels.instanceconflictext", {
|
||||||
app: InstanceRenderManager({
|
app: InstanceRenderManager({
|
||||||
imex: "$t(titles.imexonline)",
|
imex: "$t(titles.imexonline)",
|
||||||
rome: "$t(titles.romeonline)",
|
rome: "$t(titles.romeonline)"
|
||||||
promanager: "$t(titles.promanager)"
|
|
||||||
})
|
})
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, Form, InputNumber, notification, Popover, Radio, Select, Space } from "antd";
|
import { Button, Form, InputNumber, Popover, Radio, Select, Space } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
@@ -9,6 +9,7 @@ import { useNavigate } from "react-router-dom";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { INSERT_NEW_JOB } from "../../graphql/jobs.queries";
|
import { INSERT_NEW_JOB } from "../../graphql/jobs.queries";
|
||||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
@@ -25,6 +26,7 @@ export function ContractConvertToRo({ bodyshop, currentUser, contract, disabled
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [insertJob] = useMutation(INSERT_NEW_JOB);
|
const [insertJob] = useMutation(INSERT_NEW_JOB);
|
||||||
const history = useNavigate();
|
const history = useNavigate();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleFinish = async (values) => {
|
const handleFinish = async (values) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import { useLazyQuery } from "@apollo/client";
|
import { useLazyQuery } from "@apollo/client";
|
||||||
import { Button, notification } from "antd";
|
import { Button } from "antd";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { GET_JOB_FOR_CC_CONTRACT } from "../../graphql/jobs.queries";
|
import { GET_JOB_FOR_CC_CONTRACT } from "../../graphql/jobs.queries";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function ContractCreateJobPrefillComponent({ jobId, form }) {
|
export default function ContractCreateJobPrefillComponent({ jobId, form }) {
|
||||||
const [call, { loading, error, data }] = useLazyQuery(GET_JOB_FOR_CC_CONTRACT);
|
const [call, { loading, error, data }] = useLazyQuery(GET_JOB_FOR_CC_CONTRACT);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
call({ variables: { id: jobId } });
|
call({ variables: { id: jobId } });
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Form, Modal, notification } from "antd";
|
import { Form, Modal } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -10,6 +10,7 @@ import CourtesyCarReturnModalComponent from "./courtesy-car-return-modal.compone
|
|||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import { RETURN_CONTRACT } from "../../graphql/cccontracts.queries";
|
import { RETURN_CONTRACT } from "../../graphql/cccontracts.queries";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
courtesyCarReturnModal: selectCourtesyCarReturn,
|
courtesyCarReturnModal: selectCourtesyCarReturn,
|
||||||
@@ -26,6 +27,8 @@ export function CCReturnModalContainer({ courtesyCarReturnModal, toggleModalVisi
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [updateContract] = useMutation(RETURN_CONTRACT);
|
const [updateContract] = useMutation(RETURN_CONTRACT);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleFinish = (values) => {
|
const handleFinish = (values) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
updateContract({
|
updateContract({
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { TemplateList } from "../../utils/TemplateConstants";
|
|||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import useLocalStorage from "../../utils/useLocalStorage";
|
import useLocalStorage from "../../utils/useLocalStorage";
|
||||||
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
@@ -18,6 +19,7 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
|||||||
const [searchText, setSearchText] = useState("");
|
const [searchText, setSearchText] = useState("");
|
||||||
const [filter, setFilter] = useLocalStorage("filter_courtesy_cars_list", null);
|
const [filter, setFilter] = useLocalStorage("filter_courtesy_cars_list", null);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
@@ -64,8 +66,8 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: t("courtesycars.status.unavailable"),
|
text: t("courtesycars.status.unavailable"),
|
||||||
value: "courtesycars.status.unavailable",
|
value: "courtesycars.status.unavailable"
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
onFilter: (value, record) => record.status === value,
|
onFilter: (value, record) => record.status === value,
|
||||||
sortOrder: state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
sortOrder: state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||||
@@ -239,7 +241,9 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
"p"
|
"p",
|
||||||
|
null,
|
||||||
|
notification
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Icon, { SyncOutlined } from "@ant-design/icons";
|
import Icon, { SyncOutlined } from "@ant-design/icons";
|
||||||
import { gql, useMutation, useQuery } from "@apollo/client";
|
import { gql, useMutation, useQuery } from "@apollo/client";
|
||||||
import { Button, Dropdown, notification, Space } from "antd";
|
import { Button, Dropdown, Space } from "antd";
|
||||||
import { PageHeader } from "@ant-design/pro-layout";
|
import { PageHeader } from "@ant-design/pro-layout";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
@@ -46,6 +46,7 @@ import JobLifecycleDashboardComponent, {
|
|||||||
} from "../dashboard-components/job-lifecycle/job-lifecycle-dashboard.component";
|
} from "../dashboard-components/job-lifecycle/job-lifecycle-dashboard.component";
|
||||||
import "./dashboard-grid.styles.scss";
|
import "./dashboard-grid.styles.scss";
|
||||||
import { GenerateDashboardData } from "./dashboard-grid.utils";
|
import { GenerateDashboardData } from "./dashboard-grid.utils";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const ResponsiveReactGridLayout = WidthProvider(Responsive);
|
const ResponsiveReactGridLayout = WidthProvider(Responsive);
|
||||||
|
|
||||||
@@ -64,6 +65,7 @@ export function DashboardGridComponent({ currentUser, bodyshop }) {
|
|||||||
? bodyshop.associations[0].user.dashboardlayout
|
? bodyshop.associations[0].user.dashboardlayout
|
||||||
: { items: [], layout: {}, layouts: [] })
|
: { items: [], layout: {}, layouts: [] })
|
||||||
});
|
});
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const { loading, error, data, refetch } = useQuery(createDashboardQuery(state), {
|
const { loading, error, data, refetch } = useQuery(createDashboardQuery(state), {
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selecto
|
|||||||
import { handleUpload } from "../documents-upload/documents-upload.utility";
|
import { handleUpload } from "../documents-upload/documents-upload.utility";
|
||||||
import { GenerateSrcUrl } from "../jobs-documents-gallery/job-documents.utility";
|
import { GenerateSrcUrl } from "../jobs-documents-gallery/job-documents.utility";
|
||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
@@ -24,6 +25,7 @@ export function DocumentEditorComponent({ currentUser, bodyshop, document }) {
|
|||||||
const [uploaded, setuploaded] = useState(false);
|
const [uploaded, setuploaded] = useState(false);
|
||||||
const markerArea = useRef(null);
|
const markerArea = useRef(null);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const triggerUpload = useCallback(
|
const triggerUpload = useCallback(
|
||||||
async (dataUrl) => {
|
async (dataUrl) => {
|
||||||
@@ -45,10 +47,11 @@ export function DocumentEditorComponent({ currentUser, bodyshop, document }) {
|
|||||||
//billId: billId,
|
//billId: billId,
|
||||||
tagsArray: ["edited"]
|
tagsArray: ["edited"]
|
||||||
//callback: callbackAfterUpload,
|
//callback: callbackAfterUpload,
|
||||||
}
|
},
|
||||||
|
notification
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
[bodyshop, currentUser, document]
|
[bodyshop, currentUser, document, notification]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ import { connect } from "react-redux";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import { handleUpload } from "./documents-local-upload.utility";
|
import { handleUpload } from "./documents-local-upload.utility";
|
||||||
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
|
import LockWrapperComponent from "../lock-wrapper/lock-wrapper.component";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
@@ -23,6 +27,8 @@ export function DocumentsLocalUploadComponent({
|
|||||||
allowAllTypes
|
allowAllTypes
|
||||||
}) {
|
}) {
|
||||||
const [fileList, setFileList] = useState([]);
|
const [fileList, setFileList] = useState([]);
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleDone = (uid) => {
|
const handleDone = (uid) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -30,10 +36,13 @@ export function DocumentsLocalUploadComponent({
|
|||||||
}, 2000);
|
}, 2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const hasMediaAccess = HasFeatureAccess({ bodyshop, featureName: "media" });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Upload.Dragger
|
<Upload.Dragger
|
||||||
multiple={true}
|
multiple={true}
|
||||||
fileList={fileList}
|
fileList={fileList}
|
||||||
|
disabled={!hasMediaAccess}
|
||||||
onChange={(f) => {
|
onChange={(f) => {
|
||||||
if (f.event && f.event.percent === 100) handleDone(f.file.uid);
|
if (f.event && f.event.percent === 100) handleDone(f.file.uid);
|
||||||
|
|
||||||
@@ -47,7 +56,8 @@ export function DocumentsLocalUploadComponent({
|
|||||||
vendorid,
|
vendorid,
|
||||||
invoice_number,
|
invoice_number,
|
||||||
callback: callbackAfterUpload
|
callback: callbackAfterUpload
|
||||||
}
|
},
|
||||||
|
notification
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
{...(!allowAllTypes && {
|
{...(!allowAllTypes && {
|
||||||
@@ -59,7 +69,9 @@ export function DocumentsLocalUploadComponent({
|
|||||||
<p className="ant-upload-drag-icon">
|
<p className="ant-upload-drag-icon">
|
||||||
<UploadOutlined />
|
<UploadOutlined />
|
||||||
</p>
|
</p>
|
||||||
<p className="ant-upload-text">Click or drag files to this area to upload.</p>
|
<p className="ant-upload-text">
|
||||||
|
<LockWrapperComponent featureName="media">{t("documents.labels.dragtoupload")}</LockWrapperComponent>
|
||||||
|
</p>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Upload.Dragger>
|
</Upload.Dragger>
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import cleanAxios from "../../utils/CleanAxios";
|
|||||||
import { store } from "../../redux/store";
|
import { store } from "../../redux/store";
|
||||||
import { addMediaForJob } from "../../redux/media/media.actions";
|
import { addMediaForJob } from "../../redux/media/media.actions";
|
||||||
import normalizeUrl from "normalize-url";
|
import normalizeUrl from "normalize-url";
|
||||||
import { notification } from "antd";
|
|
||||||
import i18n from "i18next";
|
import i18n from "i18next";
|
||||||
|
|
||||||
export const handleUpload = async ({ ev, context }) => {
|
export const handleUpload = async ({ ev, context, notification }) => {
|
||||||
const { onError, onSuccess, onProgress, file } = ev;
|
const { onError, onSuccess, onProgress, file } = ev;
|
||||||
const { jobid, invoice_number, vendorid, callbackAfterUpload } = context;
|
const { jobid, invoice_number, vendorid, callbackAfterUpload } = context;
|
||||||
|
|
||||||
@@ -43,11 +42,15 @@ export const handleUpload = async ({ ev, context }) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
onSuccess && onSuccess(file);
|
onSuccess && onSuccess(file);
|
||||||
notification.open({
|
if (notification) {
|
||||||
type: "success",
|
notification.open({
|
||||||
key: "docuploadsuccess",
|
type: "success",
|
||||||
message: i18n.t("documents.successes.insert")
|
key: "docuploadsuccess",
|
||||||
});
|
message: i18n.t("documents.successes.insert")
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error("No notification context found in document local upload utility.");
|
||||||
|
}
|
||||||
store.dispatch(
|
store.dispatch(
|
||||||
addMediaForJob({
|
addMediaForJob({
|
||||||
jobid,
|
jobid,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { UploadOutlined } from "@ant-design/icons";
|
import { UploadOutlined } from "@ant-design/icons";
|
||||||
import { notification, Progress, Result, Space, Upload } from "antd";
|
import { Progress, Result, Space, Upload } from "antd";
|
||||||
import React, { useMemo, useState } from "react";
|
import React, { useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -7,6 +7,9 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import formatBytes from "../../utils/formatbytes";
|
import formatBytes from "../../utils/formatbytes";
|
||||||
import { handleUpload } from "./documents-upload.utility";
|
import { handleUpload } from "./documents-upload.utility";
|
||||||
|
import LockWrapperComponent from "../lock-wrapper/lock-wrapper.component";
|
||||||
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
@@ -26,6 +29,7 @@ export function DocumentsUploadComponent({
|
|||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [fileList, setFileList] = useState([]);
|
const [fileList, setFileList] = useState([]);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const pct = useMemo(() => {
|
const pct = useMemo(() => {
|
||||||
return parseInt((totalSize / ((bodyshop && bodyshop.jobsizelimit) || 1)) * 100);
|
return parseInt((totalSize / ((bodyshop && bodyshop.jobsizelimit) || 1)) * 100);
|
||||||
@@ -45,11 +49,13 @@ export function DocumentsUploadComponent({
|
|||||||
setFileList((fileList) => fileList.filter((x) => x.uid !== uid));
|
setFileList((fileList) => fileList.filter((x) => x.uid !== uid));
|
||||||
}, 2000);
|
}, 2000);
|
||||||
};
|
};
|
||||||
|
const hasMediaAccess = HasFeatureAccess({ bodyshop, featureName: "media" });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Upload.Dragger
|
<Upload.Dragger
|
||||||
multiple={true}
|
multiple={true}
|
||||||
fileList={fileList}
|
fileList={fileList}
|
||||||
|
disabled={!hasMediaAccess}
|
||||||
onChange={(f) => {
|
onChange={(f) => {
|
||||||
if (f.event && f.event.percent === 100) handleDone(f.file.uid);
|
if (f.event && f.event.percent === 100) handleDone(f.file.uid);
|
||||||
setFileList(f.fileList);
|
setFileList(f.fileList);
|
||||||
@@ -72,14 +78,18 @@ export function DocumentsUploadComponent({
|
|||||||
return true;
|
return true;
|
||||||
}}
|
}}
|
||||||
customRequest={(ev) =>
|
customRequest={(ev) =>
|
||||||
handleUpload(ev, {
|
handleUpload(
|
||||||
bodyshop: bodyshop,
|
ev,
|
||||||
uploaded_by: currentUser.email,
|
{
|
||||||
jobId: jobId,
|
bodyshop: bodyshop,
|
||||||
billId: billId,
|
uploaded_by: currentUser.email,
|
||||||
tagsArray: tagsArray,
|
jobId: jobId,
|
||||||
callback: callbackAfterUpload
|
billId: billId,
|
||||||
})
|
tagsArray: tagsArray,
|
||||||
|
callback: callbackAfterUpload
|
||||||
|
},
|
||||||
|
notification
|
||||||
|
)
|
||||||
}
|
}
|
||||||
accept="audio/*, video/*, image/*, .pdf, .doc, .docx, .xls, .xlsx"
|
accept="audio/*, video/*, image/*, .pdf, .doc, .docx, .xls, .xlsx"
|
||||||
// showUploadList={false}
|
// showUploadList={false}
|
||||||
@@ -89,7 +99,9 @@ export function DocumentsUploadComponent({
|
|||||||
<p className="ant-upload-drag-icon">
|
<p className="ant-upload-drag-icon">
|
||||||
<UploadOutlined />
|
<UploadOutlined />
|
||||||
</p>
|
</p>
|
||||||
<p className="ant-upload-text">Click or drag files to this area to upload.</p>
|
<p className="ant-upload-text">
|
||||||
|
<LockWrapperComponent featureName="media">{t("documents.labels.dragtoupload")}</LockWrapperComponent>
|
||||||
|
</p>
|
||||||
{!ignoreSizeLimit && (
|
{!ignoreSizeLimit && (
|
||||||
<Space wrap className="ant-upload-text">
|
<Space wrap className="ant-upload-text">
|
||||||
<Progress type="dashboard" percent={pct} size="small" />
|
<Progress type="dashboard" percent={pct} size="small" />
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { notification } from "antd";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import i18n from "i18next";
|
import i18n from "i18next";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
@@ -14,7 +13,7 @@ import { store } from "../../redux/store";
|
|||||||
var cleanAxios = axios.create();
|
var cleanAxios = axios.create();
|
||||||
cleanAxios.interceptors.request.eject(axiosAuthInterceptorId);
|
cleanAxios.interceptors.request.eject(axiosAuthInterceptorId);
|
||||||
|
|
||||||
export const handleUpload = (ev, context) => {
|
export const handleUpload = (ev, context, notification) => {
|
||||||
logImEXEvent("document_upload", { filetype: ev.file.type });
|
logImEXEvent("document_upload", { filetype: ev.file.type });
|
||||||
|
|
||||||
const { onError, onSuccess, onProgress } = ev;
|
const { onError, onSuccess, onProgress } = ev;
|
||||||
@@ -24,10 +23,20 @@ export const handleUpload = (ev, context) => {
|
|||||||
|
|
||||||
let key = `${bodyshop.id}/${jobId}/${replaceAccents(fileName).replace(/[^A-Z0-9]+/gi, "_")}-${new Date().getTime()}`;
|
let key = `${bodyshop.id}/${jobId}/${replaceAccents(fileName).replace(/[^A-Z0-9]+/gi, "_")}-${new Date().getTime()}`;
|
||||||
let extension = fileName.split(".").pop();
|
let extension = fileName.split(".").pop();
|
||||||
uploadToCloudinary(key, extension, ev.file.type, ev.file, onError, onSuccess, onProgress, context);
|
uploadToCloudinary(key, extension, ev.file.type, ev.file, onError, onSuccess, onProgress, context, notification);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const uploadToCloudinary = async (key, extension, fileType, file, onError, onSuccess, onProgress, context) => {
|
export const uploadToCloudinary = async (
|
||||||
|
key,
|
||||||
|
extension,
|
||||||
|
fileType,
|
||||||
|
file,
|
||||||
|
onError,
|
||||||
|
onSuccess,
|
||||||
|
onProgress,
|
||||||
|
context,
|
||||||
|
notification
|
||||||
|
) => {
|
||||||
const { bodyshop, jobId, billId, uploaded_by, callback, tagsArray } = context;
|
const { bodyshop, jobId, billId, uploaded_by, callback, tagsArray } = context;
|
||||||
|
|
||||||
//Set variables for getting the signed URL.
|
//Set variables for getting the signed URL.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Button, Divider, Form, Modal, notification, Space } from "antd";
|
import { Button, Divider, Form, Modal, Space } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -13,6 +13,7 @@ import { EmailSettings } from "../../utils/TemplateConstants";
|
|||||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
import EmailOverlayComponent from "./email-overlay.component";
|
import EmailOverlayComponent from "./email-overlay.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
modalVisible: selectEmailVisible,
|
modalVisible: selectEmailVisible,
|
||||||
@@ -36,6 +37,7 @@ export function EmailOverlayContainer({ emailConfig, modalVisible, toggleEmailOv
|
|||||||
pdf: null
|
pdf: null
|
||||||
});
|
});
|
||||||
const [selectedMedia, setSelectedMedia] = useState([]);
|
const [selectedMedia, setSelectedMedia] = useState([]);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const defaultEmailFrom = {
|
const defaultEmailFrom = {
|
||||||
from: {
|
from: {
|
||||||
@@ -109,7 +111,14 @@ export function EmailOverlayContainer({ emailConfig, modalVisible, toggleEmailOv
|
|||||||
const render = async () => {
|
const render = async () => {
|
||||||
logImEXEvent("email_render_template", { template: emailConfig.template });
|
logImEXEvent("email_render_template", { template: emailConfig.template });
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
let { html, pdf, filename } = await RenderTemplate(emailConfig.template, bodyshop, true);
|
let { html, pdf, filename } = await RenderTemplate(
|
||||||
|
emailConfig.template,
|
||||||
|
bodyshop,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
notification
|
||||||
|
);
|
||||||
|
|
||||||
const response = await axios.post("/render/inlinecss", {
|
const response = await axios.post("/render/inlinecss", {
|
||||||
html: html,
|
html: html,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { GenerateDocument } from "../../utils/RenderTemplate";
|
|||||||
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
|
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser
|
currentUser: selectCurrentUser
|
||||||
@@ -19,6 +20,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
|
|
||||||
export function EmailTestComponent({ currentUser, setEmailOptions }) {
|
export function EmailTestComponent({ currentUser, setEmailOptions }) {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleFinish = (values) => {
|
const handleFinish = (values) => {
|
||||||
GenerateDocument(
|
GenerateDocument(
|
||||||
@@ -40,7 +42,9 @@ export function EmailTestComponent({ currentUser, setEmailOptions }) {
|
|||||||
{
|
{
|
||||||
to: values.to
|
to: values.to
|
||||||
},
|
},
|
||||||
values.email ? "e" : "p"
|
values.email ? "e" : "p",
|
||||||
|
null,
|
||||||
|
notification
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
import * as Sentry from "@sentry/react";
|
||||||
import { Button, Col, Collapse, Result, Row, Space } from "antd";
|
import { Button, Col, Collapse, Result, Row, Space } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { withTranslation } from "react-i18next";
|
import { withTranslation } from "react-i18next";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
|
||||||
import * as Sentry from "@sentry/react";
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
|
|
||||||
@@ -38,28 +38,23 @@ class ErrorBoundary extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleErrorSubmit = () => {
|
handleErrorSubmit = () => {
|
||||||
InstanceRenderManager({
|
window.$crisp.push([
|
||||||
executeFunction: true,
|
"do",
|
||||||
args: [],
|
"message:send",
|
||||||
imex: () => {
|
[
|
||||||
window.$crisp.push([
|
"text",
|
||||||
"do",
|
`I hit the following error: \n\n
|
||||||
"message:send",
|
|
||||||
[
|
|
||||||
"text",
|
|
||||||
`I hit the following error: \n\n
|
|
||||||
${this.state.error.message}\n\n
|
${this.state.error.message}\n\n
|
||||||
${this.state.error.stack}\n\n
|
${this.state.error.stack}\n\n
|
||||||
URL:${window.location} as ${this.props.currentUser.email} for ${
|
URL:${window.location} as ${this.props.currentUser.email} for ${
|
||||||
this.props.bodyshop && this.props.bodyshop.name
|
this.props.bodyshop && this.props.bodyshop.name
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
window.$crisp.push(["do", "chat:open"]);
|
||||||
|
|
||||||
window.$crisp.push(["do", "chat:open"]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// const errorDescription = `**Please add relevant details about what you were doing before you encountered this issue**
|
// const errorDescription = `**Please add relevant details about what you were doing before you encountered this issue**
|
||||||
|
|
||||||
// ----
|
// ----
|
||||||
@@ -108,8 +103,7 @@ class ErrorBoundary extends React.Component {
|
|||||||
subTitle={t("general.messages.exception", {
|
subTitle={t("general.messages.exception", {
|
||||||
app: InstanceRenderManager({
|
app: InstanceRenderManager({
|
||||||
imex: "$t(titles.imexonline)",
|
imex: "$t(titles.imexonline)",
|
||||||
rome: "$t(titles.romeonline)",
|
rome: "$t(titles.romeonline)"
|
||||||
promanager: "$t(titles.promanager)"
|
|
||||||
})
|
})
|
||||||
})}
|
})}
|
||||||
extra={
|
extra={
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import { Button, Card, Checkbox, Col, Form, Input, Modal, notification, Row } from "antd";
|
import { Button, Card, Checkbox, Col, Form, Input, Modal, Row } from "antd";
|
||||||
import Markdown from "react-markdown";
|
import Markdown from "react-markdown";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectCurrentEula, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectCurrentEula, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
@@ -12,6 +12,7 @@ import dayjs from "../../utils/day";
|
|||||||
|
|
||||||
import "./eula.styles.scss";
|
import "./eula.styles.scss";
|
||||||
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component.jsx";
|
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component.jsx";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const Eula = ({ currentEula, currentUser, acceptEula }) => {
|
const Eula = ({ currentEula, currentUser, acceptEula }) => {
|
||||||
const [formReady, setFormReady] = useState(false);
|
const [formReady, setFormReady] = useState(false);
|
||||||
@@ -20,7 +21,7 @@ const Eula = ({ currentEula, currentUser, acceptEula }) => {
|
|||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const markdownCardRef = useRef(null);
|
const markdownCardRef = useRef(null);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [api, contextHolder] = notification.useNotification();
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleScroll = useCallback(
|
const handleScroll = useCallback(
|
||||||
(e) => {
|
(e) => {
|
||||||
@@ -75,7 +76,7 @@ const Eula = ({ currentEula, currentUser, acceptEula }) => {
|
|||||||
});
|
});
|
||||||
acceptEula();
|
acceptEula();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
api.error({
|
notification.error({
|
||||||
message: t("eula.errors.acceptance.message"),
|
message: t("eula.errors.acceptance.message"),
|
||||||
description: t("eula.errors.acceptance.description"),
|
description: t("eula.errors.acceptance.description"),
|
||||||
placement: "bottomRight",
|
placement: "bottomRight",
|
||||||
@@ -91,7 +92,6 @@ const Eula = ({ currentEula, currentUser, acceptEula }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{contextHolder}
|
|
||||||
<Modal
|
<Modal
|
||||||
title={t("eula.titles.modal")}
|
title={t("eula.titles.modal")}
|
||||||
className="eula-modal"
|
className="eula-modal"
|
||||||
|
|||||||
144
client/src/components/feature-wrapper/blur-wrapper.component.jsx
Normal file
144
client/src/components/feature-wrapper/blur-wrapper.component.jsx
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
import Dinero from "dinero.js";
|
||||||
|
import React from "react";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import { HasFeatureAccess } from "./feature-wrapper.component";
|
||||||
|
import { DateTimeFormatterFunction } from "../../utils/DateFormatter";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop
|
||||||
|
});
|
||||||
|
const blurringProps = {
|
||||||
|
filter: "blur(4px)",
|
||||||
|
webkitUserSelect: "none",
|
||||||
|
msUserSelect: "none",
|
||||||
|
mozUserSelect: "none",
|
||||||
|
userSelect: "none",
|
||||||
|
pointerEvents: "none"
|
||||||
|
};
|
||||||
|
|
||||||
|
export function BlurWrapper({
|
||||||
|
bodyshop,
|
||||||
|
featureName,
|
||||||
|
styleProp = "style",
|
||||||
|
valueProp = "value",
|
||||||
|
overrideValue = true,
|
||||||
|
overrideValueFunction,
|
||||||
|
children,
|
||||||
|
debug,
|
||||||
|
bypass
|
||||||
|
}) {
|
||||||
|
if (import.meta.env.DEV) {
|
||||||
|
if (!ValidateFeatureName(featureName)) console.trace("*** INVALID FEATURE NAME", featureName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debug) {
|
||||||
|
console.trace("*** DEBUG MODE", featureName);
|
||||||
|
console.log("*** HAS FEATURE ACCESS?", featureName, HasFeatureAccess({ featureName, bodyshop }));
|
||||||
|
console.log(
|
||||||
|
"***LOG ~ All Blur Wrapper Props ",
|
||||||
|
styleProp,
|
||||||
|
valueProp,
|
||||||
|
overrideValue,
|
||||||
|
overrideValueFunction,
|
||||||
|
children,
|
||||||
|
debug,
|
||||||
|
bypass
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bypass) {
|
||||||
|
if (import.meta.env.DEV) {
|
||||||
|
console.trace("*** Blur Wrapper BYPASS USED", featureName);
|
||||||
|
}
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!HasFeatureAccess({ featureName, bodyshop })) {
|
||||||
|
const childrenWithBlurProps = React.Children.map(children, (child) => {
|
||||||
|
if (React.isValidElement(child)) {
|
||||||
|
//Clone the child, and spread in our props to overwrite it.
|
||||||
|
let newValueProp;
|
||||||
|
if (!overrideValue) {
|
||||||
|
newValueProp = child.props[valueProp];
|
||||||
|
} else {
|
||||||
|
if (typeof overrideValueFunction === "function") {
|
||||||
|
newValueProp = overrideValueFunction();
|
||||||
|
} else if (typeof overrideValueFunction === "string" && overrideValueFunction === "RandomDinero") {
|
||||||
|
newValueProp = RandomDinero();
|
||||||
|
} else if (typeof overrideValueFunction === "string" && overrideValueFunction === "RandomAmount") {
|
||||||
|
newValueProp = RandomAmount();
|
||||||
|
} else if (
|
||||||
|
typeof overrideValueFunction === "string" &&
|
||||||
|
overrideValueFunction.startsWith("RandomSmallString")
|
||||||
|
) {
|
||||||
|
newValueProp = RandomSmallString(overrideValueFunction.split(":")[1] || 3); //Default back to 3 words, otherwise use the string.
|
||||||
|
} else if (typeof overrideValueFunction === "string" && overrideValueFunction.startsWith("RandomDate")) {
|
||||||
|
newValueProp = RandomDate();
|
||||||
|
} else {
|
||||||
|
newValueProp = "This is some random text. Nothing interesting here.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return React.cloneElement(child, {
|
||||||
|
[valueProp]: newValueProp,
|
||||||
|
[styleProp]: { ...child.props[styleProp], ...blurringProps }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return child;
|
||||||
|
});
|
||||||
|
|
||||||
|
return childrenWithBlurProps;
|
||||||
|
}
|
||||||
|
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
export default connect(mapStateToProps, null)(BlurWrapper);
|
||||||
|
|
||||||
|
function RandomDinero() {
|
||||||
|
return Dinero({ amount: Math.round(Math.exp(Math.random() * 10, 2)) }).toFormat();
|
||||||
|
}
|
||||||
|
function RandomAmount() {
|
||||||
|
return Math.round(Math.exp(Math.random() * 10));
|
||||||
|
}
|
||||||
|
|
||||||
|
function RandomSmallString(maxWords = 3) {
|
||||||
|
const words = ["lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit"];
|
||||||
|
const wordCount = Math.floor(Math.random() * maxWords) + 1; // Random number between 1 and 3
|
||||||
|
let result = [];
|
||||||
|
for (let i = 0; i < wordCount; i++) {
|
||||||
|
const randomIndex = Math.floor(Math.random() * words.length);
|
||||||
|
result.push(words[randomIndex]);
|
||||||
|
}
|
||||||
|
return result.join(" ");
|
||||||
|
}
|
||||||
|
function RandomDate() {
|
||||||
|
return DateTimeFormatterFunction(new Date(Math.floor(Math.random() * 1000000000000)));
|
||||||
|
}
|
||||||
|
|
||||||
|
const featureNameList = [
|
||||||
|
"mobile",
|
||||||
|
"allAccess",
|
||||||
|
//"audit", //Removing 2024-12-13. Keeping as default feature.
|
||||||
|
"timetickets",
|
||||||
|
"payments",
|
||||||
|
"partsorders",
|
||||||
|
"bills",
|
||||||
|
"export",
|
||||||
|
"csi",
|
||||||
|
"courtesycars",
|
||||||
|
"media",
|
||||||
|
"visualboard",
|
||||||
|
"scoreboard",
|
||||||
|
"techconsole",
|
||||||
|
"checklist",
|
||||||
|
"smartscheduling",
|
||||||
|
"roguard",
|
||||||
|
"dashboard"
|
||||||
|
//"lifecycle" //Removing 2024-12-13. Keeping as default feature.
|
||||||
|
];
|
||||||
|
|
||||||
|
export function ValidateFeatureName(featureName) {
|
||||||
|
return featureNameList.includes(featureName);
|
||||||
|
}
|
||||||
@@ -1,48 +1,84 @@
|
|||||||
import dayjs from "../../utils/day";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import dayjs from "../../utils/day";
|
||||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
import { ValidateFeatureName } from "./blur-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
|
|
||||||
function FeatureWrapper({ bodyshop, featureName, noauth, children, ...restProps }) {
|
function FeatureWrapper({
|
||||||
|
bodyshop,
|
||||||
|
featureName,
|
||||||
|
noauth,
|
||||||
|
blurContent,
|
||||||
|
children,
|
||||||
|
upsellComponent,
|
||||||
|
bypass,
|
||||||
|
...restProps
|
||||||
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
if (bypass) {
|
||||||
|
if (import.meta.env.DEV) {
|
||||||
|
console.trace("*** Feature Wrapper BYPASS USED", featureName);
|
||||||
|
}
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (import.meta.env.DEV) {
|
||||||
|
if (!ValidateFeatureName(featureName)) console.trace("*** INVALID FEATURE NAME", featureName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (upsellComponent) {
|
||||||
|
console.error("*** Upsell component passed in. This is not yet implemented.");
|
||||||
|
}
|
||||||
|
|
||||||
if (HasFeatureAccess({ featureName, bodyshop })) return children;
|
if (HasFeatureAccess({ featureName, bodyshop })) return children;
|
||||||
|
|
||||||
return (
|
if (blurContent) {
|
||||||
noauth || (
|
const childrenWithBlurProps = React.Children.map(children, (child) => {
|
||||||
<AlertComponent
|
// Checking isValidElement is the safe way and avoids a
|
||||||
message={t("general.messages.nofeatureaccess", {
|
// typescript error too.
|
||||||
app: InstanceRenderManager({
|
if (React.isValidElement(child)) {
|
||||||
imex: "$t(titles.imexonline)",
|
return React.cloneElement(child, { blur: true });
|
||||||
rome: "$t(titles.romeonline)",
|
}
|
||||||
promanager: "$t(titles.promanager)"
|
return child;
|
||||||
})
|
});
|
||||||
})}
|
return childrenWithBlurProps;
|
||||||
type="warning"
|
} else {
|
||||||
/>
|
return (
|
||||||
)
|
noauth || (
|
||||||
);
|
<AlertComponent
|
||||||
|
message={t("general.messages.nofeatureaccess", {
|
||||||
|
app: InstanceRenderManager({
|
||||||
|
imex: "$t(titles.imexonline)",
|
||||||
|
rome: "$t(titles.romeonline)"
|
||||||
|
})
|
||||||
|
})}
|
||||||
|
type="warning"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function HasFeatureAccess({ featureName, bodyshop }) {
|
export function HasFeatureAccess({ featureName, bodyshop, bypass, debug = false }) {
|
||||||
|
if (debug) {
|
||||||
|
console.trace(`*** HasFeatureAccessFunction called with feature << ${featureName} >>`);
|
||||||
|
}
|
||||||
|
if (bypass) {
|
||||||
|
if (import.meta.env.DEV) {
|
||||||
|
console.trace("*** Feature Wrapper BYPASS USED", featureName);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return bodyshop?.features?.allAccess || dayjs(bodyshop?.features[featureName]).isAfter(dayjs());
|
return bodyshop?.features?.allAccess || dayjs(bodyshop?.features[featureName]).isAfter(dayjs());
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(mapStateToProps, null)(FeatureWrapper);
|
export default connect(mapStateToProps, null)(FeatureWrapper);
|
||||||
|
|
||||||
/*
|
|
||||||
dashboard
|
|
||||||
production-board
|
|
||||||
scoreboard
|
|
||||||
csi
|
|
||||||
tech-console
|
|
||||||
mobile-imaging
|
|
||||||
*/
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@ import Icon, {
|
|||||||
UserOutlined
|
UserOutlined
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Layout, Menu } from "antd";
|
import { Layout, Menu, Space } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { BsKanban } from "react-icons/bs";
|
import { BsKanban } from "react-icons/bs";
|
||||||
import { FaCalendarAlt, FaCarCrash, FaCreditCard, FaFileInvoiceDollar, FaTasks } from "react-icons/fa";
|
import { FaCalendarAlt, FaCarCrash, FaCreditCard, FaFileInvoiceDollar, FaTasks } from "react-icons/fa";
|
||||||
@@ -44,6 +43,7 @@ import { signOutStart } from "../../redux/user/user.actions";
|
|||||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
|
import LockWrapper from "../lock-wrapper/lock-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
@@ -128,34 +128,39 @@ function Header({
|
|||||||
|
|
||||||
const accountingChildren = [];
|
const accountingChildren = [];
|
||||||
|
|
||||||
if (
|
accountingChildren.push(
|
||||||
InstanceRenderManager({
|
{
|
||||||
imex: true,
|
key: "bills",
|
||||||
rome: true,
|
id: "header-accounting-bills",
|
||||||
promanager: HasFeatureAccess({ featureName: "bills", bodyshop })
|
icon: <Icon component={FaFileInvoiceDollar} />,
|
||||||
})
|
label: (
|
||||||
) {
|
<Link to="/manage/bills">
|
||||||
accountingChildren.push(
|
<LockWrapper featureName="bills" bodyshop={bodyshop}>
|
||||||
{
|
{t("menus.header.bills")}
|
||||||
key: "bills",
|
</LockWrapper>
|
||||||
id: "header-accounting-bills",
|
</Link>
|
||||||
icon: <Icon component={FaFileInvoiceDollar} />,
|
)
|
||||||
label: <Link to="/manage/bills">{t("menus.header.bills")}</Link>
|
},
|
||||||
},
|
{
|
||||||
{
|
key: "enterbills",
|
||||||
key: "enterbills",
|
id: "header-accounting-enterbills",
|
||||||
id: "header-accounting-enterbills",
|
icon: <Icon component={GiPayMoney} />,
|
||||||
icon: <Icon component={GiPayMoney} />,
|
label: (
|
||||||
label: t("menus.header.enterbills"),
|
<Space>
|
||||||
onClick: () => {
|
<LockWrapper featureName="bills" bodyshop={bodyshop}>
|
||||||
|
{t("menus.header.enterbills")}
|
||||||
|
</LockWrapper>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
onClick: () => {
|
||||||
|
HasFeatureAccess({ featureName: "bills", bodyshop }) &&
|
||||||
setBillEnterContext({
|
setBillEnterContext({
|
||||||
actions: {},
|
actions: {},
|
||||||
context: {}
|
context: {}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
}
|
||||||
}
|
);
|
||||||
|
|
||||||
if (Simple_Inventory.treatment === "on") {
|
if (Simple_Inventory.treatment === "on") {
|
||||||
accountingChildren.push(
|
accountingChildren.push(
|
||||||
@@ -170,37 +175,41 @@ function Header({
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (
|
|
||||||
InstanceRenderManager({
|
accountingChildren.push(
|
||||||
imex: true,
|
{
|
||||||
rome: true,
|
type: "divider"
|
||||||
promanager: HasFeatureAccess({ featureName: "payments", bodyshop })
|
},
|
||||||
})
|
{
|
||||||
) {
|
key: "allpayments",
|
||||||
accountingChildren.push(
|
id: "header-accounting-allpayments",
|
||||||
{
|
icon: <BankFilled />,
|
||||||
type: "divider"
|
label: (
|
||||||
},
|
<Link to="/manage/payments">
|
||||||
{
|
<LockWrapper featureName="payments" bodyshop={bodyshop}>
|
||||||
key: "allpayments",
|
{t("menus.header.allpayments")}
|
||||||
id: "header-accounting-allpayments",
|
</LockWrapper>
|
||||||
icon: <BankFilled />,
|
</Link>
|
||||||
label: <Link to="/manage/payments">{t("menus.header.allpayments")}</Link>
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "enterpayments",
|
key: "enterpayments",
|
||||||
id: "header-accounting-enterpayments",
|
id: "header-accounting-enterpayments",
|
||||||
icon: <Icon component={FaCreditCard} />,
|
icon: <Icon component={FaCreditCard} />,
|
||||||
label: t("menus.header.enterpayment"),
|
label: (
|
||||||
onClick: () => {
|
<LockWrapper featureName="payments" bodyshop={bodyshop}>
|
||||||
|
{t("menus.header.enterpayment")}
|
||||||
|
</LockWrapper>
|
||||||
|
),
|
||||||
|
onClick: () => {
|
||||||
|
HasFeatureAccess({ featureName: "payments", bodyshop }) &&
|
||||||
setPaymentContext({
|
setPaymentContext({
|
||||||
actions: {},
|
actions: {},
|
||||||
context: null
|
context: null
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
}
|
||||||
}
|
);
|
||||||
|
|
||||||
if (ImEXPay.treatment === "on") {
|
if (ImEXPay.treatment === "on") {
|
||||||
accountingChildren.push({
|
accountingChildren.push({
|
||||||
@@ -217,40 +226,44 @@ function Header({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
accountingChildren.push(
|
||||||
InstanceRenderManager({
|
{
|
||||||
imex: true,
|
type: "divider"
|
||||||
rome: true,
|
},
|
||||||
promanager: HasFeatureAccess({ featureName: "timetickets", bodyshop })
|
{
|
||||||
})
|
key: "timetickets",
|
||||||
) {
|
id: "header-accounting-timetickets",
|
||||||
accountingChildren.push(
|
icon: <FieldTimeOutlined />,
|
||||||
{
|
label: (
|
||||||
type: "divider"
|
<Link to="/manage/timetickets">
|
||||||
},
|
<LockWrapper featureName="timetickets" bodyshop={bodyshop}>
|
||||||
{
|
{t("menus.header.timetickets")}
|
||||||
key: "timetickets",
|
</LockWrapper>
|
||||||
id: "header-accounting-timetickets",
|
</Link>
|
||||||
icon: <FieldTimeOutlined />,
|
)
|
||||||
label: <Link to="/manage/timetickets">{t("menus.header.timetickets")}</Link>
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (bodyshop?.md_tasks_presets?.use_approvals) {
|
|
||||||
accountingChildren.push({
|
|
||||||
key: "ttapprovals",
|
|
||||||
id: "header-accounting-ttapprovals",
|
|
||||||
icon: <FieldTimeOutlined />,
|
|
||||||
label: <Link to="/manage/ttapprovals">{t("menus.header.ttapprovals")}</Link>
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
accountingChildren.push(
|
);
|
||||||
{
|
|
||||||
key: "entertimetickets",
|
if (bodyshop?.md_tasks_presets?.use_approvals) {
|
||||||
icon: <Icon component={GiPlayerTime} />,
|
accountingChildren.push({
|
||||||
label: t("menus.header.entertimeticket"),
|
key: "ttapprovals",
|
||||||
id: "header-accounting-entertimetickets",
|
id: "header-accounting-ttapprovals",
|
||||||
onClick: () => {
|
icon: <FieldTimeOutlined />,
|
||||||
|
label: <Link to="/manage/ttapprovals">{t("menus.header.ttapprovals")}</Link>
|
||||||
|
});
|
||||||
|
}
|
||||||
|
accountingChildren.push(
|
||||||
|
{
|
||||||
|
key: "entertimetickets",
|
||||||
|
icon: <Icon component={GiPlayerTime} />,
|
||||||
|
label: (
|
||||||
|
<LockWrapper featureName="timetickets" bodyshop={bodyshop}>
|
||||||
|
{t("menus.header.entertimeticket")}
|
||||||
|
</LockWrapper>
|
||||||
|
),
|
||||||
|
id: "header-accounting-entertimetickets",
|
||||||
|
onClick: () => {
|
||||||
|
HasFeatureAccess({ featureName: "timetickets", bodyshop }) &&
|
||||||
setTimeTicketContext({
|
setTimeTicketContext({
|
||||||
actions: {},
|
actions: {},
|
||||||
context: {
|
context: {
|
||||||
@@ -259,19 +272,24 @@ function Header({
|
|||||||
: currentUser.email
|
: currentUser.email
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "divider"
|
|
||||||
}
|
}
|
||||||
);
|
},
|
||||||
}
|
{
|
||||||
|
type: "divider"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const accountingExportChildren = [
|
const accountingExportChildren = [
|
||||||
{
|
{
|
||||||
key: "receivables",
|
key: "receivables",
|
||||||
id: "header-accounting-receivables",
|
id: "header-accounting-receivables",
|
||||||
label: <Link to="/manage/accounting/receivables">{t("menus.header.accounting-receivables")}</Link>
|
label: (
|
||||||
|
<Link to="/manage/accounting/receivables">
|
||||||
|
<LockWrapper featureName="export" bodyshop={bodyshop}>
|
||||||
|
{t("menus.header.accounting-receivables")}
|
||||||
|
</LockWrapper>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -279,7 +297,13 @@ function Header({
|
|||||||
accountingExportChildren.push({
|
accountingExportChildren.push({
|
||||||
key: "payables",
|
key: "payables",
|
||||||
id: "header-accounting-payables",
|
id: "header-accounting-payables",
|
||||||
label: <Link to="/manage/accounting/payables">{t("menus.header.accounting-payables")}</Link>
|
label: (
|
||||||
|
<Link to="/manage/accounting/payables">
|
||||||
|
<LockWrapper featureName="export" bodyshop={bodyshop}>
|
||||||
|
{t("menus.header.accounting-payables")}
|
||||||
|
</LockWrapper>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +311,13 @@ function Header({
|
|||||||
accountingExportChildren.push({
|
accountingExportChildren.push({
|
||||||
key: "payments",
|
key: "payments",
|
||||||
id: "header-accounting-payments",
|
id: "header-accounting-payments",
|
||||||
label: <Link to="/manage/accounting/payments">{t("menus.header.accounting-payments")}</Link>
|
label: (
|
||||||
|
<Link to="/manage/accounting/payments">
|
||||||
|
<LockWrapper featureName="export" bodyshop={bodyshop}>
|
||||||
|
{t("menus.header.accounting-payments")}
|
||||||
|
</LockWrapper>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,25 +328,27 @@ function Header({
|
|||||||
{
|
{
|
||||||
key: "exportlogs",
|
key: "exportlogs",
|
||||||
id: "header-accounting-exportlogs",
|
id: "header-accounting-exportlogs",
|
||||||
label: <Link to="/manage/accounting/exportlogs">{t("menus.header.export-logs")}</Link>
|
label: (
|
||||||
|
<Link to="/manage/accounting/exportlogs">
|
||||||
|
<LockWrapper featureName="export" bodyshop={bodyshop}>
|
||||||
|
{t("menus.header.export-logs")}
|
||||||
|
</LockWrapper>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
accountingChildren.push({
|
||||||
InstanceRenderManager({
|
key: "accountingexport",
|
||||||
imex: true,
|
id: "header-accounting-export",
|
||||||
rome: true,
|
icon: <ExportOutlined />,
|
||||||
promanager: HasFeatureAccess({ featureName: "export", bodyshop })
|
label: (
|
||||||
})
|
<LockWrapper featureName="export" bodyshop={bodyshop}>
|
||||||
) {
|
{t("menus.header.export")}
|
||||||
accountingChildren.push({
|
</LockWrapper>
|
||||||
key: "accountingexport",
|
),
|
||||||
id: "header-accounting-export",
|
children: accountingExportChildren
|
||||||
icon: <ExportOutlined />,
|
});
|
||||||
label: t("menus.header.export"),
|
|
||||||
children: accountingExportChildren
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const menuItems = [
|
const menuItems = [
|
||||||
{
|
{
|
||||||
@@ -368,7 +400,8 @@ function Header({
|
|||||||
label: <Link to="/manage/jobs/new">{t("menus.header.newjob")}</Link>
|
label: <Link to="/manage/jobs/new">{t("menus.header.newjob")}</Link>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "divider"
|
type: "divider",
|
||||||
|
id: "header-jobs-divider"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "alljobs",
|
key: "alljobs",
|
||||||
@@ -377,7 +410,8 @@ function Header({
|
|||||||
label: <Link to="/manage/jobs/all">{t("menus.header.alljobs")}</Link>
|
label: <Link to="/manage/jobs/all">{t("menus.header.alljobs")}</Link>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "divider"
|
type: "divider",
|
||||||
|
id: "header-jobs-divider2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "productionlist",
|
key: "productionlist",
|
||||||
@@ -385,38 +419,36 @@ function Header({
|
|||||||
icon: <ScheduleOutlined />,
|
icon: <ScheduleOutlined />,
|
||||||
label: <Link to="/manage/production/list">{t("menus.header.productionlist")}</Link>
|
label: <Link to="/manage/production/list">{t("menus.header.productionlist")}</Link>
|
||||||
},
|
},
|
||||||
...(InstanceRenderManager({
|
|
||||||
imex: true,
|
|
||||||
rome: true,
|
|
||||||
promanager: HasFeatureAccess({ featureName: "visualboard", bodyshop })
|
|
||||||
})
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
key: "productionboard",
|
|
||||||
id: "header-production-board",
|
|
||||||
icon: <Icon component={BsKanban} />,
|
|
||||||
label: <Link to="/manage/production/board">{t("menus.header.productionboard")}</Link>
|
|
||||||
}
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
|
|
||||||
...(InstanceRenderManager({
|
{
|
||||||
imex: true,
|
key: "productionboard",
|
||||||
rome: true,
|
id: "header-production-board",
|
||||||
promanager: HasFeatureAccess({ featureName: "scoreboard", bodyshop })
|
icon: <Icon component={BsKanban} />,
|
||||||
})
|
label: (
|
||||||
? [
|
<Link to="/manage/production/board">
|
||||||
{
|
<LockWrapper featureName="visualboard" bodyshop={bodyshop}>
|
||||||
type: "divider"
|
{t("menus.header.productionboard")}
|
||||||
},
|
</LockWrapper>
|
||||||
{
|
</Link>
|
||||||
key: "scoreboard",
|
)
|
||||||
id: "header-scoreboard",
|
},
|
||||||
icon: <LineChartOutlined />,
|
|
||||||
label: <Link to="/manage/scoreboard">{t("menus.header.scoreboard")}</Link>
|
{
|
||||||
}
|
type: "divider",
|
||||||
]
|
id: "header-jobs-divider3"
|
||||||
: [])
|
},
|
||||||
|
{
|
||||||
|
key: "scoreboard",
|
||||||
|
id: "header-scoreboard",
|
||||||
|
icon: <LineChartOutlined />,
|
||||||
|
label: (
|
||||||
|
<Link to="/manage/scoreboard">
|
||||||
|
<LockWrapper featureName="scoreboard" bodyshop={bodyshop}>
|
||||||
|
{t("menus.header.scoreboard")}
|
||||||
|
</LockWrapper>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -439,40 +471,54 @@ function Header({
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
...(InstanceRenderManager({
|
{
|
||||||
imex: true,
|
key: "ccs",
|
||||||
rome: true,
|
id: "header-css",
|
||||||
promanager: false // HasFeatureAccess({ featureName: 'courtesycars', bodyshop }),
|
icon: <CarFilled />,
|
||||||
})
|
label: (
|
||||||
? [
|
<LockWrapper featureName="courtesycars" bodyshop={bodyshop}>
|
||||||
{
|
{t("menus.header.courtesycars")}
|
||||||
key: "ccs",
|
</LockWrapper>
|
||||||
id: "header-css",
|
),
|
||||||
icon: <CarFilled />,
|
children: [
|
||||||
label: t("menus.header.courtesycars"),
|
{
|
||||||
children: [
|
key: "courtesycarsall",
|
||||||
{
|
id: "header-courtesycars-all",
|
||||||
key: "courtesycarsall",
|
icon: <CarFilled />,
|
||||||
id: "header-courtesycars-all",
|
label: (
|
||||||
icon: <CarFilled />,
|
<Link to="/manage/courtesycars">
|
||||||
label: <Link to="/manage/courtesycars">{t("menus.header.courtesycars-all")}</Link>
|
<LockWrapper featureName="courtesycars" bodyshop={bodyshop}>
|
||||||
},
|
{t("menus.header.courtesycars-all")}
|
||||||
{
|
</LockWrapper>
|
||||||
key: "contracts",
|
</Link>
|
||||||
id: "header-contracts",
|
)
|
||||||
icon: <FileFilled />,
|
},
|
||||||
label: <Link to="/manage/courtesycars/contracts">{t("menus.header.courtesycars-contracts")}</Link>
|
{
|
||||||
},
|
key: "contracts",
|
||||||
{
|
id: "header-contracts",
|
||||||
key: "newcontract",
|
icon: <FileFilled />,
|
||||||
id: "header-newcontract",
|
label: (
|
||||||
icon: <FileAddFilled />,
|
<Link to="/manage/courtesycars/contracts">
|
||||||
label: <Link to="/manage/courtesycars/contracts/new">{t("menus.header.courtesycars-newcontract")}</Link>
|
<LockWrapper featureName="courtesycars" bodyshop={bodyshop}>
|
||||||
}
|
{t("menus.header.courtesycars-contracts")}
|
||||||
]
|
</LockWrapper>
|
||||||
}
|
</Link>
|
||||||
]
|
)
|
||||||
: []),
|
},
|
||||||
|
{
|
||||||
|
key: "newcontract",
|
||||||
|
id: "header-newcontract",
|
||||||
|
icon: <FileAddFilled />,
|
||||||
|
label: (
|
||||||
|
<Link to="/manage/courtesycars/contracts/new">
|
||||||
|
<LockWrapper featureName="courtesycars" bodyshop={bodyshop}>
|
||||||
|
{t("menus.header.courtesycars-newcontract")}
|
||||||
|
</LockWrapper>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
...(accountingChildren.length > 0
|
...(accountingChildren.length > 0
|
||||||
? [
|
? [
|
||||||
@@ -491,20 +537,20 @@ function Header({
|
|||||||
icon: <PhoneOutlined />,
|
icon: <PhoneOutlined />,
|
||||||
label: <Link to="/manage/phonebook">{t("menus.header.phonebook")}</Link>
|
label: <Link to="/manage/phonebook">{t("menus.header.phonebook")}</Link>
|
||||||
},
|
},
|
||||||
...(InstanceRenderManager({
|
|
||||||
imex: true,
|
{
|
||||||
rome: true,
|
key: "temporarydocs",
|
||||||
promanager: HasFeatureAccess({ featureName: "media", bodyshop })
|
id: "header-temporarydocs",
|
||||||
})
|
icon: <PaperClipOutlined />,
|
||||||
? [
|
label: (
|
||||||
{
|
<Link to="/manage/temporarydocs">
|
||||||
key: "temporarydocs",
|
<LockWrapper featureName="media" bodyshop={bodyshop}>
|
||||||
id: "header-temporarydocs",
|
{t("menus.header.temporarydocs")}
|
||||||
icon: <PaperClipOutlined />,
|
</LockWrapper>
|
||||||
label: <Link to="/manage/temporarydocs">{t("menus.header.temporarydocs")}</Link>
|
</Link>
|
||||||
}
|
)
|
||||||
]
|
},
|
||||||
: []),
|
|
||||||
{
|
{
|
||||||
key: "tasks",
|
key: "tasks",
|
||||||
id: "tasks",
|
id: "tasks",
|
||||||
@@ -513,6 +559,7 @@ function Header({
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
key: "createTask",
|
key: "createTask",
|
||||||
|
id: "header-create-task",
|
||||||
icon: <PlusCircleOutlined />,
|
icon: <PlusCircleOutlined />,
|
||||||
label: t("menus.header.create_task"),
|
label: t("menus.header.create_task"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -524,11 +571,13 @@ function Header({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "mytasks",
|
key: "mytasks",
|
||||||
|
id: "header-my-tasks",
|
||||||
icon: <FaTasks />,
|
icon: <FaTasks />,
|
||||||
label: <Link to="/manage/tasks/mytasks">{t("menus.header.my_tasks")}</Link>
|
label: <Link to="/manage/tasks/mytasks">{t("menus.header.my_tasks")}</Link>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "all_tasks",
|
key: "all_tasks",
|
||||||
|
id: "header-all-tasks",
|
||||||
icon: <FaTasks />,
|
icon: <FaTasks />,
|
||||||
label: <Link to="/manage/tasks/alltasks">{t("menus.header.all_tasks")}</Link>
|
label: <Link to="/manage/tasks/alltasks">{t("menus.header.all_tasks")}</Link>
|
||||||
}
|
}
|
||||||
@@ -550,7 +599,11 @@ function Header({
|
|||||||
key: "dashboard",
|
key: "dashboard",
|
||||||
id: "header-dashboard",
|
id: "header-dashboard",
|
||||||
icon: <DashboardFilled />,
|
icon: <DashboardFilled />,
|
||||||
label: <Link to="/manage/dashboard">{t("menus.header.dashboard")}</Link>
|
label: (
|
||||||
|
<Link to="/manage/dashboard">
|
||||||
|
<LockWrapper featureName="bills">{t("menus.header.dashboard")}</LockWrapper>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "reportcenter",
|
key: "reportcenter",
|
||||||
@@ -570,20 +623,19 @@ function Header({
|
|||||||
icon: <Icon component={IoBusinessOutline} />,
|
icon: <Icon component={IoBusinessOutline} />,
|
||||||
label: <Link to="/manage/shop/vendors">{t("menus.header.shop_vendors")}</Link>
|
label: <Link to="/manage/shop/vendors">{t("menus.header.shop_vendors")}</Link>
|
||||||
},
|
},
|
||||||
...(InstanceRenderManager({
|
|
||||||
imex: true,
|
{
|
||||||
rome: true,
|
key: "shop-csi",
|
||||||
promanager: HasFeatureAccess({ featureName: "csi", bodyshop })
|
id: "header-shop-csi",
|
||||||
})
|
icon: <Icon component={RiSurveyLine} />,
|
||||||
? [
|
label: (
|
||||||
{
|
<Link to="/manage/shop/csi">
|
||||||
key: "shop-csi",
|
<LockWrapper featureName="export" bodyshop={bodyshop}>
|
||||||
id: "header-shop-csi",
|
{t("menus.header.shop_csi")}
|
||||||
icon: <Icon component={RiSurveyLine} />,
|
</LockWrapper>
|
||||||
label: <Link to="/manage/shop/csi">{t("menus.header.shop_csi")}</Link>
|
</Link>
|
||||||
}
|
)
|
||||||
]
|
}
|
||||||
: [])
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -604,25 +656,17 @@ function Header({
|
|||||||
icon: <Icon component={QuestionCircleFilled} />,
|
icon: <Icon component={QuestionCircleFilled} />,
|
||||||
label: t("menus.header.help"),
|
label: t("menus.header.help"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
window.open(
|
window.open("https://help.imex.online/", "_blank");
|
||||||
InstanceRenderManager({
|
|
||||||
imex: "https://help.imex.online/",
|
|
||||||
rome: "https://rometech.com//",
|
|
||||||
promanager: "https://web-est.com"
|
|
||||||
}),
|
|
||||||
|
|
||||||
"_blank"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
...(InstanceRenderManager({
|
...(InstanceRenderManager({
|
||||||
imex: true,
|
imex: true,
|
||||||
rome: false,
|
rome: false
|
||||||
promanager: false
|
|
||||||
})
|
})
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
key: "rescue",
|
key: "rescue",
|
||||||
|
id: "header-rescue",
|
||||||
icon: <Icon component={CarFilled} />,
|
icon: <Icon component={CarFilled} />,
|
||||||
label: t("menus.header.rescueme"),
|
label: t("menus.header.rescueme"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -632,20 +676,19 @@ function Header({
|
|||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
|
|
||||||
...(InstanceRenderManager({
|
{
|
||||||
imex: true,
|
key: "shiftclock",
|
||||||
rome: true,
|
id: "header-shiftclock",
|
||||||
promanager: HasFeatureAccess({ featureName: "timetickets", bodyshop })
|
icon: <Icon component={GiPlayerTime} />,
|
||||||
})
|
label: (
|
||||||
? [
|
<Link to="/manage/shiftclock">
|
||||||
{
|
<LockWrapper featureName="export" bodyshop={bodyshop}>
|
||||||
key: "shiftclock",
|
{t("menus.header.shiftclock")}
|
||||||
id: "header-shiftclock",
|
</LockWrapper>
|
||||||
icon: <Icon component={GiPlayerTime} />,
|
</Link>
|
||||||
label: <Link to="/manage/shiftclock">{t("menus.header.shiftclock")}</Link>
|
)
|
||||||
}
|
},
|
||||||
]
|
|
||||||
: []),
|
|
||||||
{
|
{
|
||||||
key: "profile",
|
key: "profile",
|
||||||
id: "header-profile",
|
id: "header-profile",
|
||||||
@@ -687,6 +730,7 @@ function Header({
|
|||||||
id: "header-recent",
|
id: "header-recent",
|
||||||
children: recentItems.map((i, idx) => ({
|
children: recentItems.map((i, idx) => ({
|
||||||
key: idx,
|
key: idx,
|
||||||
|
id: `header-recent-${idx}`,
|
||||||
label: <Link to={i.url}>{i.label}</Link>
|
label: <Link to={i.url}>{i.label}</Link>
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
import { DeleteFilled } from "@ant-design/icons";
|
import { DeleteFilled } from "@ant-design/icons";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, notification, Popconfirm } from "antd";
|
import { Button, Popconfirm } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { DELETE_INVENTORY_LINE } from "../../graphql/inventory.queries";
|
import { DELETE_INVENTORY_LINE } from "../../graphql/inventory.queries";
|
||||||
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function InventoryLineDelete({ inventoryline, disabled, refetch }) {
|
export default function InventoryLineDelete({ inventoryline, disabled, refetch }) {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [deleteInventoryLine] = useMutation(DELETE_INVENTORY_LINE);
|
const [deleteInventoryLine] = useMutation(DELETE_INVENTORY_LINE);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleDelete = async () => {
|
const handleDelete = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Form, Modal, notification } from "antd";
|
import { Form, Modal } from "antd";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -10,6 +10,7 @@ import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
|||||||
import { selectInventoryUpsert } from "../../redux/modals/modals.selectors";
|
import { selectInventoryUpsert } from "../../redux/modals/modals.selectors";
|
||||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import InventoryUpsertModal from "./inventory-upsert-modal.component";
|
import InventoryUpsertModal from "./inventory-upsert-modal.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -24,6 +25,7 @@ export function InventoryUpsertModalContainer({ currentUser, bodyshop, inventory
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [insertInventory] = useMutation(INSERT_INVENTORY_LINE);
|
const [insertInventory] = useMutation(INSERT_INVENTORY_LINE);
|
||||||
const [updateInventoryLine] = useMutation(UPDATE_INVENTORY_LINE);
|
const [updateInventoryLine] = useMutation(UPDATE_INVENTORY_LINE);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const { open, context, actions } = inventoryUpsertModal;
|
const { open, context, actions } = inventoryUpsertModal;
|
||||||
const { existingInventory } = context;
|
const { existingInventory } = context;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { GenerateDocument } from "../../utils/RenderTemplate";
|
|||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import VendorSearchSelect from "../vendor-search-select/vendor-search-select.component";
|
import VendorSearchSelect from "../vendor-search-select/vendor-search-select.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -30,6 +31,7 @@ export function Jobd3RdPartyModal({ bodyshop, jobId, job, technician }) {
|
|||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only"
|
nextFetchPolicy: "network-only"
|
||||||
});
|
});
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const showModal = () => {
|
const showModal = () => {
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
@@ -59,7 +61,9 @@ export function Jobd3RdPartyModal({ bodyshop, jobId, job, technician }) {
|
|||||||
context: restVals
|
context: restVals
|
||||||
},
|
},
|
||||||
{ subject: TemplateList("job_special").special_thirdpartypayer.subject },
|
{ subject: TemplateList("job_special").special_thirdpartypayer.subject },
|
||||||
sendtype
|
sendtype,
|
||||||
|
null,
|
||||||
|
notification
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { Dropdown, notification } from "antd";
|
import { Dropdown } from "antd";
|
||||||
import { DownOutlined } from "@ant-design/icons";
|
import { DownOutlined } from "@ant-design/icons";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
@@ -18,6 +19,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
export function JobAltTransportChange({ bodyshop, job }) {
|
export function JobAltTransportChange({ bodyshop, job }) {
|
||||||
const [updateJob] = useMutation(UPDATE_JOB);
|
const [updateJob] = useMutation(UPDATE_JOB);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const onClick = async ({ key }) => {
|
const onClick = async ({ key }) => {
|
||||||
const result = await updateJob({
|
const result = await updateJob({
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { Dropdown, notification } from "antd";
|
import { Dropdown } from "antd";
|
||||||
import { DownOutlined } from "@ant-design/icons";
|
import { DownOutlined } from "@ant-design/icons";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
@@ -18,6 +19,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
export function ScheduleEventColor({ bodyshop, event }) {
|
export function ScheduleEventColor({ bodyshop, event }) {
|
||||||
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const onClick = async ({ key }) => {
|
const onClick = async ({ key }) => {
|
||||||
const result = await updateAppointment({
|
const result = await updateAppointment({
|
||||||
|
|||||||
@@ -1,30 +1,31 @@
|
|||||||
import { AlertFilled } from "@ant-design/icons";
|
import { AlertFilled } from "@ant-design/icons";
|
||||||
import { Button, Divider, Dropdown, Form, Input, notification, Popover, Select, Space } from "antd";
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Button, Divider, Dropdown, Form, Input, Popover, Select, Space } from "antd";
|
||||||
import parsePhoneNumber from "libphonenumber-js";
|
import parsePhoneNumber from "libphonenumber-js";
|
||||||
import dayjs from "../../utils/day";
|
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useContext, useState } from "react";
|
import React, { useContext, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import SocketContext from "../../contexts/SocketIO/socketContext.jsx";
|
||||||
|
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
|
||||||
import { openChatByPhone, setMessage } from "../../redux/messaging/messaging.actions";
|
import { openChatByPhone, setMessage } from "../../redux/messaging/messaging.actions";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
|
import dayjs from "../../utils/day";
|
||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
|
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
|
||||||
import DataLabel from "../data-label/data-label.component";
|
import DataLabel from "../data-label/data-label.component";
|
||||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
import ProductionListColumnComment from "../production-list-columns/production-list-columns.comment.component";
|
||||||
import ScheduleManualEvent from "../schedule-manual-event/schedule-manual-event.component";
|
import ScheduleManualEvent from "../schedule-manual-event/schedule-manual-event.component";
|
||||||
import ScheduleAtChange from "./job-at-change.component";
|
import ScheduleAtChange from "./job-at-change.component";
|
||||||
import ScheduleEventColor from "./schedule-event.color.component";
|
import ScheduleEventColor from "./schedule-event.color.component";
|
||||||
import ScheduleEventNote from "./schedule-event.note.component";
|
import ScheduleEventNote from "./schedule-event.note.component";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
|
|
||||||
import ProductionListColumnComment from "../production-list-columns/production-list-columns.comment.component";
|
|
||||||
import SocketContext from "../../contexts/SocketIO/socketContext.jsx";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
@@ -51,6 +52,7 @@ export function ScheduleEventComponent({
|
|||||||
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
||||||
const [title, setTitle] = useState(event.title);
|
const [title, setTitle] = useState(event.title);
|
||||||
const { socket } = useContext(SocketContext);
|
const { socket } = useContext(SocketContext);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const blockContent = (
|
const blockContent = (
|
||||||
<Space direction="vertical" wrap>
|
<Space direction="vertical" wrap>
|
||||||
@@ -127,6 +129,9 @@ export function ScheduleEventComponent({
|
|||||||
<DataLabel label={t("jobs.fields.ownr_ph2")}>
|
<DataLabel label={t("jobs.fields.ownr_ph2")}>
|
||||||
<ChatOpenButton phone={event.job && event.job.ownr_ph2} jobid={event.job.id} />
|
<ChatOpenButton phone={event.job && event.job.ownr_ph2} jobid={event.job.id} />
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
|
<DataLabel hideIfNull label={t("jobs.fields.loss_of_use")}>
|
||||||
|
{(event.job && event.job.loss_of_use) || ""}
|
||||||
|
</DataLabel>
|
||||||
<DataLabel label={t("jobs.fields.alt_transport")}>
|
<DataLabel label={t("jobs.fields.alt_transport")}>
|
||||||
{(event.job && event.job.alt_transport) || ""}
|
{(event.job && event.job.alt_transport) || ""}
|
||||||
<ScheduleAtChange job={event && event.job} />
|
<ScheduleAtChange job={event && event.job} />
|
||||||
@@ -180,7 +185,8 @@ export function ScheduleEventComponent({
|
|||||||
subject: Template.subject
|
subject: Template.subject
|
||||||
},
|
},
|
||||||
"e",
|
"e",
|
||||||
event.job && event.job.id
|
event.job && event.job.id,
|
||||||
|
notification
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { notification } from "antd";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
@@ -9,12 +8,15 @@ import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
|||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import ScheduleEventComponent from "./schedule-event.component";
|
import ScheduleEventComponent from "./schedule-event.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function ScheduleEventContainer({ bodyshop, event, refetch }) {
|
export default function ScheduleEventContainer({ bodyshop, event, refetch }) {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [cancelAppointment] = useMutation(CANCEL_APPOINTMENT_BY_ID);
|
const [cancelAppointment] = useMutation(CANCEL_APPOINTMENT_BY_ID);
|
||||||
const [updateJob] = useMutation(UPDATE_JOB);
|
const [updateJob] = useMutation(UPDATE_JOB);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleCancel = async ({ id, lost_sale_reason }) => {
|
const handleCancel = async ({ id, lost_sale_reason }) => {
|
||||||
logImEXEvent("schedule_cancel_appt");
|
logImEXEvent("schedule_cancel_appt");
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { EditFilled, SaveFilled } from "@ant-design/icons";
|
import { EditFilled, SaveFilled } from "@ant-design/icons";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, Input, notification, Space } from "antd";
|
import { Button, Input, Space } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -8,6 +8,7 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
|
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import DataLabel from "../data-label/data-label.component";
|
import DataLabel from "../data-label/data-label.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
@@ -22,6 +23,7 @@ export function ScheduleEventNote({ event }) {
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const toggleEdit = async () => {
|
const toggleEdit = async () => {
|
||||||
if (editing) {
|
if (editing) {
|
||||||
|
|||||||
@@ -1,23 +1,27 @@
|
|||||||
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { Button, Card, Col, Row, Table, Tag } from "antd";
|
import { Button, Card, Col, Row, Table, Tag } from "antd";
|
||||||
import { SyncOutlined } from "@ant-design/icons";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { QUERY_AUDIT_TRAIL } from "../../graphql/audit_trail.queries";
|
|
||||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
import { QUERY_AUDIT_TRAIL } from "../../graphql/audit_trail.queries";
|
||||||
|
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
|
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
|
import BlurWrapperComponent from "../feature-wrapper/blur-wrapper.component";
|
||||||
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
|
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser
|
currentUser: selectCurrentUser,
|
||||||
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(JobAuditTrail);
|
export default connect(mapStateToProps, mapDispatchToProps)(JobAuditTrail);
|
||||||
|
|
||||||
export function JobAuditTrail({ currentUser, jobId }) {
|
export function JobAuditTrail({ bodyshop, currentUser, jobId }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { loading, data, refetch } = useQuery(QUERY_AUDIT_TRAIL, {
|
const { loading, data, refetch } = useQuery(QUERY_AUDIT_TRAIL, {
|
||||||
variables: { jobid: jobId },
|
variables: { jobid: jobId },
|
||||||
@@ -41,7 +45,12 @@ export function JobAuditTrail({ currentUser, jobId }) {
|
|||||||
{
|
{
|
||||||
title: t("audit.fields.operation"),
|
title: t("audit.fields.operation"),
|
||||||
dataIndex: "operation",
|
dataIndex: "operation",
|
||||||
key: "operation"
|
key: "operation",
|
||||||
|
render: (text, record) => (
|
||||||
|
<BlurWrapperComponent featureName="audit" bypass>
|
||||||
|
<div>{text}</div>
|
||||||
|
</BlurWrapperComponent>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
const emailColumns = [
|
const emailColumns = [
|
||||||
@@ -64,52 +73,84 @@ export function JobAuditTrail({ currentUser, jobId }) {
|
|||||||
dataIndex: "to",
|
dataIndex: "to",
|
||||||
key: "to",
|
key: "to",
|
||||||
|
|
||||||
render: (text, record) => record.to && record.to.map((email, idx) => <Tag key={idx}>{email}</Tag>)
|
render: (text, record) =>
|
||||||
|
record.to &&
|
||||||
|
record.to.map((email, idx) => (
|
||||||
|
<Tag key={idx}>
|
||||||
|
<BlurWrapperComponent featureName="audit" bypass>
|
||||||
|
<div>{email}</div>
|
||||||
|
</BlurWrapperComponent>
|
||||||
|
</Tag>
|
||||||
|
))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("audit.fields.cc"),
|
title: t("audit.fields.cc"),
|
||||||
dataIndex: "cc",
|
dataIndex: "cc",
|
||||||
key: "cc",
|
key: "cc",
|
||||||
|
|
||||||
render: (text, record) => record.cc && record.cc.map((email, idx) => <Tag key={idx}>{email}</Tag>)
|
render: (text, record) =>
|
||||||
|
record.cc &&
|
||||||
|
record.cc.map((email, idx) => (
|
||||||
|
<Tag key={idx}>
|
||||||
|
<BlurWrapperComponent featureName="audit" bypass>
|
||||||
|
<div>{email}</div>
|
||||||
|
</BlurWrapperComponent>
|
||||||
|
</Tag>
|
||||||
|
))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("audit.fields.subject"),
|
title: t("audit.fields.subject"),
|
||||||
dataIndex: "subject",
|
dataIndex: "subject",
|
||||||
key: "subject"
|
key: "subject",
|
||||||
|
render: (text, record) => (
|
||||||
|
<BlurWrapperComponent featureName="audit" bypass>
|
||||||
|
<div>{text}</div>
|
||||||
|
</BlurWrapperComponent>
|
||||||
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("audit.fields.status"),
|
title: t("audit.fields.status"),
|
||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
key: "status"
|
key: "status",
|
||||||
|
render: (text, record) => (
|
||||||
|
<BlurWrapperComponent featureName="audit" bypass>
|
||||||
|
<div>{text}</div>
|
||||||
|
</BlurWrapperComponent>
|
||||||
|
)
|
||||||
},
|
},
|
||||||
...(currentUser?.email.includes("@imex.")
|
|
||||||
? [
|
{
|
||||||
{
|
title: t("audit.fields.contents"),
|
||||||
title: t("audit.fields.contents"),
|
dataIndex: "contents",
|
||||||
dataIndex: "contents",
|
key: "contents",
|
||||||
key: "contents",
|
width: "10%",
|
||||||
width: "10%",
|
render: (text, record) => (
|
||||||
render: (text, record) => (
|
<Button
|
||||||
<Button
|
onClick={() => {
|
||||||
onClick={() => {
|
var win = window.open(
|
||||||
var win = window.open(
|
"",
|
||||||
"",
|
"Title",
|
||||||
"Title",
|
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=400,"
|
||||||
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=400,"
|
);
|
||||||
);
|
win.document.body.innerHTML = record.contents;
|
||||||
win.document.body.innerHTML = record.contents;
|
}}
|
||||||
}}
|
>
|
||||||
>
|
Preview
|
||||||
Preview
|
</Button>
|
||||||
</Button>
|
)
|
||||||
)
|
}
|
||||||
}
|
|
||||||
]
|
|
||||||
: [])
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const hasAuditAccess = HasFeatureAccess({ bodyshop, featureName: "audit" });
|
||||||
return (
|
return (
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
|
{!hasAuditAccess && (
|
||||||
|
<Col span={24}>
|
||||||
|
<Card>
|
||||||
|
<UpsellComponent upsell={upsellEnum().audit.general} disableMask />
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
)}
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Card
|
<Card
|
||||||
title={t("jobs.labels.audit")}
|
title={t("jobs.labels.audit")}
|
||||||
|
|||||||
@@ -6,8 +6,22 @@ import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
|||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||||
import "./job-bills-total.styles.scss";
|
import "./job-bills-total.styles.scss";
|
||||||
|
import BlurWrapperComponent from "../feature-wrapper/blur-wrapper.component";
|
||||||
|
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||||
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
|
||||||
export default function JobBillsTotalComponent({
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
|
||||||
|
export function JobBillsTotalComponent({
|
||||||
|
bodyshop,
|
||||||
loading,
|
loading,
|
||||||
bills,
|
bills,
|
||||||
partsOrders,
|
partsOrders,
|
||||||
@@ -18,7 +32,7 @@ export default function JobBillsTotalComponent({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
if (loading) return <LoadingSkeleton />;
|
if (loading) return <LoadingSkeleton />;
|
||||||
if (!!!jobTotals) {
|
if (!jobTotals) {
|
||||||
if (showWarning && warningCallback && typeof warningCallback === "function") {
|
if (showWarning && warningCallback && typeof warningCallback === "function") {
|
||||||
warningCallback({ key: "bills", warning: t("jobs.errors.nofinancial") });
|
warningCallback({ key: "bills", warning: t("jobs.errors.nofinancial") });
|
||||||
}
|
}
|
||||||
@@ -97,8 +111,7 @@ export default function JobBillsTotalComponent({
|
|||||||
.add(
|
.add(
|
||||||
InstanceRenderManager({
|
InstanceRenderManager({
|
||||||
imex: Dinero(),
|
imex: Dinero(),
|
||||||
rome: Dinero(totals.additional.additionalCosts),
|
rome: Dinero(totals.additional.additionalCosts)
|
||||||
promanager: "USE_ROME"
|
|
||||||
})
|
})
|
||||||
); // Additional costs were captured for Rome, but not imex.
|
); // Additional costs were captured for Rome, but not imex.
|
||||||
|
|
||||||
@@ -120,10 +133,10 @@ export default function JobBillsTotalComponent({
|
|||||||
warningCallback({ key: "cm", warning: t("jobs.labels.outstanding_credit_memos") });
|
warningCallback({ key: "cm", warning: t("jobs.labels.outstanding_credit_memos") });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const hasBillsAccess = HasFeatureAccess({ bodyshop, featureName: "bills" });
|
||||||
return (
|
return (
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col md={24} lg={18}>
|
<Col {...(hasBillsAccess ? { md: 24, lg: 18 } : { span: 12 })}>
|
||||||
<Card title={t("jobs.labels.jobtotals")} style={{ height: "100%" }}>
|
<Card title={t("jobs.labels.jobtotals")} style={{ height: "100%" }}>
|
||||||
<Space wrap size="large">
|
<Space wrap size="large">
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -147,7 +160,9 @@ export default function JobBillsTotalComponent({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Statistic title={t("bills.labels.retailtotal")} value={billTotals.toFormat()} />
|
<BlurWrapperComponent featureName="bills" overrideValueFunction="RandomDinero">
|
||||||
|
<Statistic title={t("bills.labels.retailtotal")} value={billTotals.toFormat()} />
|
||||||
|
</BlurWrapperComponent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Typography.Title>=</Typography.Title>
|
<Typography.Title>=</Typography.Title>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -159,13 +174,15 @@ export default function JobBillsTotalComponent({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Statistic
|
<BlurWrapperComponent featureName="bills" overrideValueFunction="RandomDinero">
|
||||||
title={t("bills.labels.discrepancy")}
|
<Statistic
|
||||||
valueStyle={{
|
title={t("bills.labels.discrepancy")}
|
||||||
color: discrepancy.getAmount() === 0 ? "green" : "red"
|
valueStyle={{
|
||||||
}}
|
color: discrepancy.getAmount() === 0 ? "green" : "red"
|
||||||
value={discrepancy.toFormat()}
|
}}
|
||||||
/>
|
value={discrepancy.toFormat()}
|
||||||
|
/>
|
||||||
|
</BlurWrapperComponent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Typography.Title>+</Typography.Title>
|
<Typography.Title>+</Typography.Title>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -177,7 +194,9 @@ export default function JobBillsTotalComponent({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Statistic title={t("bills.labels.dedfromlbr")} value={lbrAdjustments.toFormat()} />
|
<BlurWrapperComponent featureName="bills" overrideValueFunction="RandomDinero">
|
||||||
|
<Statistic title={t("bills.labels.dedfromlbr")} value={lbrAdjustments.toFormat()} />
|
||||||
|
</BlurWrapperComponent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Typography.Title>=</Typography.Title>
|
<Typography.Title>=</Typography.Title>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -189,13 +208,15 @@ export default function JobBillsTotalComponent({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Statistic
|
<BlurWrapperComponent featureName="bills" overrideValueFunction="RandomDinero">
|
||||||
title={t("bills.labels.discrepancy")}
|
<Statistic
|
||||||
valueStyle={{
|
title={t("bills.labels.discrepancy")}
|
||||||
color: discrepWithLbrAdj.getAmount() === 0 ? "green" : "red"
|
valueStyle={{
|
||||||
}}
|
color: discrepWithLbrAdj.getAmount() === 0 ? "green" : "red"
|
||||||
value={discrepWithLbrAdj.toFormat()}
|
}}
|
||||||
/>
|
value={discrepWithLbrAdj.toFormat()}
|
||||||
|
/>
|
||||||
|
</BlurWrapperComponent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Typography.Title>+</Typography.Title>
|
<Typography.Title>+</Typography.Title>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -207,7 +228,9 @@ export default function JobBillsTotalComponent({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Statistic title={t("bills.labels.totalreturns")} value={totalReturns.toFormat()} />
|
<BlurWrapperComponent featureName="bills" overrideValueFunction="RandomDinero">
|
||||||
|
<Statistic title={t("bills.labels.totalreturns")} value={totalReturns.toFormat()} />
|
||||||
|
</BlurWrapperComponent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Typography.Title>=</Typography.Title>
|
<Typography.Title>=</Typography.Title>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -219,16 +242,17 @@ export default function JobBillsTotalComponent({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Statistic
|
<BlurWrapperComponent featureName="bills" overrideValueFunction="RandomDinero">
|
||||||
title={t("bills.labels.discrepancy")}
|
<Statistic
|
||||||
valueStyle={{
|
title={t("bills.labels.discrepancy")}
|
||||||
color: discrepWithCms.getAmount() === 0 ? "green" : "red"
|
valueStyle={{
|
||||||
}}
|
color: discrepWithCms.getAmount() === 0 ? "green" : "red"
|
||||||
value={discrepWithCms.toFormat()}
|
}}
|
||||||
/>
|
value={discrepWithCms.toFormat()}
|
||||||
|
/>
|
||||||
|
</BlurWrapperComponent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Space>
|
</Space>
|
||||||
|
|
||||||
{showWarning &&
|
{showWarning &&
|
||||||
(discrepWithCms.getAmount() !== 0 ||
|
(discrepWithCms.getAmount() !== 0 ||
|
||||||
discrepWithLbrAdj.getAmount() !== 0 ||
|
discrepWithLbrAdj.getAmount() !== 0 ||
|
||||||
@@ -253,7 +277,9 @@ export default function JobBillsTotalComponent({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Statistic title={t("bills.labels.totalreturns")} value={totalReturns.toFormat()} />
|
<BlurWrapperComponent featureName="bills" overrideValueFunction="RandomDinero">
|
||||||
|
<Statistic title={t("bills.labels.totalreturns")} value={totalReturns.toFormat()} />
|
||||||
|
</BlurWrapperComponent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
title={
|
title={
|
||||||
@@ -264,17 +290,19 @@ export default function JobBillsTotalComponent({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Statistic
|
<BlurWrapperComponent featureName="bills" overrideValueFunction="RandomDinero">
|
||||||
title={t("bills.labels.calculatedcreditsnotreceived")}
|
<Statistic
|
||||||
valueStyle={{
|
title={t("bills.labels.calculatedcreditsnotreceived")}
|
||||||
color: calculatedCreditsNotReceived.getAmount() <= 0 ? "green" : "red"
|
valueStyle={{
|
||||||
}}
|
color: calculatedCreditsNotReceived.getAmount() <= 0 ? "green" : "red"
|
||||||
value={
|
}}
|
||||||
calculatedCreditsNotReceived.getAmount() >= 0
|
value={
|
||||||
? calculatedCreditsNotReceived.toFormat()
|
calculatedCreditsNotReceived.getAmount() >= 0
|
||||||
: Dinero().toFormat()
|
? calculatedCreditsNotReceived.toFormat()
|
||||||
}
|
: Dinero().toFormat()
|
||||||
/>
|
}
|
||||||
|
/>
|
||||||
|
</BlurWrapperComponent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
title={
|
title={
|
||||||
@@ -285,17 +313,19 @@ export default function JobBillsTotalComponent({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Statistic
|
<BlurWrapperComponent featureName="bills" overrideValueFunction="RandomDinero">
|
||||||
title={t("bills.labels.creditsnotreceived")}
|
<Statistic
|
||||||
valueStyle={{
|
title={t("bills.labels.creditsnotreceived")}
|
||||||
color: totalReturnsMarkedNotReceived.getAmount() <= 0 ? "green" : "red"
|
valueStyle={{
|
||||||
}}
|
color: totalReturnsMarkedNotReceived.getAmount() <= 0 ? "green" : "red"
|
||||||
value={
|
}}
|
||||||
totalReturnsMarkedNotReceived.getAmount() >= 0
|
value={
|
||||||
? totalReturnsMarkedNotReceived.toFormat()
|
totalReturnsMarkedNotReceived.getAmount() >= 0
|
||||||
: Dinero().toFormat()
|
? totalReturnsMarkedNotReceived.toFormat()
|
||||||
}
|
: Dinero().toFormat()
|
||||||
/>
|
}
|
||||||
|
/>
|
||||||
|
</BlurWrapperComponent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Space>
|
</Space>
|
||||||
{showWarning && calculatedCreditsNotReceived.getAmount() > 0 && (
|
{showWarning && calculatedCreditsNotReceived.getAmount() > 0 && (
|
||||||
@@ -303,6 +333,15 @@ export default function JobBillsTotalComponent({
|
|||||||
)}
|
)}
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
|
{!hasBillsAccess && (
|
||||||
|
<Col span={6}>
|
||||||
|
<Card style={{ height: "100%" }}>
|
||||||
|
<UpsellComponent upsell={upsellEnum().bills.autoreconcile} disableMask />
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(JobBillsTotalComponent);
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import { Button, notification } from "antd";
|
import { Button } from "antd";
|
||||||
import Axios from "axios";
|
import Axios from "axios";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function JobCalculateTotals({ job, disabled, refetch }) {
|
export default function JobCalculateTotals({ job, disabled, refetch }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleCalculate = async () => {
|
const handleCalculate = async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, Card, Form, Input, notification, Switch } from "antd";
|
import { Button, Card, Form, Input, Switch } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -16,6 +16,7 @@ import AuditTrailMapping from "../../../../utils/AuditTrailMappings";
|
|||||||
import dayjs from "../../../../utils/day";
|
import dayjs from "../../../../utils/day";
|
||||||
import ConfigFormComponents from "../../../config-form-components/config-form-components.component";
|
import ConfigFormComponents from "../../../config-form-components/config-form-components.component";
|
||||||
import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component";
|
import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component";
|
||||||
|
import { useNotification } from "../../../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -32,6 +33,7 @@ export function JobChecklistForm({ insertAuditTrail, formItems, bodyshop, curren
|
|||||||
const [markAptArrived] = useMutation(MARK_APPOINTMENT_ARRIVED);
|
const [markAptArrived] = useMutation(MARK_APPOINTMENT_ARRIVED);
|
||||||
const [markLatestAptArrived] = useMutation(MARK_LATEST_APPOINTMENT_ARRIVED);
|
const [markLatestAptArrived] = useMutation(MARK_LATEST_APPOINTMENT_ARRIVED);
|
||||||
const [updateOwner] = useMutation(UPDATE_OWNER);
|
const [updateOwner] = useMutation(UPDATE_OWNER);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const { jobId } = useParams();
|
const { jobId } = useParams();
|
||||||
const history = useNavigate();
|
const history = useNavigate();
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ import { useParams } from "react-router-dom";
|
|||||||
import { logImEXEvent } from "../../../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../../../firebase/firebase.utils";
|
||||||
import { GenerateDocument, GenerateDocuments } from "../../../../utils/RenderTemplate";
|
import { GenerateDocument, GenerateDocuments } from "../../../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../../../utils/TemplateConstants";
|
import { TemplateList } from "../../../../utils/TemplateConstants";
|
||||||
|
import { useNotification } from "../../../../contexts/Notifications/notificationContext.jsx";
|
||||||
const TemplateListGenerated = TemplateList();
|
const TemplateListGenerated = TemplateList();
|
||||||
|
|
||||||
export default function JobIntakeTemplateList({ templates }) {
|
export default function JobIntakeTemplateList({ templates }) {
|
||||||
const { jobId } = useParams();
|
const { jobId } = useParams();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const renderTemplate = async (templateKey) => {
|
const renderTemplate = async (templateKey) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -23,7 +25,9 @@ export default function JobIntakeTemplateList({ templates }) {
|
|||||||
variables: { id: jobId }
|
variables: { id: jobId }
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
"p"
|
"p",
|
||||||
|
null,
|
||||||
|
notification
|
||||||
);
|
);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
@@ -35,7 +39,8 @@ export default function JobIntakeTemplateList({ templates }) {
|
|||||||
await GenerateDocuments(
|
await GenerateDocuments(
|
||||||
templates.map((key) => {
|
templates.map((key) => {
|
||||||
return { name: key, variables: { id: jobId } };
|
return { name: key, variables: { id: jobId } };
|
||||||
})
|
}),
|
||||||
|
notification
|
||||||
);
|
);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useApolloClient } from "@apollo/client";
|
import { useApolloClient } from "@apollo/client";
|
||||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Button, notification, Popconfirm } from "antd";
|
import { Button, Popconfirm } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -10,6 +10,7 @@ import { UPDATE_JOB_LINES_IOU } from "../../graphql/jobs-lines.queries";
|
|||||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import { CreateIouForJob } from "../jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util";
|
import { CreateIouForJob } from "../jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util";
|
||||||
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -27,6 +28,7 @@ export function JobCreateIOU({ bodyshop, currentUser, job, selectedJobLines, tec
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
const history = useNavigate();
|
const history = useNavigate();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
treatments: { IOU_Tracking }
|
treatments: { IOU_Tracking }
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export function JobDetailCards({ bodyshop, setPrintCenterContext }) {
|
|||||||
md: "100%",
|
md: "100%",
|
||||||
lg: "75%",
|
lg: "75%",
|
||||||
xl: "75%",
|
xl: "75%",
|
||||||
xxl: "60%"
|
xxl: "75%"
|
||||||
};
|
};
|
||||||
const drawerPercentage = selectedBreakpoint ? bpoints[selectedBreakpoint[0]] : "100%";
|
const drawerPercentage = selectedBreakpoint ? bpoints[selectedBreakpoint[0]] : "100%";
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ export function JobDetailCards({ bodyshop, setPrintCenterContext }) {
|
|||||||
</Col>
|
</Col>
|
||||||
{!bodyshop.uselocalmediaserver && (
|
{!bodyshop.uselocalmediaserver && (
|
||||||
<Col {...span}>
|
<Col {...span}>
|
||||||
<JobDetailCardsDocumentsComponent loading={loading} data={data ? data.jobs_by_pk : null} />
|
<JobDetailCardsDocumentsComponent loading={loading} data={data ? data.jobs_by_pk : null} bodyshop={bodyshop} />
|
||||||
</Col>
|
</Col>
|
||||||
)}
|
)}
|
||||||
<Col {...span}>
|
<Col {...span}>
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
import { Carousel } from "antd";
|
import { Carousel } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
import { GenerateThumbUrl } from "../jobs-documents-gallery/job-documents.utility";
|
import { GenerateThumbUrl } from "../jobs-documents-gallery/job-documents.utility";
|
||||||
|
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||||
import CardTemplate from "./job-detail-cards.template.component";
|
import CardTemplate from "./job-detail-cards.template.component";
|
||||||
|
|
||||||
export default function JobDetailCardsDocumentsComponent({ loading, data }) {
|
export default function JobDetailCardsDocumentsComponent({ loading, data, bodyshop }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const hasMediaAccess = HasFeatureAccess({ bodyshop, featureName: "media" });
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
return (
|
return (
|
||||||
@@ -20,14 +23,18 @@ export default function JobDetailCardsDocumentsComponent({ loading, data }) {
|
|||||||
title={t("jobs.labels.cards.documents")}
|
title={t("jobs.labels.cards.documents")}
|
||||||
extraLink={`/manage/jobs/${data.id}?tab=documents`}
|
extraLink={`/manage/jobs/${data.id}?tab=documents`}
|
||||||
>
|
>
|
||||||
{data.documents.length > 0 ? (
|
{!hasMediaAccess && (
|
||||||
<Carousel autoplay>
|
<UpsellComponent disableMask upsell={upsellEnum().media.general}>
|
||||||
{data.documents.map((item) => (
|
{data.documents.length > 0 ? (
|
||||||
<img key={item.id} src={GenerateThumbUrl(item)} alt={item.name} />
|
<Carousel autoplay>
|
||||||
))}
|
{data.documents.map((item) => (
|
||||||
</Carousel>
|
<img key={item.id} src={GenerateThumbUrl(item)} alt={item.name} />
|
||||||
) : (
|
))}
|
||||||
<div>{t("documents.errors.nodocuments")}</div>
|
</Carousel>
|
||||||
|
) : (
|
||||||
|
<div>{t("documents.errors.nodocuments")}</div>
|
||||||
|
)}
|
||||||
|
</UpsellComponent>
|
||||||
)}
|
)}
|
||||||
</CardTemplate>
|
</CardTemplate>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,9 +12,10 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
|||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import BillDetailEditcontainer from "../bill-detail-edit/bill-detail-edit.container.jsx";
|
import BillDetailEditcontainer from "../bill-detail-edit/bill-detail-edit.container";
|
||||||
import FeatureWrapper from "../feature-wrapper/feature-wrapper.component.jsx";
|
|
||||||
import TaskListContainer from "../task-list/task-list.container.jsx";
|
import BlurWrapper from "../feature-wrapper/blur-wrapper.component";
|
||||||
|
import TaskListContainer from "../task-list/task-list.container";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -82,7 +83,7 @@ export function JobLinesExpander({ jobline, jobid, bodyshop, technician }) {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
/>{" "}
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col md={24} lg={8}>
|
<Col md={24} lg={8}>
|
||||||
<Typography.Title level={4}>{t("parts_dispatch.labels.parts_dispatch")}</Typography.Title>
|
<Typography.Title level={4}>{t("parts_dispatch.labels.parts_dispatch")}</Typography.Title>
|
||||||
@@ -117,57 +118,61 @@ export function JobLinesExpander({ jobline, jobid, bodyshop, technician }) {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<FeatureWrapper featureName="bills" noauth={() => null}>
|
|
||||||
<Col md={24} lg={8}>
|
<Col md={24} lg={8}>
|
||||||
<Typography.Title level={4}>{t("bills.labels.bills")}</Typography.Title>
|
<Typography.Title level={4}>{t("bills.labels.bills")}</Typography.Title>
|
||||||
<BillDetailEditcontainer />
|
<BillDetailEditcontainer />
|
||||||
<Timeline
|
<Timeline
|
||||||
items={
|
items={
|
||||||
data.billlines.length > 0
|
data.billlines.length > 0
|
||||||
? data.billlines.map((line) => ({
|
? data.billlines.map((line) => ({
|
||||||
key: line.id,
|
key: line.id,
|
||||||
|
children: (
|
||||||
|
<Row wrap>
|
||||||
|
<Col span={4}>
|
||||||
|
{!technician ? (
|
||||||
|
<>
|
||||||
|
<Link to={`/manage/jobs/${jobid}?tab=partssublet&billid=${line.bill.id}`}>
|
||||||
|
{line.bill.invoice_number}
|
||||||
|
</Link>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
`${line.bill.invoice_number}`
|
||||||
|
)}
|
||||||
|
</Col>
|
||||||
|
<Col span={4}>
|
||||||
|
<span>
|
||||||
|
{`${t("billlines.fields.actual_price")}: `}
|
||||||
|
<CurrencyFormatter>{line.actual_price}</CurrencyFormatter>
|
||||||
|
</span>
|
||||||
|
</Col>
|
||||||
|
<Col span={4}>
|
||||||
|
<span>
|
||||||
|
{`${t("billlines.fields.actual_cost")}: `}
|
||||||
|
<CurrencyFormatter>{line.actual_cost}</CurrencyFormatter>
|
||||||
|
</span>
|
||||||
|
</Col>
|
||||||
|
<Col span={4}>
|
||||||
|
<DateFormatter>{line.bill.date}</DateFormatter>
|
||||||
|
</Col>
|
||||||
|
<Col span={4}> {line.bill.vendor.name}</Col>
|
||||||
|
</Row>
|
||||||
|
)
|
||||||
|
}))
|
||||||
|
: [
|
||||||
|
{
|
||||||
|
key: "no-orders",
|
||||||
children: (
|
children: (
|
||||||
<Row wrap>
|
<BlurWrapper featureName="bills">
|
||||||
<Col span={4}>
|
<span>{t("bills.labels.nobilllines")}</span>
|
||||||
{!technician ? (
|
</BlurWrapper>
|
||||||
<>
|
|
||||||
<Link to={`/manage/jobs/${jobid}?tab=partssublet&billid=${line.bill.id}`}>
|
|
||||||
{line.bill.invoice_number}
|
|
||||||
</Link>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
`${line.bill.invoice_number}`
|
|
||||||
)}
|
|
||||||
</Col>
|
|
||||||
<Col span={4}>
|
|
||||||
<span>
|
|
||||||
{`${t("billlines.fields.actual_price")}: `}
|
|
||||||
<CurrencyFormatter>{line.actual_price}</CurrencyFormatter>
|
|
||||||
</span>
|
|
||||||
</Col>
|
|
||||||
<Col span={4}>
|
|
||||||
<span>
|
|
||||||
{`${t("billlines.fields.actual_cost")}: `}
|
|
||||||
<CurrencyFormatter>{line.actual_cost}</CurrencyFormatter>
|
|
||||||
</span>
|
|
||||||
</Col>
|
|
||||||
<Col span={4}>
|
|
||||||
<DateFormatter>{line.bill.date}</DateFormatter>
|
|
||||||
</Col>
|
|
||||||
<Col span={4}> {line.bill.vendor.name}</Col>
|
|
||||||
</Row>
|
|
||||||
)
|
)
|
||||||
}))
|
}
|
||||||
: [
|
]
|
||||||
{
|
}
|
||||||
key: "no-orders",
|
/>
|
||||||
children: t("bills.labels.nobilllines")
|
</Col>
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
</FeatureWrapper>
|
|
||||||
<Col md={24} lg={24}>
|
<Col md={24} lg={24}>
|
||||||
<TaskListContainer
|
<TaskListContainer
|
||||||
parentJobId={jobid}
|
parentJobId={jobid}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, Checkbox, Form, notification, Popover, Tooltip } from "antd";
|
import { Button, Form, Popover, Tooltip } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
@@ -11,6 +11,7 @@ import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
|||||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
import CurrencyFormItemComponent from "../form-items-formatted/currency-form-item.component";
|
import CurrencyFormItemComponent from "../form-items-formatted/currency-form-item.component";
|
||||||
import JobLineConvertToLabor from "../job-line-convert-to-labor/job-line-convert-to-labor.component";
|
import JobLineConvertToLabor from "../job-line-convert-to-labor/job-line-convert-to-labor.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
technician: selectTechnician
|
technician: selectTechnician
|
||||||
@@ -20,6 +21,7 @@ const mapDispatchToProps = (dispatch) => ({});
|
|||||||
export function JobLinesPartPriceChange({ job, line, refetch, technician }) {
|
export function JobLinesPartPriceChange({ job, line, refetch, technician }) {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [updatePartPrice] = useMutation(UPDATE_LINE_PPC);
|
const [updatePartPrice] = useMutation(UPDATE_LINE_PPC);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleFinish = async (values) => {
|
const handleFinish = async (values) => {
|
||||||
try {
|
try {
|
||||||
@@ -69,16 +71,11 @@ export function JobLinesPartPriceChange({ job, line, refetch, technician }) {
|
|||||||
<Form.Item name="act_price" label={t("jobs.labels.act_price_ppc")} rules={[{ required: true }]}>
|
<Form.Item name="act_price" label={t("jobs.labels.act_price_ppc")} rules={[{ required: true }]}>
|
||||||
<CurrencyFormItemComponent />
|
<CurrencyFormItemComponent />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Button
|
<Button disabled={InstanceRenderManager({ imex: true, rome: false })} loading={loading} htmlType="primary">
|
||||||
disabled={InstanceRenderManager({ imex: true, rome: false, promanager: true })}
|
|
||||||
loading={loading}
|
|
||||||
htmlType="primary"
|
|
||||||
>
|
|
||||||
{t("general.actions.save")}
|
{t("general.actions.save")}
|
||||||
</Button>
|
</Button>
|
||||||
</Form>
|
</Form>
|
||||||
),
|
)
|
||||||
promanager: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -519,6 +519,7 @@ export function JobLinesComponent({
|
|||||||
{selectedLines.length > 0 && ` (${selectedLines.length})`}
|
{selectedLines.length > 0 && ` (${selectedLines.length})`}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
id="job-lines-order-parts-button"
|
||||||
disabled={(job && !job.converted) || (selectedLines.length > 0 ? false : true) || jobRO || technician}
|
disabled={(job && !job.converted) || (selectedLines.length > 0 ? false : true) || jobRO || technician}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setPartsOrderContext({
|
setPartsOrderContext({
|
||||||
@@ -541,6 +542,7 @@ export function JobLinesComponent({
|
|||||||
{selectedLines.length > 0 && ` (${selectedLines.length})`}
|
{selectedLines.length > 0 && ` (${selectedLines.length})`}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
id="job-lines-filter-parts-only-button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setState((state) => ({
|
setState((state) => ({
|
||||||
...state,
|
...state,
|
||||||
@@ -554,7 +556,7 @@ export function JobLinesComponent({
|
|||||||
<FilterFilled /> {t("jobs.actions.filterpartsonly")}
|
<FilterFilled /> {t("jobs.actions.filterpartsonly")}
|
||||||
</Button>
|
</Button>
|
||||||
<Dropdown menu={markMenu} trigger={["click"]}>
|
<Dropdown menu={markMenu} trigger={["click"]}>
|
||||||
<Button>{t("jobs.actions.mark")}</Button>
|
<Button id="repair-data-mark-button">{t("jobs.actions.mark")}</Button>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
<Button
|
<Button
|
||||||
disabled={jobRO || technician}
|
disabled={jobRO || technician}
|
||||||
|
|||||||
@@ -158,8 +158,7 @@ export function JobEmployeeAssignments({
|
|||||||
label={t(
|
label={t(
|
||||||
InstanceRenderManager({
|
InstanceRenderManager({
|
||||||
imex: "jobs.fields.employee_csr",
|
imex: "jobs.fields.employee_csr",
|
||||||
rome: "jobs.fields.employee_csr_writer",
|
rome: "jobs.fields.employee_csr_writer"
|
||||||
promanager: "USE_ROME"
|
|
||||||
})
|
})
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { notification } from "antd";
|
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
@@ -10,6 +9,7 @@ import { connect } from "react-redux";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
@@ -23,6 +23,7 @@ export function JobEmployeeAssignmentsContainer({ job, refetch, insertAuditTrail
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [updateJob] = useMutation(UPDATE_JOB_ASSIGNMENTS);
|
const [updateJob] = useMutation(UPDATE_JOB_ASSIGNMENTS);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleAdd = async (assignment) => {
|
const handleAdd = async (assignment) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|||||||
@@ -8,13 +8,26 @@ import { isEmpty } from "lodash";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import "./job-lifecycle.styles.scss";
|
import "./job-lifecycle.styles.scss";
|
||||||
|
import BlurWrapperComponent from "../feature-wrapper/blur-wrapper.component";
|
||||||
|
|
||||||
|
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||||
|
|
||||||
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
// show text on bar if text can fit
|
// show text on bar if text can fit
|
||||||
export function JobLifecycleComponent({ job, statuses, ...rest }) {
|
export function JobLifecycleComponent({ bodyshop, job, statuses, ...rest }) {
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [lifecycleData, setLifecycleData] = useState(null);
|
const [lifecycleData, setLifecycleData] = useState(null);
|
||||||
const { t } = useTranslation(); // Used for tracking external state changes.
|
const { t } = useTranslation(); // Used for tracking external state changes.
|
||||||
|
const hasLifeCycleAccess = HasFeatureAccess({ bodyshop, featureName: "lifecycle" });
|
||||||
const { data } = useQuery(
|
const { data } = useQuery(
|
||||||
gql`
|
gql`
|
||||||
query get_job_test($id: uuid!) {
|
query get_job_test($id: uuid!) {
|
||||||
@@ -65,14 +78,28 @@ export function JobLifecycleComponent({ job, statuses, ...rest }) {
|
|||||||
{
|
{
|
||||||
title: t("job_lifecycle.columns.value"),
|
title: t("job_lifecycle.columns.value"),
|
||||||
dataIndex: "value",
|
dataIndex: "value",
|
||||||
key: "value"
|
key: "value",
|
||||||
|
render: (text, record) => (
|
||||||
|
<BlurWrapperComponent
|
||||||
|
featureName="lifecycle"
|
||||||
|
bypass
|
||||||
|
valueProp="children"
|
||||||
|
overrideValueFunction="RandomSmallString:2"
|
||||||
|
>
|
||||||
|
<span>{text}</span>
|
||||||
|
</BlurWrapperComponent>
|
||||||
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("job_lifecycle.columns.start"),
|
title: t("job_lifecycle.columns.start"),
|
||||||
dataIndex: "start",
|
dataIndex: "start",
|
||||||
key: "start",
|
key: "start",
|
||||||
render: (text) => DateTimeFormatterFunction(text),
|
sorter: (a, b) => dayjs(a.start).unix() - dayjs(b.start).unix(),
|
||||||
sorter: (a, b) => dayjs(a.start).unix() - dayjs(b.start).unix()
|
render: (text, record) => (
|
||||||
|
<BlurWrapperComponent featureName="lifecycle" bypass valueProp="children" overrideValueFunction="RandomDate">
|
||||||
|
<span>{DateTimeFormatterFunction(text)}</span>
|
||||||
|
</BlurWrapperComponent>
|
||||||
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("job_lifecycle.columns.relative_start"),
|
title: t("job_lifecycle.columns.relative_start"),
|
||||||
@@ -92,7 +119,12 @@ export function JobLifecycleComponent({ job, statuses, ...rest }) {
|
|||||||
}
|
}
|
||||||
return dayjs(a.end).unix() - dayjs(b.end).unix();
|
return dayjs(a.end).unix() - dayjs(b.end).unix();
|
||||||
},
|
},
|
||||||
render: (text) => (isEmpty(text) ? t("job_lifecycle.content.not_available") : DateTimeFormatterFunction(text))
|
|
||||||
|
render: (text, record) => (
|
||||||
|
<BlurWrapperComponent featureName="lifecycle" bypass valueProp="children" overrideValueFunction="RandomDate">
|
||||||
|
<span>{isEmpty(text) ? t("job_lifecycle.content.not_available") : DateTimeFormatterFunction(text)}</span>
|
||||||
|
</BlurWrapperComponent>
|
||||||
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("job_lifecycle.columns.relative_end"),
|
title: t("job_lifecycle.columns.relative_end"),
|
||||||
@@ -122,67 +154,74 @@ export function JobLifecycleComponent({ job, statuses, ...rest }) {
|
|||||||
}
|
}
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
>
|
>
|
||||||
<div
|
{!hasLifeCycleAccess && (
|
||||||
id="bar-container"
|
<Card type="inner" style={{ marginTop: "10px" }}>
|
||||||
style={{
|
<UpsellComponent upsell={upsellEnum().lifecycle.general} />
|
||||||
display: "flex",
|
</Card>
|
||||||
width: "100%",
|
)}
|
||||||
height: "100px",
|
<BlurWrapperComponent featureName="lifecycle" bypass>
|
||||||
textAlign: "center",
|
<div
|
||||||
borderRadius: "5px",
|
id="bar-container"
|
||||||
borderWidth: "5px",
|
style={{
|
||||||
borderStyle: "solid",
|
display: "flex",
|
||||||
borderColor: "#f0f2f5",
|
width: "100%",
|
||||||
margin: 0,
|
height: "100px",
|
||||||
padding: 0
|
textAlign: "center",
|
||||||
}}
|
borderRadius: "5px",
|
||||||
>
|
borderWidth: "5px",
|
||||||
{lifecycleData.durations.summations.map((key, index, array) => {
|
borderStyle: "solid",
|
||||||
const isFirst = index === 0;
|
borderColor: "#f0f2f5",
|
||||||
const isLast = index === array.length - 1;
|
margin: 0,
|
||||||
return (
|
padding: 0
|
||||||
<div
|
}}
|
||||||
key={key.status}
|
>
|
||||||
style={{
|
{lifecycleData.durations.summations.map((key, index, array) => {
|
||||||
overflow: "hidden",
|
const isFirst = index === 0;
|
||||||
display: "flex",
|
const isLast = index === array.length - 1;
|
||||||
flexDirection: "column",
|
return (
|
||||||
justifyContent: "center",
|
<div
|
||||||
alignItems: "center",
|
key={key.status}
|
||||||
margin: 0,
|
style={{
|
||||||
padding: 0,
|
overflow: "hidden",
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
margin: 0,
|
||||||
|
padding: 0,
|
||||||
|
|
||||||
borderTop: "1px solid #f0f2f5",
|
borderTop: "1px solid #f0f2f5",
|
||||||
borderBottom: "1px solid #f0f2f5",
|
borderBottom: "1px solid #f0f2f5",
|
||||||
borderLeft: isFirst ? "1px solid #f0f2f5" : undefined,
|
borderLeft: isFirst ? "1px solid #f0f2f5" : undefined,
|
||||||
borderRight: isLast ? "1px solid #f0f2f5" : undefined,
|
borderRight: isLast ? "1px solid #f0f2f5" : undefined,
|
||||||
|
|
||||||
backgroundColor: key.color,
|
backgroundColor: key.color,
|
||||||
width: `${key.percentage}%`
|
width: `${key.percentage}%`
|
||||||
}}
|
}}
|
||||||
aria-label={`${key.status} | ${key.roundedPercentage} | ${key.humanReadable}`}
|
aria-label={`${key.status} | ${key.roundedPercentage} | ${key.humanReadable}`}
|
||||||
title={`${key.status} | ${key.roundedPercentage} | ${key.humanReadable}`}
|
title={`${key.status} | ${key.roundedPercentage} | ${key.humanReadable}`}
|
||||||
>
|
>
|
||||||
{key.percentage > 15 ? (
|
{key.percentage > 15 ? (
|
||||||
<>
|
<>
|
||||||
<div>{key.roundedPercentage}</div>
|
<div>{key.roundedPercentage}</div>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: "#f0f2f5",
|
backgroundColor: "#f0f2f5",
|
||||||
borderRadius: "5px",
|
borderRadius: "5px",
|
||||||
paddingRight: "2px",
|
paddingRight: "2px",
|
||||||
paddingLeft: "2px",
|
paddingLeft: "2px",
|
||||||
fontSize: "0.8rem"
|
fontSize: "0.8rem"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{key.status}
|
{key.status}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
</BlurWrapperComponent>
|
||||||
<Card type="inner" title={t("job_lifecycle.content.legend_title")} style={{ marginTop: "10px" }}>
|
<Card type="inner" title={t("job_lifecycle.content.legend_title")} style={{ marginTop: "10px" }}>
|
||||||
<div>
|
<div>
|
||||||
{lifecycleData.durations.summations.map((key) => (
|
{lifecycleData.durations.summations.map((key) => (
|
||||||
@@ -197,7 +236,16 @@ export function JobLifecycleComponent({ job, statuses, ...rest }) {
|
|||||||
textAlign: "center"
|
textAlign: "center"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{key.status} ({key.roundedPercentage})
|
{key.status} (
|
||||||
|
<BlurWrapperComponent
|
||||||
|
featureName="lifecycle"
|
||||||
|
bypass
|
||||||
|
overrideValueFunction="RandomAmount"
|
||||||
|
valueProp="children"
|
||||||
|
>
|
||||||
|
<span>{key.roundedPercentage}</span>
|
||||||
|
</BlurWrapperComponent>
|
||||||
|
)
|
||||||
</div>
|
</div>
|
||||||
</Tag>
|
</Tag>
|
||||||
))}
|
))}
|
||||||
@@ -267,5 +315,4 @@ export function JobLifecycleComponent({ job, statuses, ...rest }) {
|
|||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(JobLifecycleComponent);
|
||||||
export default JobLifecycleComponent;
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
|
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, Form, notification, Popover, Select, Space } from "antd";
|
import { Button, Form, Popover, Select, Space } from "antd";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -10,6 +10,7 @@ import { selectJobReadOnly } from "../../redux/application/application.selectors
|
|||||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -36,6 +37,7 @@ export function JoblineBulkAssign({
|
|||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [assignLines] = useMutation(UPDATE_LINE_BULK_ASSIGN);
|
const [assignLines] = useMutation(UPDATE_LINE_BULK_ASSIGN);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleConvert = async (values) => {
|
const handleConvert = async (values) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ClockCircleOutlined } from "@ant-design/icons";
|
import { ClockCircleOutlined } from "@ant-design/icons";
|
||||||
import { useApolloClient } from "@apollo/client";
|
import { useApolloClient } from "@apollo/client";
|
||||||
import { Button, Card, Form, notification, Popover, Select, Space, Tooltip } from "antd";
|
import { Button, Card, Form, Popover, Select, Space, Tooltip } from "antd";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
@@ -13,6 +13,7 @@ import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries";
|
|||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
technician: selectTechnician
|
technician: selectTechnician
|
||||||
@@ -29,6 +30,7 @@ export function JobLineConvertToLabor({ children, jobline, job, insertAuditTrail
|
|||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [visibility, setVisibility] = useState(false);
|
const [visibility, setVisibility] = useState(false);
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleFinish = async (values) => {
|
const handleFinish = async (values) => {
|
||||||
const { mod_lbr_ty } = values;
|
const { mod_lbr_ty } = values;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
|
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, Form, notification, Popover, Select, Space } from "antd";
|
import { Button, Form, Popover, Select, Space } from "antd";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -11,6 +11,7 @@ import { selectJobReadOnly } from "../../redux/application/application.selectors
|
|||||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -25,7 +26,6 @@ export default connect(mapStateToProps, mapDispatchToProps)(JobLineDispatchButto
|
|||||||
export function JobLineDispatchButton({
|
export function JobLineDispatchButton({
|
||||||
setSelectedLines,
|
setSelectedLines,
|
||||||
selectedLines,
|
selectedLines,
|
||||||
|
|
||||||
bodyshop,
|
bodyshop,
|
||||||
jobRO,
|
jobRO,
|
||||||
job,
|
job,
|
||||||
@@ -40,6 +40,7 @@ export function JobLineDispatchButton({
|
|||||||
});
|
});
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [dispatchLines] = useMutation(INSERT_PARTS_DISPATCH);
|
const [dispatchLines] = useMutation(INSERT_PARTS_DISPATCH);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleConvert = async (values) => {
|
const handleConvert = async (values) => {
|
||||||
try {
|
try {
|
||||||
@@ -80,7 +81,9 @@ export function JobLineDispatchButton({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
"p"
|
"p",
|
||||||
|
null,
|
||||||
|
notification
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { notification, Select, Space } from "antd";
|
import { Select, Space } from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -7,6 +7,7 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries";
|
import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
@@ -22,6 +23,7 @@ export function JobLineLocationPopup({ bodyshop, jobline, disabled }) {
|
|||||||
const [location, setLocation] = useState(jobline.location);
|
const [location, setLocation] = useState(jobline.location);
|
||||||
const [updateJob] = useMutation(UPDATE_JOB_LINE);
|
const [updateJob] = useMutation(UPDATE_JOB_LINE);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (editing) setLocation(jobline.location);
|
if (editing) setLocation(jobline.location);
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { FieldTimeOutlined } from "@ant-design/icons";
|
import { FieldTimeOutlined } from "@ant-design/icons";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Input, notification } from "antd";
|
import { Input } from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries";
|
import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries";
|
||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function JobLineNotePopup({ jobline, disabled }) {
|
export default function JobLineNotePopup({ jobline, disabled }) {
|
||||||
const [editing, setEditing] = useState(false);
|
const [editing, setEditing] = useState(false);
|
||||||
@@ -12,6 +13,7 @@ export default function JobLineNotePopup({ jobline, disabled }) {
|
|||||||
const [note, setNote] = useState(jobline.note);
|
const [note, setNote] = useState(jobline.note);
|
||||||
const [updateJob] = useMutation(UPDATE_JOB_LINE);
|
const [updateJob] = useMutation(UPDATE_JOB_LINE);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (editing) setNote(jobline.notes);
|
if (editing) setNote(jobline.notes);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { notification, Select } from "antd";
|
import { Select } from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -7,6 +7,7 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries";
|
import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
@@ -22,6 +23,7 @@ export function JobLineStatusPopup({ bodyshop, jobline, disabled }) {
|
|||||||
const [status, setStatus] = useState(jobline.status);
|
const [status, setStatus] = useState(jobline.status);
|
||||||
const [updateJob] = useMutation(UPDATE_JOB_LINE);
|
const [updateJob] = useMutation(UPDATE_JOB_LINE);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (editing) setStatus(jobline.status);
|
if (editing) setStatus(jobline.status);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { notification, Select } from "antd";
|
import { Select } from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -9,6 +9,7 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
|||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
@@ -24,6 +25,7 @@ export function JoblineTeamAssignment({ bodyshop, jobline, disabled, jobId, inse
|
|||||||
const [assignedTeam, setAssignedTeam] = useState(jobline.assigned_team);
|
const [assignedTeam, setAssignedTeam] = useState(jobline.assigned_team);
|
||||||
const [updateJob] = useMutation(UPDATE_JOB_LINE);
|
const [updateJob] = useMutation(UPDATE_JOB_LINE);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (editing) setAssignedTeam(jobline.assigned_team);
|
if (editing) setAssignedTeam(jobline.assigned_team);
|
||||||
|
|||||||
@@ -192,6 +192,23 @@ export function JobLinesUpsertModalComponent({ bodyshop, open, jobLine, handleCa
|
|||||||
<Form.Item label={t("joblines.fields.tax_part")} name="tax_part" valuePropName="checked" initialValue={true}>
|
<Form.Item label={t("joblines.fields.tax_part")} name="tax_part" valuePropName="checked" initialValue={true}>
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item dependencies={[["act_price"]]} noStyle>
|
||||||
|
{() => {
|
||||||
|
if (form.getFieldValue("act_price") === 0) {
|
||||||
|
return (
|
||||||
|
<Form.Item
|
||||||
|
label={t("joblines.fields.include_in_part_cnt")}
|
||||||
|
name="include_in_part_cnt"
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { notification } from "antd";
|
|
||||||
import Axios from "axios";
|
import Axios from "axios";
|
||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
@@ -14,6 +13,7 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
|||||||
import CriticalPartsScan from "../../utils/criticalPartsScan";
|
import CriticalPartsScan from "../../utils/criticalPartsScan";
|
||||||
import UndefinedToNull from "../../utils/undefinedtonull";
|
import UndefinedToNull from "../../utils/undefinedtonull";
|
||||||
import JobLinesUpdsertModal from "./job-lines-upsert-modal.component";
|
import JobLinesUpdsertModal from "./job-lines-upsert-modal.component";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobLineEditModal: selectJobLineEditModal,
|
jobLineEditModal: selectJobLineEditModal,
|
||||||
@@ -31,6 +31,7 @@ function JobLinesUpsertModalContainer({ jobLineEditModal, toggleModalVisible, bo
|
|||||||
names: ["CriticalPartsScanning"],
|
names: ["CriticalPartsScanning"],
|
||||||
splitKey: bodyshop.imexshopid
|
splitKey: bodyshop.imexshopid
|
||||||
});
|
});
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [insertJobLine] = useMutation(INSERT_NEW_JOB_LINE);
|
const [insertJobLine] = useMutation(INSERT_NEW_JOB_LINE);
|
||||||
@@ -115,7 +116,7 @@ function JobLinesUpsertModalContainer({ jobLineEditModal, toggleModalVisible, bo
|
|||||||
toggleModalVisible();
|
toggleModalVisible();
|
||||||
}
|
}
|
||||||
if (CriticalPartsScanning.treatment === "on") {
|
if (CriticalPartsScanning.treatment === "on") {
|
||||||
CriticalPartsScan(jobLineEditModal.context.jobid);
|
CriticalPartsScan(jobLineEditModal.context.jobid, notification);
|
||||||
}
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Checkbox, notification, Space, Spin } from "antd";
|
import { Checkbox, Space, Spin } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function JobRemoveFromPartsQueue({ checked, jobId }) {
|
export default function JobRemoveFromPartsQueue({ checked, jobId }) {
|
||||||
const [updateJob] = useMutation(UPDATE_JOB);
|
const [updateJob] = useMutation(UPDATE_JOB);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleChange = async (e) => {
|
const handleChange = async (e) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|||||||
@@ -1,19 +1,32 @@
|
|||||||
import { useLazyQuery, useMutation } from "@apollo/client";
|
|
||||||
import { CheckCircleOutlined } from "@ant-design/icons";
|
import { CheckCircleOutlined } from "@ant-design/icons";
|
||||||
import { Button, Card, Form, InputNumber, notification, Popover, Space } from "antd";
|
import { useLazyQuery, useMutation } from "@apollo/client";
|
||||||
import dayjs from "../../utils/day";
|
import { Button, Card, Form, InputNumber, Popover, Space } from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import {
|
import {
|
||||||
INSERT_SCOREBOARD_ENTRY,
|
INSERT_SCOREBOARD_ENTRY,
|
||||||
QUERY_SCOREBOARD_ENTRY,
|
QUERY_SCOREBOARD_ENTRY,
|
||||||
UPDATE_SCOREBOARD_ENTRY
|
UPDATE_SCOREBOARD_ENTRY
|
||||||
} from "../../graphql/scoreboard.queries";
|
} from "../../graphql/scoreboard.queries";
|
||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import { selectBodyshop } from "../../redux/user/user.selectors.js";
|
||||||
|
import dayjs from "../../utils/day";
|
||||||
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component.jsx";
|
||||||
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component.jsx";
|
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component.jsx";
|
||||||
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
|
import LockWrapperComponent from "../lock-wrapper/lock-wrapper.component.jsx";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function ScoreboardAddButton({ job, disabled, ...otherBtnProps }) {
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
|
||||||
|
export function ScoreboardAddButton({ bodyshop, job, disabled, ...otherBtnProps }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [insertScoreboardEntry] = useMutation(INSERT_SCOREBOARD_ENTRY);
|
const [insertScoreboardEntry] = useMutation(INSERT_SCOREBOARD_ENTRY);
|
||||||
const [updateScoreboardEntry] = useMutation(UPDATE_SCOREBOARD_ENTRY);
|
const [updateScoreboardEntry] = useMutation(UPDATE_SCOREBOARD_ENTRY);
|
||||||
@@ -21,6 +34,7 @@ export default function ScoreboardAddButton({ job, disabled, ...otherBtnProps })
|
|||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [visibility, setVisibility] = useState(false);
|
const [visibility, setVisibility] = useState(false);
|
||||||
const [callQuery, { loading: entryLoading, data: entryData }] = useLazyQuery(QUERY_SCOREBOARD_ENTRY);
|
const [callQuery, { loading: entryLoading, data: entryData }] = useLazyQuery(QUERY_SCOREBOARD_ENTRY);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (visibility) {
|
if (visibility) {
|
||||||
@@ -162,12 +176,14 @@ export default function ScoreboardAddButton({ job, disabled, ...otherBtnProps })
|
|||||||
setVisibility(true);
|
setVisibility(true);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
const hasScoreboardAccess = HasFeatureAccess({ bodyshop, featureName: "scoreboard" });
|
||||||
return (
|
return (
|
||||||
<Popover content={overlay} open={visibility} placement="bottom">
|
<Popover content={overlay} open={visibility} placement="bottom">
|
||||||
<Button loading={loading} disabled={disabled} onClick={handleClick} {...otherBtnProps}>
|
<Button loading={loading} disabled={disabled || !hasScoreboardAccess} onClick={handleClick} {...otherBtnProps}>
|
||||||
{t("jobs.actions.addtoscoreboard")}
|
<LockWrapperComponent featureName="scoreboard">{t("jobs.actions.addtoscoreboard")}</LockWrapperComponent>
|
||||||
</Button>
|
</Button>
|
||||||
</Popover>
|
</Popover>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(ScoreboardAddButton);
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
import { Button, notification } from "antd";
|
import { Button } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
export default function JobSendPartPriceChangeComponent({ job, disabled }) {
|
export default function JobSendPartPriceChangeComponent({ job, disabled }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const handleClick = async () => {
|
const handleClick = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -96,8 +96,7 @@ export default function JobTotalsTableLabor({ job }) {
|
|||||||
sortOrder: state.sortedInfo.columnKey === "total" && state.sortedInfo.order,
|
sortOrder: state.sortedInfo.columnKey === "total" && state.sortedInfo.order,
|
||||||
render: (text, record) => Dinero(record.total).toFormat()
|
render: (text, record) => Dinero(record.total).toFormat()
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
promanager: "USE_ROME"
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -131,8 +130,7 @@ export default function JobTotalsTableLabor({ job }) {
|
|||||||
<Table.Summary.Cell />
|
<Table.Summary.Cell />
|
||||||
<Table.Summary.Cell />
|
<Table.Summary.Cell />
|
||||||
</>
|
</>
|
||||||
),
|
)
|
||||||
promanager: "USE_ROME"
|
|
||||||
})}
|
})}
|
||||||
<Table.Summary.Cell align="right">
|
<Table.Summary.Cell align="right">
|
||||||
<strong>{Dinero(job.job_totals.rates.rates_subtotal).toFormat()}</strong>
|
<strong>{Dinero(job.job_totals.rates.rates_subtotal).toFormat()}</strong>
|
||||||
@@ -185,8 +183,7 @@ export default function JobTotalsTableLabor({ job }) {
|
|||||||
{Dinero(job.job_totals.rates.mapa.total).toFormat()}
|
{Dinero(job.job_totals.rates.mapa.total).toFormat()}
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
</>
|
</>
|
||||||
),
|
)
|
||||||
promanager: "USE_ROME"
|
|
||||||
})}
|
})}
|
||||||
</Table.Summary.Row>
|
</Table.Summary.Row>
|
||||||
<Table.Summary.Row>
|
<Table.Summary.Row>
|
||||||
@@ -236,8 +233,7 @@ export default function JobTotalsTableLabor({ job }) {
|
|||||||
{Dinero(job.job_totals.rates.mash.total).toFormat()}
|
{Dinero(job.job_totals.rates.mash.total).toFormat()}
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
</>
|
</>
|
||||||
),
|
)
|
||||||
promanager: "USE_ROME"
|
|
||||||
})}
|
})}
|
||||||
</Table.Summary.Row>
|
</Table.Summary.Row>
|
||||||
<Table.Summary.Row>
|
<Table.Summary.Row>
|
||||||
@@ -253,8 +249,7 @@ export default function JobTotalsTableLabor({ job }) {
|
|||||||
<Table.Summary.Cell />
|
<Table.Summary.Cell />
|
||||||
<Table.Summary.Cell />
|
<Table.Summary.Cell />
|
||||||
</>
|
</>
|
||||||
),
|
)
|
||||||
promanager: "USE_ROME"
|
|
||||||
})}
|
})}
|
||||||
<Table.Summary.Cell align="right">
|
<Table.Summary.Cell align="right">
|
||||||
<strong>{Dinero(job.job_totals.rates.subtotal).toFormat()}</strong>
|
<strong>{Dinero(job.job_totals.rates.subtotal).toFormat()}</strong>
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ export function JobTotalsTableTotals({ bodyshop, job }) {
|
|||||||
total: job.job_totals.totals.federal_tax
|
total: job.job_totals.totals.federal_tax
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
promanager: "USE_ROME",
|
|
||||||
rome: job.job_totals.totals.us_sales_tax_breakdown
|
rome: job.job_totals.totals.us_sales_tax_breakdown
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
@@ -183,7 +182,6 @@ export function JobTotalsTableTotals({ bodyshop, job }) {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
rome: [],
|
rome: [],
|
||||||
promanager: "USE_ROME"
|
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
key: t("jobs.fields.other_amount_payable"),
|
key: t("jobs.fields.other_amount_payable"),
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { notification, Spin } from "antd";
|
import { Spin } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
import React, { useCallback, useEffect, useState } from "react";
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
@@ -6,6 +6,8 @@ import React, { useCallback, useEffect, useState } from "react";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
@@ -15,6 +17,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(JobTotalsCashDiscoun
|
|||||||
export function JobTotalsCashDiscount({ bodyshop, amountDinero }) {
|
export function JobTotalsCashDiscount({ bodyshop, amountDinero }) {
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [fee, setFee] = useState(0);
|
const [fee, setFee] = useState(0);
|
||||||
|
const notification = useNotification();
|
||||||
|
|
||||||
const fetchData = useCallback(async () => {
|
const fetchData = useCallback(async () => {
|
||||||
if (amountDinero && bodyshop) {
|
if (amountDinero && bodyshop) {
|
||||||
@@ -47,7 +50,7 @@ export function JobTotalsCashDiscount({ bodyshop, amountDinero }) {
|
|||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [amountDinero, bodyshop]);
|
}, [amountDinero, bodyshop, notification]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user