mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-26 16:45:01 +00:00
Compare commits
233 Commits
v4.2.0
...
ticket-app
Author | SHA1 | Date | |
---|---|---|---|
38935edb93 | |||
|
e1ef65d4ca | ||
ec9d0be70b | |||
|
0ba2cbc1e8 | ||
e87429933a | |||
8e2e676e3d
|
|||
e12ad563a3 | |||
|
711aa8db9b | ||
e78d44953f | |||
18f67801c7 | |||
c815e6bc69
|
|||
807f2711fe | |||
|
cd594cd580 | ||
ac12b8cdcf | |||
9c1611d052 | |||
fb6b26bfb5
|
|||
c5cedb8bd6
|
|||
2665e43a61
|
|||
90e3043c3d | |||
af13bf9088 | |||
4aa65d69c7 | |||
9e33aec594 | |||
f88bc7e9f0 | |||
8e78c41549
|
|||
6e36771349
|
|||
dfab223391 | |||
539752485c | |||
25561cdf63
|
|||
10b73e06e1 | |||
|
e7c04e34a9 | ||
164beee7c6 | |||
|
4d96eb9457 | ||
fe2eba3b29 | |||
|
61d1232e31 | ||
6594d4f6a6 | |||
1a66a9e864 | |||
1b74c119dc | |||
14d88810f3 | |||
445a2c9358 | |||
c8baf0a8aa | |||
faed443a96 | |||
bbf387d96f | |||
|
b7c9b60744 | ||
2bd303bbbe
|
|||
c5e6122d2c
|
|||
088b876e20 | |||
3400656d7c | |||
568c8be7fd
|
|||
538ecc42ea
|
|||
15d26d4b06
|
|||
d8bd9bd7cd
|
|||
dcdfba5ccd
|
|||
0204bdd38d
|
|||
392fd01b56
|
|||
35844f3b73 | |||
7506b918d7 | |||
cfba291f2c | |||
|
04438c09d3 | ||
2a54d1b909 | |||
|
628eeac5e0 | ||
a2263b3fa1 | |||
74796d0fb0 | |||
c19481e40a
|
|||
|
6eeb717b1a | ||
beb7c462da
|
|||
|
dbf363a9e8 | ||
64a2f7c9ed
|
|||
f26d9739c8 | |||
afa5edc1d8
|
|||
42d6c9e672
|
|||
2b22d4cb7c
|
|||
c8e5d0eb37
|
|||
2bf8ad5d6c | |||
11698a52e3 | |||
70955573e8 | |||
|
3df4043eb9 | ||
06e8264dde
|
|||
b451d2c4a3 | |||
4f93150874 | |||
0566ab0910 | |||
|
f4eeee1598 | ||
33cf16fc13 | |||
0a331aab37 | |||
d43b739654 | |||
c72432efae | |||
95975fae55
|
|||
95a7efa138
|
|||
45e193ff6d
|
|||
dfc146ff3f
|
|||
b41fcf66a9 | |||
|
a8dd1b3548 | ||
2b99a480ac
|
|||
7633e587bb
|
|||
fc61dfdf3a
|
|||
f1a5b5c49e
|
|||
ec685dcd47
|
|||
631ae3eedd
|
|||
440a7837ac
|
|||
e0abf34784
|
|||
377ae9a9dc
|
|||
034dc30e30
|
|||
d615111a0f
|
|||
ffb756c712
|
|||
69daccb860
|
|||
16435423cf
|
|||
697b4ab436
|
|||
67d804e28e
|
|||
cf41fa9574
|
|||
b8b325f7d7
|
|||
e97bd8c4ef
|
|||
e28d7df533
|
|||
4b20b1bc01
|
|||
b15733076c
|
|||
25be5c9ea3
|
|||
b035020c6f
|
|||
128101dc46
|
|||
5f2711023e
|
|||
bdf2ed4bbd
|
|||
1df542603e
|
|||
80bcc68ce5
|
|||
154fc3e2f6
|
|||
e45af94c78
|
|||
166a6fde20
|
|||
631f047338
|
|||
a777588bb8
|
|||
ca78d112c2
|
|||
bcfd317d83
|
|||
348740f073
|
|||
0d74f0980f
|
|||
be19dc00db
|
|||
643028ffd6
|
|||
ac4e2e5bf2
|
|||
498572b96e
|
|||
d2a61ce69b
|
|||
a9c0567ee1
|
|||
76cec5b5a8
|
|||
efe8a67697
|
|||
26dfa9b028
|
|||
50025044d3
|
|||
e6202a2e34
|
|||
b863bd967d
|
|||
e65bcf7275
|
|||
e00ece4200
|
|||
640fd71402
|
|||
aae50ca290
|
|||
1fa483598b
|
|||
e4b6a468f8
|
|||
|
66c7758023 | ||
|
4750d2c24e | ||
|
ca05e3d979 | ||
|
a20f9b4f86 | ||
|
c73c1eb8d5 | ||
|
8778bb0731 | ||
|
c7d20eebc5 | ||
|
b9e130c159 | ||
|
3e8bc94af3 | ||
|
0c914c9f9f | ||
|
580a60c939 | ||
|
4996ac3b7c | ||
|
2a23bf19cb | ||
|
650d2596d9 | ||
|
2bdd5a329e | ||
78d1776733
|
|||
66dc603c85
|
|||
3a8154ecce
|
|||
c81828e04f
|
|||
|
ec17dd7de2 | ||
76c076a5f3 | |||
|
f0045edd6c | ||
|
d00b76ffcd | ||
|
8991f0ef3f | ||
|
d6f5eae0c9 | ||
|
821fce3dd8 | ||
|
1d33ae1e39 | ||
|
19af0feb57 | ||
|
1c09e9a692 | ||
|
d72e748388 | ||
|
ab850b7b70 | ||
|
3f9745d8cf | ||
|
473765366a | ||
|
6500c24a7f | ||
|
1d00457141 | ||
|
eb0bf56cff | ||
|
7b8cd90cf1 | ||
|
a27d92aba0 | ||
|
85bdfb9e21 | ||
|
4cffcf4de1 | ||
|
b2587a688f | ||
|
c9f0e9843b | ||
|
b40ad9e445 | ||
|
3e10e47e29 | ||
|
2a1963e993 | ||
34c171659b | |||
2d8b960d9e
|
|||
831ae03431 | |||
45828174d1
|
|||
ed45f14a45
|
|||
fa67835690
|
|||
b434d38091
|
|||
|
800a952532 | ||
9f355032a8
|
|||
0bc6e62d4d
|
|||
46fb1c04b5
|
|||
3b2c3d1464 | |||
|
0bd6038160 | ||
|
baab8e94ce | ||
e2deb55fdb
|
|||
|
2cdfb50058 | ||
39d701feb2
|
|||
613ee8b186
|
|||
56a1a488de
|
|||
3f789ad0f4 | |||
467bea7cde
|
|||
670b8eb82b
|
|||
a9760b323f
|
|||
71a3a1924a
|
|||
ecdc1e25bf
|
|||
dd37427be1
|
|||
c8467df1b1
|
|||
4c89a954fa
|
|||
7c1f3b114d
|
|||
36bc4dab24
|
|||
4b30d92282
|
|||
75fbec5489
|
|||
912fdd6349
|
|||
5832542978
|
|||
5c3585a1ed
|
|||
a2f1e20ddf
|
|||
4d67702a76
|
|||
18e442db29 | |||
|
deb3d92189 | ||
a59ea7db31
|
|||
a738b0cac9
|
6
.changes/unreleased/Feature-20240530-160003.yaml
Normal file
6
.changes/unreleased/Feature-20240530-160003.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: |
|
||||||
|
Upgrade import of address list to the last version of compiled addresses of belgian-best-address
|
||||||
|
time: 2024-05-30T16:00:03.440767606+02:00
|
||||||
|
custom:
|
||||||
|
Issue: ""
|
6
.changes/unreleased/Feature-20240531-190242.yaml
Normal file
6
.changes/unreleased/Feature-20240531-190242.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: |
|
||||||
|
Upgrade CKEditor and refactor configuration with use of typescript
|
||||||
|
time: 2024-05-31T19:02:42.776662753+02:00
|
||||||
|
custom:
|
||||||
|
Issue: ""
|
6
.changes/unreleased/Feature-20250904-181032.yaml
Normal file
6
.changes/unreleased/Feature-20250904-181032.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: Add a command to generate a list of permissions
|
||||||
|
time: 2025-09-04T18:10:32.334524026+02:00
|
||||||
|
custom:
|
||||||
|
Issue: ""
|
||||||
|
SchemaChange: No schema change
|
@@ -3,6 +3,7 @@
|
|||||||
* ([#64](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/64)) Add external identifier for a Person
|
* ([#64](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/64)) Add external identifier for a Person
|
||||||
|
|
||||||
**Schema Change**: Add columns or tables
|
**Schema Change**: Add columns or tables
|
||||||
|
* ([#330](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/330) Allow users to choose for which notifications they want to receive an email
|
||||||
### Fixed
|
### Fixed
|
||||||
* ([#422](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/422)) Fixed html layout of pages for recovering password
|
* ([#422](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/422)) Fixed html layout of pages for recovering password
|
||||||
* Fix typo in 'uncheckAll' script for centers selection
|
* Fix typo in 'uncheckAll' script for centers selection
|
||||||
|
6
.changes/v4.2.1.md
Normal file
6
.changes/v4.2.1.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
## v4.2.1 - 2025-09-03
|
||||||
|
### Fixed
|
||||||
|
* Fix exports to work with DirectExportInterface
|
||||||
|
### DX
|
||||||
|
* Improve error message when a stored object cannot be written on local disk
|
||||||
|
|
@@ -23,7 +23,7 @@ max_line_length = 0
|
|||||||
indent_size = 2
|
indent_size = 2
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
||||||
[.rst]
|
[*.rst]
|
||||||
ident_size = 3
|
indent_size = 3
|
||||||
ident_style = space
|
indent_style = space
|
||||||
|
|
||||||
|
@@ -27,11 +27,11 @@ Chill is a comprehensive web application built as a set of Symfony bundles. It i
|
|||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
Note: This is a project which exists from a long time ago, and we found multiple structure inside each bundle. When having the choice, the developers should choose the new structure.
|
Note: This is a project that's existed for a long time, and throughout the years we've used multiple structures inside each bundle. When having the choice, the developers should choose the new structure.
|
||||||
|
|
||||||
The project follows a standard Symfony bundle structure:
|
The project follows a standard Symfony bundle structure:
|
||||||
- `/src/Bundle/`: Contains all the Chill bundles. The code is either at the root of the bundle directory, or within a `src/` directory (preferred). See psr4 mapping at the root's `composer.json`.
|
- `/src/Bundle/`: Contains all the Chill bundles. The code is either at the root of the bundle directory, or within a `src/` directory (preferred). See psr4 mapping at the root's `composer.json`.
|
||||||
- each bundle come with his own tests, either in the `Tests` directory (when the code is directly within the bundle directory (for instance `src/Bundle/ChillMainBundle/Tests`, `src/Bundle/ChillPersonBundle/Tests`)), or inside the `tests` directory, alongside to the `src/` sub-directory (example: `src/Bundle/ChillWopiBundle/tests`) (this is the preferred way).
|
- each bundle comes with its own tests, either in the `Tests` directory (when the code is directly within the bundle directory (for instance `src/Bundle/ChillMainBundle/Tests`, `src/Bundle/ChillPersonBundle/Tests`)), or inside the `tests` directory, alongside the `src/` sub-directory (example: `src/Bundle/ChillWopiBundle/tests`) (this is the preferred way).
|
||||||
- `/docs/`: Contains project documentation
|
- `/docs/`: Contains project documentation
|
||||||
|
|
||||||
Each bundle typically has the following structure:
|
Each bundle typically has the following structure:
|
||||||
@@ -46,13 +46,13 @@ Each bundle typically has the following structure:
|
|||||||
|
|
||||||
### A special word about TicketBundle
|
### A special word about TicketBundle
|
||||||
|
|
||||||
The ticket bundle is developed using a kind of "Command" pattern. The controller fill a "Command", and a "CommandHandler" handle this command. They are savec in the `src/Bundle/ChillTicketBundle/src/Action` directory.
|
The ticket bundle is developed using a kind of "Command" pattern. The controller fills a "Command," and a "CommandHandler" handles this command. They are saved in the `src/Bundle/ChillTicketBundle/src/Action` directory.
|
||||||
|
|
||||||
## Development Guidelines
|
## Development Guidelines
|
||||||
|
|
||||||
### Building and Configuration Instructions
|
### Building and Configuration Instructions
|
||||||
|
|
||||||
All the command should be run through the `symfony` command, which will configure the required variables.
|
All the commands should be run through the `symfony` command, which will configure the required variables.
|
||||||
|
|
||||||
For assets, we must ensure that we use node at version `^20.0.0`. This is done using `nvm use 20`.
|
For assets, we must ensure that we use node at version `^20.0.0`. This is done using `nvm use 20`.
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ For assets, we must ensure that we use node at version `^20.0.0`. This is done u
|
|||||||
docker compose up -d
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
5. **Set Up the Database**:
|
6. **Set Up the Database**:
|
||||||
```bash
|
```bash
|
||||||
# Create the database
|
# Create the database
|
||||||
symfony console doctrine:database:create
|
symfony console doctrine:database:create
|
||||||
@@ -99,20 +99,20 @@ For assets, we must ensure that we use node at version `^20.0.0`. This is done u
|
|||||||
symfony console doctrine:fixtures:load
|
symfony console doctrine:fixtures:load
|
||||||
```
|
```
|
||||||
|
|
||||||
6. **Build Assets**:
|
7. **Build Assets**:
|
||||||
```bash
|
```bash
|
||||||
nvm use 20
|
nvm use 20
|
||||||
yarn run encore dev
|
yarn run encore dev
|
||||||
```
|
```
|
||||||
|
|
||||||
7. **Start the Development Server**:
|
8. **Start the Development Server**:
|
||||||
```bash
|
```bash
|
||||||
symfony server:start -d
|
symfony server:start -d
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Docker Setup
|
#### Docker Setup
|
||||||
|
|
||||||
The project includes Docker configuration for easier development:
|
The project includes a Docker configuration for easier development:
|
||||||
|
|
||||||
1. **Start Docker Services**:
|
1. **Start Docker Services**:
|
||||||
```bash
|
```bash
|
||||||
@@ -153,9 +153,9 @@ Key configuration files:
|
|||||||
|
|
||||||
Each time a doctrine entity is created, we generate migration to adapt the database.
|
Each time a doctrine entity is created, we generate migration to adapt the database.
|
||||||
|
|
||||||
The migration are created using the command `symfony console doctrine:migrations:diff --no-interaction --namespace <namespace>`, where the namespace is the relevant namespace for migration. As this is a bash script, do not forget to quote the `\` (`\` must become `\\` in your command).
|
The migration is created using the command `symfony console doctrine:migrations:diff --no-interaction --namespace <namespace>`, where the namespace is the relevant namespace for migration. As this is a bash script, remember to quote the `\` (`\` must become `\\` in your command).
|
||||||
|
|
||||||
Each bundle has his own namespace for migration (always ask me to confirm that command, with a list of updated / created entities so that I can confirm you that it is ok):
|
Each bundle has his own namespace for migration (always ask me to confirm that command with a list of updated / created entities so that I can confirm to you that it is ok):
|
||||||
|
|
||||||
- `Chill\Bundle\ActivityBundle` writes migrations to `Chill\Migrations\Activity`;
|
- `Chill\Bundle\ActivityBundle` writes migrations to `Chill\Migrations\Activity`;
|
||||||
- `Chill\Bundle\BudgetBundle` writes migrations to `Chill\Migrations\Budget`;
|
- `Chill\Bundle\BudgetBundle` writes migrations to `Chill\Migrations\Budget`;
|
||||||
@@ -183,7 +183,7 @@ Once created the, comment's classes should be removed and a description of the c
|
|||||||
|
|
||||||
When we need to use a DateTime or DateTimeImmutable that need to express "now", we prefer the usage of
|
When we need to use a DateTime or DateTimeImmutable that need to express "now", we prefer the usage of
|
||||||
`Symfony\Component\Clock\ClockInterface`, where possible. This is usually not possible in doctrine entities,
|
`Symfony\Component\Clock\ClockInterface`, where possible. This is usually not possible in doctrine entities,
|
||||||
where injection does not work when restoring an entity from database, but usually possible in services.
|
where injection does not work when restoring an entity from a database, but usually possible in services.
|
||||||
|
|
||||||
In test, we use `\Symfony\Component\Clock\MockClock` which is an implementation of `Symfony\Component\Clock\ClockInterface`
|
In test, we use `\Symfony\Component\Clock\MockClock` which is an implementation of `Symfony\Component\Clock\ClockInterface`
|
||||||
where we have full and easy control of the date.
|
where we have full and easy control of the date.
|
||||||
@@ -198,9 +198,9 @@ The project uses PHPUnit for testing. Each bundle has its own test suite, and th
|
|||||||
|
|
||||||
For creating mock, we prefer using prophecy (library phpspec/prophecy).
|
For creating mock, we prefer using prophecy (library phpspec/prophecy).
|
||||||
|
|
||||||
##### Useful helpers and tips that avoid create a mock
|
##### Useful helpers and tips that avoid creating a mock
|
||||||
|
|
||||||
Some notable implementations that are tests helper, and avoid to create a mock:
|
Some notable implementations that are test helpers and avoid creating a mock:
|
||||||
|
|
||||||
- `\Psr\Log\NullLogger`, an implementation of `\Psr\Log\LoggerInterface`;
|
- `\Psr\Log\NullLogger`, an implementation of `\Psr\Log\LoggerInterface`;
|
||||||
- `\Symfony\Component\Clock\MockClock`, an implementation of `Symfony\Component\Clock\ClockInterface` (already mentioned above);
|
- `\Symfony\Component\Clock\MockClock`, an implementation of `Symfony\Component\Clock\ClockInterface` (already mentioned above);
|
||||||
@@ -234,15 +234,9 @@ This must be a decision made by a human, not by an AI. Every AI task must abort
|
|||||||
|
|
||||||
#### Running Tests
|
#### Running Tests
|
||||||
|
|
||||||
The tests are run from the project's root (not from the bundle's root).
|
The tests are run from the project's root (not from the bundle's root: so, do not change the directory to any bundle directory before running tests).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Run all tests
|
|
||||||
vendor/bin/phpunit
|
|
||||||
|
|
||||||
# Run tests for a specific bundle
|
|
||||||
vendor/bin/phpunit --testsuite NameBundle
|
|
||||||
|
|
||||||
# Run a specific test file
|
# Run a specific test file
|
||||||
vendor/bin/phpunit path/to/TestFile.php
|
vendor/bin/phpunit path/to/TestFile.php
|
||||||
|
|
||||||
@@ -297,7 +291,7 @@ class TicketTest extends TestCase
|
|||||||
|
|
||||||
#### Test Database
|
#### Test Database
|
||||||
|
|
||||||
For tests that require a database, the project uses postgresql database filled by fixtures (usage of doctrine-fixtures). You can configure a different database for testing in the `.env.test` file.
|
For tests that require a database, the project uses a postgresql database filled with fixtures (usage of doctrine-fixtures). You can configure a different database for testing in the `.env.test` file.
|
||||||
|
|
||||||
### Code Quality Tools
|
### Code Quality Tools
|
||||||
|
|
||||||
|
4
.prettierrc
Normal file
4
.prettierrc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false
|
||||||
|
}
|
30
.vscode/launch.json
vendored
Normal file
30
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Chill Debug",
|
||||||
|
"type": "php",
|
||||||
|
"request": "launch",
|
||||||
|
"port": 9000,
|
||||||
|
"pathMappings": {
|
||||||
|
"/var/www/html": "${workspaceFolder}"
|
||||||
|
},
|
||||||
|
"preLaunchTask": "symfony"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Yarn Encore Dev (Watch)",
|
||||||
|
"type": "node-terminal",
|
||||||
|
"request": "launch",
|
||||||
|
"command": "yarn encore dev --watch",
|
||||||
|
"cwd": "${workspaceFolder}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"compounds": [
|
||||||
|
{
|
||||||
|
"name": "Chill Debug + Yarn Encore Dev (Watch)",
|
||||||
|
"configurations": ["Chill Debug", "Yarn Encore Dev (Watch)"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
23
.vscode/tasks.json
vendored
Normal file
23
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"command": "symfony",
|
||||||
|
"args": [
|
||||||
|
"server:start",
|
||||||
|
"--allow-http",
|
||||||
|
"--no-tls",
|
||||||
|
"--port=8000",
|
||||||
|
"--allow-all-ip",
|
||||||
|
"-d"
|
||||||
|
],
|
||||||
|
"label": "symfony"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"command": "yarn",
|
||||||
|
"args": ["encore", "dev", "--watch"],
|
||||||
|
"label": "webpack"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@@ -6,11 +6,19 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
|||||||
and is generated by [Changie](https://github.com/miniscruff/changie).
|
and is generated by [Changie](https://github.com/miniscruff/changie).
|
||||||
|
|
||||||
|
|
||||||
|
## v4.2.1 - 2025-09-03
|
||||||
|
### Fixed
|
||||||
|
* Fix exports to work with DirectExportInterface
|
||||||
|
### DX
|
||||||
|
* Improve error message when a stored object cannot be written on local disk
|
||||||
|
|
||||||
|
|
||||||
## v4.2.0 - 2025-09-02
|
## v4.2.0 - 2025-09-02
|
||||||
### Feature
|
### Feature
|
||||||
* ([#64](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/64)) Add external identifier for a Person
|
* ([#64](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/64)) Add external identifier for a Person
|
||||||
|
|
||||||
**Schema Change**: Add columns or tables
|
**Schema Change**: Add columns or tables
|
||||||
|
* ([#330](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/330) Allow users to choose for which notifications they want to receive an email
|
||||||
### Fixed
|
### Fixed
|
||||||
* ([#422](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/422)) Fixed html layout of pages for recovering password
|
* ([#422](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/422)) Fixed html layout of pages for recovering password
|
||||||
* Fix typo in 'uncheckAll' script for centers selection
|
* Fix typo in 'uncheckAll' script for centers selection
|
||||||
|
@@ -54,7 +54,7 @@ Arborescence:
|
|||||||
- person
|
- person
|
||||||
- personvendee
|
- personvendee
|
||||||
- household_edit_metadata
|
- household_edit_metadata
|
||||||
- index.js
|
- index.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
## Organisation des feuilles de styles
|
## Organisation des feuilles de styles
|
||||||
|
@@ -133,6 +133,7 @@
|
|||||||
"Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle",
|
"Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle",
|
||||||
"Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle",
|
"Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle",
|
||||||
"Chill\\WopiBundle\\": "src/Bundle/ChillWopiBundle/src",
|
"Chill\\WopiBundle\\": "src/Bundle/ChillWopiBundle/src",
|
||||||
|
"Chill\\TicketBundle\\": "src/Bundle/ChillTicketBundle/src",
|
||||||
"Chill\\Utils\\Rector\\": "utils/rector/src"
|
"Chill\\Utils\\Rector\\": "utils/rector/src"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -35,6 +35,7 @@ return [
|
|||||||
Chill\ThirdPartyBundle\ChillThirdPartyBundle::class => ['all' => true],
|
Chill\ThirdPartyBundle\ChillThirdPartyBundle::class => ['all' => true],
|
||||||
Chill\BudgetBundle\ChillBudgetBundle::class => ['all' => true],
|
Chill\BudgetBundle\ChillBudgetBundle::class => ['all' => true],
|
||||||
Chill\WopiBundle\ChillWopiBundle::class => ['all' => true],
|
Chill\WopiBundle\ChillWopiBundle::class => ['all' => true],
|
||||||
|
Chill\TicketBundle\ChillTicketBundle::class => ['all' => true],
|
||||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||||
Symfony\UX\Translator\UxTranslatorBundle::class => ['all' => true],
|
Symfony\UX\Translator\UxTranslatorBundle::class => ['all' => true],
|
||||||
];
|
];
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
chill_doc_store:
|
chill_doc_store:
|
||||||
use_driver: openstack
|
use_driver: local_storage
|
||||||
local_storage:
|
local_storage:
|
||||||
storage_path: '%kernel.project_dir%/var/storage'
|
storage_path: '%kernel.project_dir%/var/storage'
|
||||||
openstack:
|
openstack:
|
||||||
|
5
config/packages/chill_ticket.yaml
Normal file
5
config/packages/chill_ticket.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
chill_ticket:
|
||||||
|
ticket:
|
||||||
|
person_per_ticket: one # One of "one"; "many"
|
||||||
|
response_time_exceeded_delay: PT12H
|
||||||
|
|
@@ -14,6 +14,7 @@ doctrine_migrations:
|
|||||||
'Chill\Migrations\Calendar': '@ChillCalendarBundle/migrations'
|
'Chill\Migrations\Calendar': '@ChillCalendarBundle/migrations'
|
||||||
'Chill\Migrations\Budget': '@ChillBudgetBundle/migrations'
|
'Chill\Migrations\Budget': '@ChillBudgetBundle/migrations'
|
||||||
'Chill\Migrations\Report': '@ChillReportBundle/migrations'
|
'Chill\Migrations\Report': '@ChillReportBundle/migrations'
|
||||||
|
'Chill\Migrations\Ticket': '@ChillTicketBundle/migrations'
|
||||||
all_or_nothing:
|
all_or_nothing:
|
||||||
true
|
true
|
||||||
|
|
||||||
|
2
config/routes/chill_ticket.yaml
Normal file
2
config/routes/chill_ticket.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
chill_ticket_bundle:
|
||||||
|
resource: '@ChillTicketBundle/config/routes.yaml'
|
@@ -11,24 +11,94 @@
|
|||||||
Create a new bundle
|
Create a new bundle
|
||||||
*******************
|
*******************
|
||||||
|
|
||||||
Create your own bundle is not a trivial task.
|
|
||||||
|
|
||||||
The easiest way to achieve this is seems to be :
|
|
||||||
|
|
||||||
1. Prepare a fresh installation of the chill project, in a new directory
|
|
||||||
2. Create a new bundle in this project, in the src directory
|
|
||||||
3. Initialize a git repository **at the root bundle**, and create your initial commit.
|
|
||||||
4. Register the bundle with composer/packagist. If you do not plan to distribute your bundle with packagist, you may use a custom repository for achieve this [#f1]_
|
|
||||||
5. Move to a development installation, made as described in the :ref:`installation-for-development` section, and add your new repository to the composer.json file
|
|
||||||
6. Work as :ref:`usual <editing-code-and-commiting>`
|
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
This part of the doc is not yet tested
|
This part of the doc is not yet tested
|
||||||
|
|
||||||
TODO
|
Create a new directory with Bundle class
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
mkdir -p src/Bundle/ChillSomeBundle/src/config
|
||||||
|
mkdir -p src/Bundle/ChillSomeBundle/src/Controller
|
||||||
|
|
||||||
|
Add a bundle file
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\SomeBundle;
|
||||||
|
|
||||||
|
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||||
|
|
||||||
|
class ChillSomeBundle extends Bundle {}
|
||||||
|
|
||||||
|
And a route file:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
chill_ticket_controller:
|
||||||
|
resource: '@ChillTicketBundle/Controller/'
|
||||||
|
type: annotation
|
||||||
|
|
||||||
|
Register the new psr-4 namespace
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
In composer.json, add the new psr4 namespace
|
||||||
|
|
||||||
|
.. code-block:: diff
|
||||||
|
|
||||||
|
{
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
+ "Chill\\SomeBundle\\": "src/Bundle/ChillSomeBundle/src",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.. rubric:: Footnotes
|
Register the bundle
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Register in the file :code:`config/bundles.php`:
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
|
||||||
|
Vendor\Bundle\YourBundle\YourBundle::class => ['all' => true],
|
||||||
|
|
||||||
|
And import routes in :code:`config/routes/chill_some_bundle.yaml`:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
chill_ticket_bundle:
|
||||||
|
resource: '@ChillSomeBundle/config/routes.yaml'
|
||||||
|
|
||||||
|
Add the doctrine_migration namespace
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
Add the namespace to :code:`config/packages/doctrine_migrations_chill.yaml`
|
||||||
|
|
||||||
|
.. code-block:: diff
|
||||||
|
|
||||||
|
doctrine_migrations:
|
||||||
|
migrations_paths:
|
||||||
|
+ 'Chill\Some\Ticket': '@ChillSomeBundle/migrations'
|
||||||
|
|
||||||
|
Dump autoloading
|
||||||
|
----------------
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
symfony composer dump-autoload
|
||||||
|
|
||||||
.. [#f1] Be aware that we use the Affero GPL Licence, which ensure that all users must have access to derivative works done with this software.
|
|
||||||
|
@@ -79,12 +79,12 @@
|
|||||||
"dev": "encore dev",
|
"dev": "encore dev",
|
||||||
"watch": "encore dev --watch",
|
"watch": "encore dev --watch",
|
||||||
"build": "encore production --progress",
|
"build": "encore production --progress",
|
||||||
"specs-build": "yaml-merge src/Bundle/ChillMainBundle/chill.api.specs.yaml src/Bundle/ChillPersonBundle/chill.api.specs.yaml src/Bundle/ChillCalendarBundle/chill.api.specs.yaml src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml src/Bundle/ChillDocStoreBundle/chill.api.specs.yaml> templates/api/specs.yaml",
|
"specs-build": "yaml-merge src/Bundle/ChillMainBundle/chill.api.specs.yaml src/Bundle/ChillPersonBundle/chill.api.specs.yaml src/Bundle/ChillCalendarBundle/chill.api.specs.yaml src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml src/Bundle/ChillDocStoreBundle/chill.api.specs.yaml src/Bundle/ChillTicketBundle/chill.api.specs.yaml> templates/api/specs.yaml",
|
||||||
"specs-validate": "swagger-cli validate templates/api/specs.yaml",
|
"specs-validate": "swagger-cli validate templates/api/specs.yaml",
|
||||||
"specs-create-dir": "mkdir -p templates/api",
|
"specs-create-dir": "mkdir -p templates/api",
|
||||||
"specs": "yarn run specs-create-dir && yarn run specs-build && yarn run specs-validate",
|
"specs": "yarn run specs-create-dir && yarn run specs-build && yarn run specs-validate",
|
||||||
"version": "node --version",
|
"version": "node --version",
|
||||||
"eslint": "npx eslint-baseline --fix \"src/**/*.{js,ts,vue}\""
|
"eslint": "eslint-baseline --fix \"src/**/*.{js,ts,vue}\""
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
|
@@ -58,6 +58,10 @@
|
|||||||
<!-- temporarily removed, the time to find a fix -->
|
<!-- temporarily removed, the time to find a fix -->
|
||||||
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php</exclude>
|
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php</exclude>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
|
||||||
|
<testsuite name="TicketBundle">
|
||||||
|
<directory suffix="Test.php">src/Bundle/ChillTicketBundle/tests/</directory>
|
||||||
|
</testsuite>
|
||||||
<!--
|
<!--
|
||||||
<testsuite name="ReportBundle">
|
<testsuite name="ReportBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillReportBundle/Tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillReportBundle/Tests/</directory>
|
||||||
|
@@ -10,10 +10,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="
|
v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0"
|
||||||
getContext === 'accompanyingCourse' &&
|
|
||||||
suggestedEntities.length > 0
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<ul class="list-suggest add-items inline">
|
<ul class="list-suggest add-items inline">
|
||||||
<li
|
<li
|
||||||
|
@@ -39,17 +39,11 @@
|
|||||||
<option selected disabled value="">
|
<option selected disabled value="">
|
||||||
{{ trans(ACTIVITY_CHOOSE_LOCATION_TYPE) }}
|
{{ trans(ACTIVITY_CHOOSE_LOCATION_TYPE) }}
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option v-for="t in locationTypes" :value="t" :key="t.id">
|
||||||
v-for="t in locationTypes"
|
|
||||||
:value="t"
|
|
||||||
:key="t.id"
|
|
||||||
>
|
|
||||||
{{ localizeString(t.title) }}
|
{{ localizeString(t.title) }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<label>{{
|
<label>{{ trans(ACTIVITY_LOCATION_FIELDS_TYPE) }}</label>
|
||||||
trans(ACTIVITY_LOCATION_FIELDS_TYPE)
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-floating mb-3">
|
<div class="form-floating mb-3">
|
||||||
@@ -108,10 +102,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<button
|
<button class="btn btn-save" @click.prevent="saveNewLocation">
|
||||||
class="btn btn-save"
|
|
||||||
@click.prevent="saveNewLocation"
|
|
||||||
>
|
|
||||||
{{ trans(SAVE) }}
|
{{ trans(SAVE) }}
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
@@ -244,8 +235,7 @@ export default {
|
|||||||
},
|
},
|
||||||
hasPhonenumber1() {
|
hasPhonenumber1() {
|
||||||
return (
|
return (
|
||||||
this.selected.phonenumber1 !== null &&
|
this.selected.phonenumber1 !== null && this.selected.phonenumber1 !== ""
|
||||||
this.selected.phonenumber1 !== ""
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
showAddAddress() {
|
showAddAddress() {
|
||||||
|
@@ -49,9 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<div v-if="actionIsLoading === true">
|
<div v-if="actionIsLoading === true">
|
||||||
<i
|
<i class="chill-green fa fa-circle-o-notch fa-spin fa-lg"></i>
|
||||||
class="chill-green fa fa-circle-o-notch fa-spin fa-lg"
|
|
||||||
></i>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
@@ -64,8 +62,7 @@
|
|||||||
<template
|
<template
|
||||||
v-else-if="
|
v-else-if="
|
||||||
socialActionsList.length > 0 &&
|
socialActionsList.length > 0 &&
|
||||||
(socialIssuesSelected.length ||
|
(socialIssuesSelected.length || socialActionsSelected.length)
|
||||||
socialActionsSelected.length)
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -88,9 +85,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-else-if="
|
v-else-if="actionAreLoaded && socialActionsList.length === 0"
|
||||||
actionAreLoaded && socialActionsList.length === 0
|
|
||||||
"
|
|
||||||
class="inline-choice chill-no-data-statement mt-3"
|
class="inline-choice chill-no-data-statement mt-3"
|
||||||
>
|
>
|
||||||
{{ trans(ACTIVITY_SOCIAL_ACTION_LIST_EMPTY) }}
|
{{ trans(ACTIVITY_SOCIAL_ACTION_LIST_EMPTY) }}
|
||||||
@@ -169,8 +164,7 @@ export default {
|
|||||||
/* Add in list the issues already associated (if not yet listed) */
|
/* Add in list the issues already associated (if not yet listed) */
|
||||||
this.socialIssuesSelected.forEach((issue) => {
|
this.socialIssuesSelected.forEach((issue) => {
|
||||||
if (
|
if (
|
||||||
this.socialIssuesList.filter((i) => i.id === issue.id)
|
this.socialIssuesList.filter((i) => i.id === issue.id).length !== 1
|
||||||
.length !== 1
|
|
||||||
) {
|
) {
|
||||||
this.$store.commit("addIssueInList", issue);
|
this.$store.commit("addIssueInList", issue);
|
||||||
}
|
}
|
||||||
|
@@ -10,9 +10,7 @@
|
|||||||
:value="issue"
|
:value="issue"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" :for="issue.id">
|
<label class="form-check-label" :for="issue.id">
|
||||||
<span class="badge bg-chill-l-gray text-dark">{{
|
<span class="badge bg-chill-l-gray text-dark">{{ issue.text }}</span>
|
||||||
issue.text
|
|
||||||
}}</span>
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
|
@@ -68,9 +68,7 @@ export type EventInputCalendarRange = EventInput & {
|
|||||||
export function isEventInputCalendarRange(
|
export function isEventInputCalendarRange(
|
||||||
toBeDetermined: EventInputCalendarRange | EventInput,
|
toBeDetermined: EventInputCalendarRange | EventInput,
|
||||||
): toBeDetermined is EventInputCalendarRange {
|
): toBeDetermined is EventInputCalendarRange {
|
||||||
return (
|
return typeof toBeDetermined.is === "string" && toBeDetermined.is === "range";
|
||||||
typeof toBeDetermined.is === "string" && toBeDetermined.is === "range"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export {};
|
export {};
|
||||||
|
@@ -61,22 +61,14 @@
|
|||||||
<label class="input-group-text" for="slotDuration"
|
<label class="input-group-text" for="slotDuration"
|
||||||
>Durée des créneaux</label
|
>Durée des créneaux</label
|
||||||
>
|
>
|
||||||
<select
|
<select v-model="slotDuration" id="slotDuration" class="form-select">
|
||||||
v-model="slotDuration"
|
|
||||||
id="slotDuration"
|
|
||||||
class="form-select"
|
|
||||||
>
|
|
||||||
<option value="00:05:00">5 minutes</option>
|
<option value="00:05:00">5 minutes</option>
|
||||||
<option value="00:10:00">10 minutes</option>
|
<option value="00:10:00">10 minutes</option>
|
||||||
<option value="00:15:00">15 minutes</option>
|
<option value="00:15:00">15 minutes</option>
|
||||||
<option value="00:30:00">30 minutes</option>
|
<option value="00:30:00">30 minutes</option>
|
||||||
</select>
|
</select>
|
||||||
<label class="input-group-text" for="slotMinTime">De</label>
|
<label class="input-group-text" for="slotMinTime">De</label>
|
||||||
<select
|
<select v-model="slotMinTime" id="slotMinTime" class="form-select">
|
||||||
v-model="slotMinTime"
|
|
||||||
id="slotMinTime"
|
|
||||||
class="form-select"
|
|
||||||
>
|
|
||||||
<option value="00:00:00">0h</option>
|
<option value="00:00:00">0h</option>
|
||||||
<option value="01:00:00">1h</option>
|
<option value="01:00:00">1h</option>
|
||||||
<option value="02:00:00">2h</option>
|
<option value="02:00:00">2h</option>
|
||||||
@@ -92,11 +84,7 @@
|
|||||||
<option value="12:00:00">12h</option>
|
<option value="12:00:00">12h</option>
|
||||||
</select>
|
</select>
|
||||||
<label class="input-group-text" for="slotMaxTime">À</label>
|
<label class="input-group-text" for="slotMaxTime">À</label>
|
||||||
<select
|
<select v-model="slotMaxTime" id="slotMaxTime" class="form-select">
|
||||||
v-model="slotMaxTime"
|
|
||||||
id="slotMaxTime"
|
|
||||||
class="form-select"
|
|
||||||
>
|
|
||||||
<option value="12:00:00">12h</option>
|
<option value="12:00:00">12h</option>
|
||||||
<option value="13:00:00">13h</option>
|
<option value="13:00:00">13h</option>
|
||||||
<option value="14:00:00">14h</option>
|
<option value="14:00:00">14h</option>
|
||||||
@@ -124,9 +112,7 @@
|
|||||||
v-model="hideWeekends"
|
v-model="hideWeekends"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<label
|
<label for="showHideWE" class="form-check-label input-group-text"
|
||||||
for="showHideWE"
|
|
||||||
class="form-check-label input-group-text"
|
|
||||||
>Week-ends</label
|
>Week-ends</label
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@@ -142,9 +128,7 @@
|
|||||||
<b v-else-if="arg.event.extendedProps.is === 'range'"
|
<b v-else-if="arg.event.extendedProps.is === 'range'"
|
||||||
>{{ arg.timeText }}
|
>{{ arg.timeText }}
|
||||||
{{ arg.event.extendedProps.locationName }}
|
{{ arg.event.extendedProps.locationName }}
|
||||||
<small>{{
|
<small>{{ arg.event.extendedProps.userLabel }}</small></b
|
||||||
arg.event.extendedProps.userLabel
|
|
||||||
}}</small></b
|
|
||||||
>
|
>
|
||||||
<b v-else-if="arg.event.extendedProps.is === 'current'"
|
<b v-else-if="arg.event.extendedProps.is === 'current'"
|
||||||
>{{ arg.timeText }} {{ $t("current_selected") }}
|
>{{ arg.timeText }} {{ $t("current_selected") }}
|
||||||
@@ -152,9 +136,7 @@
|
|||||||
<b v-else-if="arg.event.extendedProps.is === 'local'">{{
|
<b v-else-if="arg.event.extendedProps.is === 'local'">{{
|
||||||
arg.event.title
|
arg.event.title
|
||||||
}}</b>
|
}}</b>
|
||||||
<b v-else
|
<b v-else>{{ arg.timeText }} {{ $t("current_selected") }} </b>
|
||||||
>{{ arg.timeText }} {{ $t("current_selected") }}
|
|
||||||
</b>
|
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</FullCalendar>
|
</FullCalendar>
|
||||||
@@ -268,9 +250,7 @@ export default {
|
|||||||
this.$store.state.activity.endDate !== null)
|
this.$store.state.activity.endDate !== null)
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
!window.confirm(
|
!window.confirm(this.$t("change_main_user_will_reset_event_data"))
|
||||||
this.$t("change_main_user_will_reset_event_data"),
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -278,13 +258,9 @@ export default {
|
|||||||
|
|
||||||
// add the previous user, if any, in the previous user list (in use for suggestion)
|
// add the previous user, if any, in the previous user list (in use for suggestion)
|
||||||
if (null !== this.$store.getters.getMainUser) {
|
if (null !== this.$store.getters.getMainUser) {
|
||||||
const suggestedUids = new Set(
|
const suggestedUids = new Set(this.$data.previousUser.map((u) => u.id));
|
||||||
this.$data.previousUser.map((u) => u.id),
|
|
||||||
);
|
|
||||||
if (!suggestedUids.has(this.$store.getters.getMainUser.id)) {
|
if (!suggestedUids.has(this.$store.getters.getMainUser.id)) {
|
||||||
this.$data.previousUser.push(
|
this.$data.previousUser.push(this.$store.getters.getMainUser);
|
||||||
this.$store.getters.getMainUser,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,8 +290,7 @@ export default {
|
|||||||
// show an alert if changing mainUser
|
// show an alert if changing mainUser
|
||||||
if (
|
if (
|
||||||
(this.$store.getters.getMainUser !== null &&
|
(this.$store.getters.getMainUser !== null &&
|
||||||
this.$store.state.me.id !==
|
this.$store.state.me.id !== this.$store.getters.getMainUser.id) ||
|
||||||
this.$store.getters.getMainUser.id) ||
|
|
||||||
this.$store.getters.getMainUser === null
|
this.$store.getters.getMainUser === null
|
||||||
) {
|
) {
|
||||||
if (!window.confirm(this.$t("will_change_main_user_for_me"))) {
|
if (!window.confirm(this.$t("will_change_main_user_for_me"))) {
|
||||||
@@ -359,9 +334,7 @@ export default {
|
|||||||
this.$store.getters.getMainUser.id
|
this.$store.getters.getMainUser.id
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
!window.confirm(
|
!window.confirm(this.$t("this_calendar_range_will_change_main_user"))
|
||||||
this.$t("this_calendar_range_will_change_main_user"),
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -4,18 +4,9 @@
|
|||||||
{{ user.text }}
|
{{ user.text }}
|
||||||
<template v-if="invite !== null">
|
<template v-if="invite !== null">
|
||||||
<i v-if="invite.status === 'accepted'" class="fa fa-check" />
|
<i v-if="invite.status === 'accepted'" class="fa fa-check" />
|
||||||
<i
|
<i v-else-if="invite.status === 'declined'" class="fa fa-times" />
|
||||||
v-else-if="invite.status === 'declined'"
|
<i v-else-if="invite.status === 'pending'" class="fa fa-question-o" />
|
||||||
class="fa fa-times"
|
<i v-else-if="invite.status === 'tentative'" class="fa fa-question" />
|
||||||
/>
|
|
||||||
<i
|
|
||||||
v-else-if="invite.status === 'pending'"
|
|
||||||
class="fa fa-question-o"
|
|
||||||
/>
|
|
||||||
<i
|
|
||||||
v-else-if="invite.status === 'tentative'"
|
|
||||||
class="fa fa-question"
|
|
||||||
/>
|
|
||||||
<span v-else="">{{ invite.status }}</span>
|
<span v-else="">{{ invite.status }}</span>
|
||||||
</template>
|
</template>
|
||||||
</span>
|
</span>
|
||||||
@@ -69,8 +60,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
style() {
|
style() {
|
||||||
return {
|
return {
|
||||||
backgroundColor: this.$store.getters.getUserData(this.user)
|
backgroundColor: this.$store.getters.getUserData(this.user).mainColor,
|
||||||
.mainColor,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
rangeShow: {
|
rangeShow: {
|
||||||
@@ -81,9 +71,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
get() {
|
get() {
|
||||||
return this.$store.getters.isRangeShownOnCalendarForUser(
|
return this.$store.getters.isRangeShownOnCalendarForUser(this.user);
|
||||||
this.user,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
remoteShow: {
|
remoteShow: {
|
||||||
@@ -94,9 +82,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
get() {
|
get() {
|
||||||
return this.$store.getters.isRemoteShownOnCalendarForUser(
|
return this.$store.getters.isRemoteShownOnCalendarForUser(this.user);
|
||||||
this.user,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -22,33 +22,25 @@
|
|||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu" aria-labelledby="btnGroupDrop1">
|
<ul class="dropdown-menu" aria-labelledby="btnGroupDrop1">
|
||||||
<li v-if="status !== Statuses.ACCEPTED">
|
<li v-if="status !== Statuses.ACCEPTED">
|
||||||
<a
|
<a class="dropdown-item" @click="changeStatus(Statuses.ACCEPTED)"
|
||||||
class="dropdown-item"
|
><i class="fa fa-check" aria-hidden="true"></i> {{ $t("Accept") }}</a
|
||||||
@click="changeStatus(Statuses.ACCEPTED)"
|
|
||||||
><i class="fa fa-check" aria-hidden="true"></i>
|
|
||||||
{{ $t("Accept") }}</a
|
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="status !== Statuses.DECLINED">
|
<li v-if="status !== Statuses.DECLINED">
|
||||||
<a
|
<a class="dropdown-item" @click="changeStatus(Statuses.DECLINED)"
|
||||||
class="dropdown-item"
|
><i class="fa fa-times" aria-hidden="true"></i> {{ $t("Decline") }}</a
|
||||||
@click="changeStatus(Statuses.DECLINED)"
|
|
||||||
><i class="fa fa-times" aria-hidden="true"></i>
|
|
||||||
{{ $t("Decline") }}</a
|
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="status !== Statuses.TENTATIVELY_ACCEPTED">
|
<li v-if="status !== Statuses.TENTATIVELY_ACCEPTED">
|
||||||
<a
|
<a
|
||||||
class="dropdown-item"
|
class="dropdown-item"
|
||||||
@click="changeStatus(Statuses.TENTATIVELY_ACCEPTED)"
|
@click="changeStatus(Statuses.TENTATIVELY_ACCEPTED)"
|
||||||
><i class="fa fa-question"></i>
|
><i class="fa fa-question"></i> {{ $t("Tentatively_accept") }}</a
|
||||||
{{ $t("Tentatively_accept") }}</a
|
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="status !== Statuses.PENDING">
|
<li v-if="status !== Statuses.PENDING">
|
||||||
<a class="dropdown-item" @click="changeStatus(Statuses.PENDING)"
|
<a class="dropdown-item" @click="changeStatus(Statuses.PENDING)"
|
||||||
><i class="fa fa-hourglass-o"></i>
|
><i class="fa fa-hourglass-o"></i> {{ $t("Set_pending") }}</a
|
||||||
{{ $t("Set_pending") }}</a
|
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -91,9 +83,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
emits: {
|
emits: {
|
||||||
statusChanged(
|
statusChanged(payload: "accepted" | "declined" | "pending" | "tentative") {
|
||||||
payload: "accepted" | "declined" | "pending" | "tentative",
|
|
||||||
) {
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -23,22 +23,14 @@
|
|||||||
<label class="input-group-text" for="slotDuration"
|
<label class="input-group-text" for="slotDuration"
|
||||||
>Durée des créneaux</label
|
>Durée des créneaux</label
|
||||||
>
|
>
|
||||||
<select
|
<select v-model="slotDuration" id="slotDuration" class="form-select">
|
||||||
v-model="slotDuration"
|
|
||||||
id="slotDuration"
|
|
||||||
class="form-select"
|
|
||||||
>
|
|
||||||
<option value="00:05:00">5 minutes</option>
|
<option value="00:05:00">5 minutes</option>
|
||||||
<option value="00:10:00">10 minutes</option>
|
<option value="00:10:00">10 minutes</option>
|
||||||
<option value="00:15:00">15 minutes</option>
|
<option value="00:15:00">15 minutes</option>
|
||||||
<option value="00:30:00">30 minutes</option>
|
<option value="00:30:00">30 minutes</option>
|
||||||
</select>
|
</select>
|
||||||
<label class="input-group-text" for="slotMinTime">De</label>
|
<label class="input-group-text" for="slotMinTime">De</label>
|
||||||
<select
|
<select v-model="slotMinTime" id="slotMinTime" class="form-select">
|
||||||
v-model="slotMinTime"
|
|
||||||
id="slotMinTime"
|
|
||||||
class="form-select"
|
|
||||||
>
|
|
||||||
<option value="00:00:00">0h</option>
|
<option value="00:00:00">0h</option>
|
||||||
<option value="01:00:00">1h</option>
|
<option value="01:00:00">1h</option>
|
||||||
<option value="02:00:00">2h</option>
|
<option value="02:00:00">2h</option>
|
||||||
@@ -54,11 +46,7 @@
|
|||||||
<option value="12:00:00">12h</option>
|
<option value="12:00:00">12h</option>
|
||||||
</select>
|
</select>
|
||||||
<label class="input-group-text" for="slotMaxTime">À</label>
|
<label class="input-group-text" for="slotMaxTime">À</label>
|
||||||
<select
|
<select v-model="slotMaxTime" id="slotMaxTime" class="form-select">
|
||||||
v-model="slotMaxTime"
|
|
||||||
id="slotMaxTime"
|
|
||||||
class="form-select"
|
|
||||||
>
|
|
||||||
<option value="12:00:00">12h</option>
|
<option value="12:00:00">12h</option>
|
||||||
<option value="13:00:00">13h</option>
|
<option value="13:00:00">13h</option>
|
||||||
<option value="14:00:00">14h</option>
|
<option value="14:00:00">14h</option>
|
||||||
@@ -86,9 +74,7 @@
|
|||||||
v-model="showWeekends"
|
v-model="showWeekends"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<label
|
<label for="showHideWE" class="form-check-label input-group-text"
|
||||||
for="showHideWE"
|
|
||||||
class="form-check-label input-group-text"
|
|
||||||
>Week-ends</label
|
>Week-ends</label
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@@ -98,16 +84,12 @@
|
|||||||
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
||||||
<template v-slot:eventContent="{ event }: { event: EventApi }">
|
<template v-slot:eventContent="{ event }: { event: EventApi }">
|
||||||
<span :class="eventClasses">
|
<span :class="eventClasses">
|
||||||
<b v-if="event.extendedProps.is === 'remote'">{{
|
<b v-if="event.extendedProps.is === 'remote'">{{ event.title }}</b>
|
||||||
event.title
|
|
||||||
}}</b>
|
|
||||||
<b v-else-if="event.extendedProps.is === 'range'"
|
<b v-else-if="event.extendedProps.is === 'range'"
|
||||||
>{{ formatDate(event.startStr) }} -
|
>{{ formatDate(event.startStr) }} -
|
||||||
{{ event.extendedProps.locationName }}</b
|
{{ event.extendedProps.locationName }}</b
|
||||||
>
|
>
|
||||||
<b v-else-if="event.extendedProps.is === 'local'">{{
|
<b v-else-if="event.extendedProps.is === 'local'">{{ event.title }}</b>
|
||||||
event.title
|
|
||||||
}}</b>
|
|
||||||
<b v-else>no 'is'</b>
|
<b v-else>no 'is'</b>
|
||||||
<a
|
<a
|
||||||
v-if="event.extendedProps.is === 'range'"
|
v-if="event.extendedProps.is === 'range'"
|
||||||
@@ -126,11 +108,7 @@
|
|||||||
<h6 class="chill-red">{{ $t("copy_range_from_to") }}</h6>
|
<h6 class="chill-red">{{ $t("copy_range_from_to") }}</h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-9 col-md-2">
|
<div class="col-xs-12 col-sm-9 col-md-2">
|
||||||
<select
|
<select v-model="dayOrWeek" id="dayOrWeek" class="form-select">
|
||||||
v-model="dayOrWeek"
|
|
||||||
id="dayOrWeek"
|
|
||||||
class="form-select"
|
|
||||||
>
|
|
||||||
<option value="day">{{ $t("from_day_to_day") }}</option>
|
<option value="day">{{ $t("from_day_to_day") }}</option>
|
||||||
<option value="week">
|
<option value="week">
|
||||||
{{ $t("from_week_to_week") }}
|
{{ $t("from_week_to_week") }}
|
||||||
@@ -139,27 +117,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<template v-if="dayOrWeek === 'day'">
|
<template v-if="dayOrWeek === 'day'">
|
||||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||||
<input
|
<input class="form-control" type="date" v-model="copyFrom" />
|
||||||
class="form-control"
|
|
||||||
type="date"
|
|
||||||
v-model="copyFrom"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-1 col-md-1 copy-chevron">
|
<div class="col-xs-12 col-sm-1 col-md-1 copy-chevron">
|
||||||
<i class="fa fa-angle-double-right"></i>
|
<i class="fa fa-angle-double-right"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||||
<input
|
<input class="form-control" type="date" v-model="copyTo" />
|
||||||
class="form-control"
|
|
||||||
type="date"
|
|
||||||
v-model="copyTo"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-5 col-md-1">
|
<div class="col-xs-12 col-sm-5 col-md-1">
|
||||||
<button
|
<button class="btn btn-action float-end" @click="copyDay">
|
||||||
class="btn btn-action float-end"
|
|
||||||
@click="copyDay"
|
|
||||||
>
|
|
||||||
{{ $t("copy_range") }}
|
{{ $t("copy_range") }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -171,11 +138,7 @@
|
|||||||
id="copyFromWeek"
|
id="copyFromWeek"
|
||||||
class="form-select"
|
class="form-select"
|
||||||
>
|
>
|
||||||
<option
|
<option v-for="w in lastWeeks" :value="w.value" :key="w.value">
|
||||||
v-for="w in lastWeeks"
|
|
||||||
:value="w.value"
|
|
||||||
:key="w.value"
|
|
||||||
>
|
|
||||||
{{ w.text }}
|
{{ w.text }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -184,25 +147,14 @@
|
|||||||
<i class="fa fa-angle-double-right"></i>
|
<i class="fa fa-angle-double-right"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||||
<select
|
<select v-model="copyToWeek" id="copyToWeek" class="form-select">
|
||||||
v-model="copyToWeek"
|
<option v-for="w in nextWeeks" :value="w.value" :key="w.value">
|
||||||
id="copyToWeek"
|
|
||||||
class="form-select"
|
|
||||||
>
|
|
||||||
<option
|
|
||||||
v-for="w in nextWeeks"
|
|
||||||
:value="w.value"
|
|
||||||
:key="w.value"
|
|
||||||
>
|
|
||||||
{{ w.text }}
|
{{ w.text }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-5 col-md-1">
|
<div class="col-xs-12 col-sm-5 col-md-1">
|
||||||
<button
|
<button class="btn btn-action float-end" @click="copyWeek">
|
||||||
class="btn btn-action float-end"
|
|
||||||
@click="copyWeek"
|
|
||||||
>
|
|
||||||
{{ $t("copy_range") }}
|
{{ $t("copy_range") }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -41,9 +41,7 @@ const futureStore = function (): Promise<Store<State>> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
store.commit("me/setWhoAmi", user, { root: true });
|
store.commit("me/setWhoAmi", user, { root: true });
|
||||||
store
|
store.dispatch("locations/getLocations", null, { root: true }).then((_) => {
|
||||||
.dispatch("locations/getLocations", null, { root: true })
|
|
||||||
.then((_) => {
|
|
||||||
return store.dispatch("locations/getCurrentLocation", null, {
|
return store.dispatch("locations/getCurrentLocation", null, {
|
||||||
root: true,
|
root: true,
|
||||||
});
|
});
|
||||||
|
@@ -29,10 +29,7 @@ export default {
|
|||||||
(state: CalendarLocalsState) =>
|
(state: CalendarLocalsState) =>
|
||||||
({ start, end }: { start: Date; end: Date }): boolean => {
|
({ start, end }: { start: Date; end: Date }): boolean => {
|
||||||
for (const range of state.localsLoaded) {
|
for (const range of state.localsLoaded) {
|
||||||
if (
|
if (start.getTime() === range.start && end.getTime() === range.end) {
|
||||||
start.getTime() === range.start &&
|
|
||||||
end.getTime() === range.end
|
|
||||||
) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,10 +51,7 @@ export default {
|
|||||||
});
|
});
|
||||||
state.key = state.key + toAdd.length;
|
state.key = state.key + toAdd.length;
|
||||||
},
|
},
|
||||||
addLoaded(
|
addLoaded(state: CalendarLocalsState, payload: { start: Date; end: Date }) {
|
||||||
state: CalendarLocalsState,
|
|
||||||
payload: { start: Date; end: Date },
|
|
||||||
) {
|
|
||||||
state.localsLoaded.push({
|
state.localsLoaded.push({
|
||||||
start: payload.start.getTime(),
|
start: payload.start.getTime(),
|
||||||
end: payload.end.getTime(),
|
end: payload.end.getTime(),
|
||||||
@@ -85,11 +79,7 @@ export default {
|
|||||||
end: end,
|
end: end,
|
||||||
});
|
});
|
||||||
|
|
||||||
return fetchCalendarLocalForUser(
|
return fetchCalendarLocalForUser(ctx.rootGetters["me/getMe"], start, end)
|
||||||
ctx.rootGetters["me/getMe"],
|
|
||||||
start,
|
|
||||||
end,
|
|
||||||
)
|
|
||||||
.then((remotes: CalendarLight[]) => {
|
.then((remotes: CalendarLight[]) => {
|
||||||
// to be add when reactivity problem will be solve ?
|
// to be add when reactivity problem will be solve ?
|
||||||
//ctx.commit('addRemotes', remotes);
|
//ctx.commit('addRemotes', remotes);
|
||||||
|
@@ -40,10 +40,7 @@ export default {
|
|||||||
(state: CalendarRangesState) =>
|
(state: CalendarRangesState) =>
|
||||||
({ start, end }: { start: Date; end: Date }): boolean => {
|
({ start, end }: { start: Date; end: Date }): boolean => {
|
||||||
for (const range of state.rangesLoaded) {
|
for (const range of state.rangesLoaded) {
|
||||||
if (
|
if (start.getTime() === range.start && end.getTime() === range.end) {
|
||||||
start.getTime() === range.start &&
|
|
||||||
end.getTime() === range.end
|
|
||||||
) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -110,9 +107,7 @@ export default {
|
|||||||
state: CalendarRangesState,
|
state: CalendarRangesState,
|
||||||
externalEvents: (EventInput & { id: string })[],
|
externalEvents: (EventInput & { id: string })[],
|
||||||
) {
|
) {
|
||||||
const toAdd = externalEvents.filter(
|
const toAdd = externalEvents.filter((r) => !state.rangesIndex.has(r.id));
|
||||||
(r) => !state.rangesIndex.has(r.id),
|
|
||||||
);
|
|
||||||
|
|
||||||
toAdd.forEach((r) => {
|
toAdd.forEach((r) => {
|
||||||
state.rangesIndex.add(r.id);
|
state.rangesIndex.add(r.id);
|
||||||
@@ -120,10 +115,7 @@ export default {
|
|||||||
});
|
});
|
||||||
state.key = state.key + toAdd.length;
|
state.key = state.key + toAdd.length;
|
||||||
},
|
},
|
||||||
addLoaded(
|
addLoaded(state: CalendarRangesState, payload: { start: Date; end: Date }) {
|
||||||
state: CalendarRangesState,
|
|
||||||
payload: { start: Date; end: Date },
|
|
||||||
) {
|
|
||||||
state.rangesLoaded.push({
|
state.rangesLoaded.push({
|
||||||
start: payload.start.getTime(),
|
start: payload.start.getTime(),
|
||||||
end: payload.end.getTime(),
|
end: payload.end.getTime(),
|
||||||
@@ -142,17 +134,12 @@ export default {
|
|||||||
},
|
},
|
||||||
removeRange(state: CalendarRangesState, calendarRangeId: number) {
|
removeRange(state: CalendarRangesState, calendarRangeId: number) {
|
||||||
const found = state.ranges.find(
|
const found = state.ranges.find(
|
||||||
(r) =>
|
(r) => r.calendarRangeId === calendarRangeId && r.is === "range",
|
||||||
r.calendarRangeId === calendarRangeId && r.is === "range",
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (found !== undefined) {
|
if (found !== undefined) {
|
||||||
state.ranges = state.ranges.filter(
|
state.ranges = state.ranges.filter(
|
||||||
(r) =>
|
(r) => !(r.calendarRangeId === calendarRangeId && r.is === "range"),
|
||||||
!(
|
|
||||||
r.calendarRangeId === calendarRangeId &&
|
|
||||||
r.is === "range"
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (typeof found.id === "string") {
|
if (typeof found.id === "string") {
|
||||||
@@ -211,11 +198,7 @@ export default {
|
|||||||
},
|
},
|
||||||
createRange(
|
createRange(
|
||||||
ctx: Context,
|
ctx: Context,
|
||||||
{
|
{ start, end, location }: { start: Date; end: Date; location: Location },
|
||||||
start,
|
|
||||||
end,
|
|
||||||
location,
|
|
||||||
}: { start: Date; end: Date; location: Location },
|
|
||||||
): Promise<null> {
|
): Promise<null> {
|
||||||
const url = `/api/1.0/calendar/calendar-range.json?`;
|
const url = `/api/1.0/calendar/calendar-range.json?`;
|
||||||
|
|
||||||
@@ -240,11 +223,7 @@ export default {
|
|||||||
},
|
},
|
||||||
} as CalendarRangeCreate;
|
} as CalendarRangeCreate;
|
||||||
|
|
||||||
return makeFetch<CalendarRangeCreate, CalendarRange>(
|
return makeFetch<CalendarRangeCreate, CalendarRange>("POST", url, body)
|
||||||
"POST",
|
|
||||||
url,
|
|
||||||
body,
|
|
||||||
)
|
|
||||||
.then((newRange) => {
|
.then((newRange) => {
|
||||||
ctx.commit("addRange", newRange);
|
ctx.commit("addRange", newRange);
|
||||||
|
|
||||||
@@ -281,11 +260,7 @@ export default {
|
|||||||
},
|
},
|
||||||
} as CalendarRangeEdit;
|
} as CalendarRangeEdit;
|
||||||
|
|
||||||
return makeFetch<CalendarRangeEdit, CalendarRange>(
|
return makeFetch<CalendarRangeEdit, CalendarRange>("PATCH", url, body)
|
||||||
"PATCH",
|
|
||||||
url,
|
|
||||||
body,
|
|
||||||
)
|
|
||||||
.then((range) => {
|
.then((range) => {
|
||||||
ctx.commit("updateRange", range);
|
ctx.commit("updateRange", range);
|
||||||
return Promise.resolve(null);
|
return Promise.resolve(null);
|
||||||
@@ -310,11 +285,7 @@ export default {
|
|||||||
},
|
},
|
||||||
} as CalendarRangeEdit;
|
} as CalendarRangeEdit;
|
||||||
|
|
||||||
return makeFetch<CalendarRangeEdit, CalendarRange>(
|
return makeFetch<CalendarRangeEdit, CalendarRange>("PATCH", url, body)
|
||||||
"PATCH",
|
|
||||||
url,
|
|
||||||
body,
|
|
||||||
)
|
|
||||||
.then((range) => {
|
.then((range) => {
|
||||||
ctx.commit("updateRange", range);
|
ctx.commit("updateRange", range);
|
||||||
return Promise.resolve(null);
|
return Promise.resolve(null);
|
||||||
@@ -334,20 +305,14 @@ export default {
|
|||||||
|
|
||||||
for (const r of rangesToCopy) {
|
for (const r of rangesToCopy) {
|
||||||
const start = new Date(ISOToDatetime(r.start) as Date);
|
const start = new Date(ISOToDatetime(r.start) as Date);
|
||||||
start.setFullYear(
|
start.setFullYear(to.getFullYear(), to.getMonth(), to.getDate());
|
||||||
to.getFullYear(),
|
|
||||||
to.getMonth(),
|
|
||||||
to.getDate(),
|
|
||||||
);
|
|
||||||
const end = new Date(ISOToDatetime(r.end) as Date);
|
const end = new Date(ISOToDatetime(r.end) as Date);
|
||||||
end.setFullYear(to.getFullYear(), to.getMonth(), to.getDate());
|
end.setFullYear(to.getFullYear(), to.getMonth(), to.getDate());
|
||||||
const location = ctx.rootGetters["locations/getLocationById"](
|
const location = ctx.rootGetters["locations/getLocationById"](
|
||||||
r.locationId,
|
r.locationId,
|
||||||
);
|
);
|
||||||
|
|
||||||
promises.push(
|
promises.push(ctx.dispatch("createRange", { start, end, location }));
|
||||||
ctx.dispatch("createRange", { start, end, location }),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.all(promises).then(() => Promise.resolve(null));
|
return Promise.all(promises).then(() => Promise.resolve(null));
|
||||||
@@ -369,9 +334,7 @@ export default {
|
|||||||
r.locationId,
|
r.locationId,
|
||||||
);
|
);
|
||||||
|
|
||||||
promises.push(
|
promises.push(ctx.dispatch("createRange", { start, end, location }));
|
||||||
ctx.dispatch("createRange", { start, end, location }),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.all(promises).then(() => Promise.resolve(null));
|
return Promise.all(promises).then(() => Promise.resolve(null));
|
||||||
|
@@ -29,10 +29,7 @@ export default {
|
|||||||
(state: CalendarRemotesState) =>
|
(state: CalendarRemotesState) =>
|
||||||
({ start, end }: { start: Date; end: Date }): boolean => {
|
({ start, end }: { start: Date; end: Date }): boolean => {
|
||||||
for (const range of state.remotesLoaded) {
|
for (const range of state.remotesLoaded) {
|
||||||
if (
|
if (start.getTime() === range.start && end.getTime() === range.end) {
|
||||||
start.getTime() === range.start &&
|
|
||||||
end.getTime() === range.end
|
|
||||||
) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,11 +82,7 @@ export default {
|
|||||||
end: end,
|
end: end,
|
||||||
});
|
});
|
||||||
|
|
||||||
return fetchCalendarRemoteForUser(
|
return fetchCalendarRemoteForUser(ctx.rootGetters["me/getMe"], start, end)
|
||||||
ctx.rootGetters["me/getMe"],
|
|
||||||
start,
|
|
||||||
end,
|
|
||||||
)
|
|
||||||
.then((remotes: CalendarRemote[]) => {
|
.then((remotes: CalendarRemote[]) => {
|
||||||
// to be add when reactivity problem will be solve ?
|
// to be add when reactivity problem will be solve ?
|
||||||
//ctx.commit('addRemotes', remotes);
|
//ctx.commit('addRemotes', remotes);
|
||||||
|
@@ -112,11 +112,8 @@ export default {
|
|||||||
|
|
||||||
results.forEach((i) => {
|
results.forEach((i) => {
|
||||||
if (!users.some((j) => i.user.id === j.id)) {
|
if (!users.some((j) => i.user.id === j.id)) {
|
||||||
let ratio = Math.floor(
|
let ratio = Math.floor(users.length / COLORS.length);
|
||||||
users.length / COLORS.length,
|
let colorIndex = users.length - ratio * COLORS.length;
|
||||||
);
|
|
||||||
let colorIndex =
|
|
||||||
users.length - ratio * COLORS.length;
|
|
||||||
users.push({
|
users.push({
|
||||||
id: i.user.id,
|
id: i.user.id,
|
||||||
username: i.user.username,
|
username: i.user.username,
|
||||||
@@ -153,45 +150,29 @@ export default {
|
|||||||
(me) =>
|
(me) =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
this.users.logged = me;
|
this.users.logged = me;
|
||||||
let currentUser = users.find(
|
let currentUser = users.find((u) => u.id === me.id);
|
||||||
(u) => u.id === me.id,
|
|
||||||
);
|
|
||||||
this.value = currentUser;
|
this.value = currentUser;
|
||||||
|
|
||||||
fetchCalendar(currentUser.id).then(
|
fetchCalendar(currentUser.id).then(
|
||||||
(calendar) =>
|
(calendar) =>
|
||||||
new Promise(
|
new Promise((resolve, reject) => {
|
||||||
(resolve, reject) => {
|
let results = calendar.results;
|
||||||
let results =
|
let events = results.map((i) => ({
|
||||||
calendar.results;
|
start: i.startDate.datetime,
|
||||||
let events =
|
end: i.endDate.datetime,
|
||||||
results.map(
|
}));
|
||||||
(i) => ({
|
let calendarEventsCurrentUser = {
|
||||||
start: i
|
|
||||||
.startDate
|
|
||||||
.datetime,
|
|
||||||
end: i
|
|
||||||
.endDate
|
|
||||||
.datetime,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
let calendarEventsCurrentUser =
|
|
||||||
{
|
|
||||||
events: events,
|
events: events,
|
||||||
color: "darkblue",
|
color: "darkblue",
|
||||||
id: 1000,
|
id: 1000,
|
||||||
editable: false,
|
editable: false,
|
||||||
};
|
};
|
||||||
this.calendarEvents.user =
|
this.calendarEvents.user = calendarEventsCurrentUser;
|
||||||
calendarEventsCurrentUser;
|
|
||||||
|
|
||||||
this.selectUsers(
|
this.selectUsers(currentUser);
|
||||||
currentUser,
|
|
||||||
);
|
|
||||||
|
|
||||||
resolve();
|
resolve();
|
||||||
},
|
}),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
resolve();
|
resolve();
|
||||||
@@ -209,9 +190,7 @@ export default {
|
|||||||
return `${value.username}`;
|
return `${value.username}`;
|
||||||
},
|
},
|
||||||
coloriseSelectedValues() {
|
coloriseSelectedValues() {
|
||||||
let tags = document.querySelectorAll(
|
let tags = document.querySelectorAll("div.multiselect__tags-wrap")[0];
|
||||||
"div.multiselect__tags-wrap",
|
|
||||||
)[0];
|
|
||||||
|
|
||||||
if (tags.hasChildNodes()) {
|
if (tags.hasChildNodes()) {
|
||||||
let children = tags.childNodes;
|
let children = tags.childNodes;
|
||||||
@@ -232,8 +211,8 @@ export default {
|
|||||||
},
|
},
|
||||||
selectEvents() {
|
selectEvents() {
|
||||||
let selectedUsersId = this.users.selected.map((a) => a.id);
|
let selectedUsersId = this.users.selected.map((a) => a.id);
|
||||||
this.calendarEvents.selected = this.calendarEvents.loaded.filter(
|
this.calendarEvents.selected = this.calendarEvents.loaded.filter((a) =>
|
||||||
(a) => selectedUsersId.includes(a.id),
|
selectedUsersId.includes(a.id),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
selectUsers(value) {
|
selectUsers(value) {
|
||||||
@@ -243,9 +222,7 @@ export default {
|
|||||||
this.updateEventsSource();
|
this.updateEventsSource();
|
||||||
},
|
},
|
||||||
unSelectUsers(value) {
|
unSelectUsers(value) {
|
||||||
this.users.selected = this.users.selected.filter(
|
this.users.selected = this.users.selected.filter((a) => a.id != value.id);
|
||||||
(a) => a.id != value.id,
|
|
||||||
);
|
|
||||||
this.selectEvents();
|
this.selectEvents();
|
||||||
this.updateEventsSource();
|
this.updateEventsSource();
|
||||||
},
|
},
|
||||||
|
@@ -20,10 +20,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<template v-for="t in templates" :key="t.id">
|
<template v-for="t in templates" :key="t.id">
|
||||||
<option :value="t.id">
|
<option :value="t.id">
|
||||||
{{
|
{{ localizeString(t.name) || "Aucun nom défini" }}
|
||||||
localizeString(t.name) ||
|
|
||||||
"Aucun nom défini"
|
|
||||||
}}
|
|
||||||
</option>
|
</option>
|
||||||
</template>
|
</template>
|
||||||
</select>
|
</select>
|
||||||
@@ -31,9 +28,7 @@
|
|||||||
v-if="canGenerate"
|
v-if="canGenerate"
|
||||||
class="btn btn-update btn-sm change-icon"
|
class="btn btn-update btn-sm change-icon"
|
||||||
:href="buildUrlGenerate"
|
:href="buildUrlGenerate"
|
||||||
@click.prevent="
|
@click.prevent="clickGenerate($event, buildUrlGenerate)"
|
||||||
clickGenerate($event, buildUrlGenerate)
|
|
||||||
"
|
|
||||||
><i class="fa fa-fw fa-cog"
|
><i class="fa fa-fw fa-cog"
|
||||||
/></a>
|
/></a>
|
||||||
<a
|
<a
|
||||||
|
@@ -18,6 +18,7 @@ use Chill\DocStoreBundle\Exception\StoredObjectManagerException;
|
|||||||
use Chill\DocStoreBundle\Service\Cryptography\KeyGenerator;
|
use Chill\DocStoreBundle\Service\Cryptography\KeyGenerator;
|
||||||
use Chill\DocStoreBundle\Service\StoredObjectManagerInterface;
|
use Chill\DocStoreBundle\Service\StoredObjectManagerInterface;
|
||||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||||
|
use Symfony\Component\Filesystem\Exception\IOExceptionInterface;
|
||||||
use Symfony\Component\Filesystem\Filesystem;
|
use Symfony\Component\Filesystem\Filesystem;
|
||||||
use Symfony\Component\Filesystem\Path;
|
use Symfony\Component\Filesystem\Path;
|
||||||
|
|
||||||
@@ -147,16 +148,11 @@ class StoredObjectManager implements StoredObjectManagerInterface
|
|||||||
public function writeContent(string $filename, string $encryptedContent): void
|
public function writeContent(string $filename, string $encryptedContent): void
|
||||||
{
|
{
|
||||||
$fullPath = $this->buildPath($filename);
|
$fullPath = $this->buildPath($filename);
|
||||||
$dir = Path::getDirectory($fullPath);
|
|
||||||
|
|
||||||
if (!$this->filesystem->exists($dir)) {
|
try {
|
||||||
$this->filesystem->mkdir($dir);
|
$this->filesystem->dumpFile($fullPath, $encryptedContent);
|
||||||
}
|
} catch (IOExceptionInterface $exception) {
|
||||||
|
throw StoredObjectManagerException::unableToStoreDocumentOnDisk($exception);
|
||||||
$result = file_put_contents($fullPath, $encryptedContent);
|
|
||||||
|
|
||||||
if (false === $result) {
|
|
||||||
throw StoredObjectManagerException::unableToStoreDocumentOnDisk();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -94,7 +94,7 @@ class StoredObject implements Document, TrackCreationInterface
|
|||||||
/**
|
/**
|
||||||
* @var Collection<int, StoredObjectVersion>&Selectable<int, StoredObjectVersion>
|
* @var Collection<int, StoredObjectVersion>&Selectable<int, StoredObjectVersion>
|
||||||
*/
|
*/
|
||||||
#[ORM\OneToMany(mappedBy: 'storedObject', targetEntity: StoredObjectVersion::class, cascade: ['persist'], orphanRemoval: true)]
|
#[ORM\OneToMany(mappedBy: 'storedObject', targetEntity: StoredObjectVersion::class, cascade: ['persist'], orphanRemoval: true, fetch: 'EAGER')]
|
||||||
private Collection&Selectable $versions;
|
private Collection&Selectable $versions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -13,8 +13,9 @@ const startApp = (
|
|||||||
|
|
||||||
const inputTitle = collectionEntry?.querySelector("input[type='text']");
|
const inputTitle = collectionEntry?.querySelector("input[type='text']");
|
||||||
|
|
||||||
const input_stored_object: HTMLInputElement | null =
|
const input_stored_object: HTMLInputElement | null = divElement.querySelector(
|
||||||
divElement.querySelector("input[data-stored-object]");
|
"input[data-stored-object]",
|
||||||
|
);
|
||||||
if (null === input_stored_object) {
|
if (null === input_stored_object) {
|
||||||
throw new Error("input to stored object not found");
|
throw new Error("input to stored object not found");
|
||||||
}
|
}
|
||||||
@@ -53,9 +54,7 @@ const startApp = (
|
|||||||
console.log("version added", stored_object_version);
|
console.log("version added", stored_object_version);
|
||||||
this.$data.existingDoc = stored_object;
|
this.$data.existingDoc = stored_object;
|
||||||
this.$data.existingDoc.currentVersion = stored_object_version;
|
this.$data.existingDoc.currentVersion = stored_object_version;
|
||||||
input_stored_object.value = JSON.stringify(
|
input_stored_object.value = JSON.stringify(this.$data.existingDoc);
|
||||||
this.$data.existingDoc,
|
|
||||||
);
|
|
||||||
if (this.$data.inputTitle) {
|
if (this.$data.inputTitle) {
|
||||||
if (!this.$data.inputTitle?.value) {
|
if (!this.$data.inputTitle?.value) {
|
||||||
this.$data.inputTitle.value = file_name;
|
this.$data.inputTitle.value = file_name;
|
||||||
|
@@ -49,9 +49,7 @@
|
|||||||
<li v-if="isHistoryViewable">
|
<li v-if="isHistoryViewable">
|
||||||
<history-button
|
<history-button
|
||||||
:stored-object="props.storedObject"
|
:stored-object="props.storedObject"
|
||||||
:can-edit="
|
:can-edit="canEdit && props.storedObject._permissions.canEdit"
|
||||||
canEdit && props.storedObject._permissions.canEdit
|
|
||||||
"
|
|
||||||
></history-button>
|
></history-button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -129,9 +127,7 @@ const props = withDefaults(defineProps<DocumentActionButtonsGroupConfig>(), {
|
|||||||
canDownload: true,
|
canDownload: true,
|
||||||
canConvertPdf: true,
|
canConvertPdf: true,
|
||||||
returnPath:
|
returnPath:
|
||||||
window.location.pathname +
|
window.location.pathname + window.location.search + window.location.hash,
|
||||||
window.location.search +
|
|
||||||
window.location.hash,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -29,9 +29,7 @@
|
|||||||
</modal>
|
</modal>
|
||||||
</teleport>
|
</teleport>
|
||||||
<div class="col-12 m-auto sticky-top">
|
<div class="col-12 m-auto sticky-top">
|
||||||
<div
|
<div class="row justify-content-center border-bottom pdf-tools d-md-none">
|
||||||
class="row justify-content-center border-bottom pdf-tools d-md-none"
|
|
||||||
>
|
|
||||||
<div class="col-5 text-center turn-page">
|
<div class="col-5 text-center turn-page">
|
||||||
<select
|
<select
|
||||||
class="form-select form-select-sm"
|
class="form-select form-select-sm"
|
||||||
@@ -92,10 +90,7 @@
|
|||||||
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
||||||
class="col-5 p-0 text-center turnSignature"
|
class="col-5 p-0 text-center turnSignature"
|
||||||
>
|
>
|
||||||
<button
|
<button class="btn btn-light btn-sm" @click="goToSignatureZoneUnique">
|
||||||
class="btn btn-light btn-sm"
|
|
||||||
@click="goToSignatureZoneUnique"
|
|
||||||
>
|
|
||||||
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -150,10 +145,7 @@
|
|||||||
:title="trans(SIGNATURES_ADD_SIGN_ZONE)"
|
:title="trans(SIGNATURES_ADD_SIGN_ZONE)"
|
||||||
>
|
>
|
||||||
<template v-if="canvasEvent === 'add'">
|
<template v-if="canvasEvent === 'add'">
|
||||||
<div
|
<div class="spinner-border spinner-border-sm" role="status">
|
||||||
class="spinner-border spinner-border-sm"
|
|
||||||
role="status"
|
|
||||||
>
|
|
||||||
<span class="visually-hidden">Loading...</span>
|
<span class="visually-hidden">Loading...</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -207,10 +199,7 @@
|
|||||||
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
||||||
class="col-4 d-xl-none text-center turnSignature p-0"
|
class="col-4 d-xl-none text-center turnSignature p-0"
|
||||||
>
|
>
|
||||||
<button
|
<button class="btn btn-light btn-sm" @click="goToSignatureZoneUnique">
|
||||||
class="btn btn-light btn-sm"
|
|
||||||
@click="goToSignatureZoneUnique"
|
|
||||||
>
|
|
||||||
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -238,10 +227,7 @@
|
|||||||
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
||||||
class="col-4 d-none d-xl-flex p-0 text-center turnSignature"
|
class="col-4 d-none d-xl-flex p-0 text-center turnSignature"
|
||||||
>
|
>
|
||||||
<button
|
<button class="btn btn-light btn-sm" @click="goToSignatureZoneUnique">
|
||||||
class="btn btn-light btn-sm"
|
|
||||||
@click="goToSignatureZoneUnique"
|
|
||||||
>
|
|
||||||
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -299,10 +285,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
{{ trans(SIGNATURES_CLICK_ON_DOCUMENT) }}
|
{{ trans(SIGNATURES_CLICK_ON_DOCUMENT) }}
|
||||||
<div
|
<div class="spinner-border spinner-border-sm" role="status">
|
||||||
class="spinner-border spinner-border-sm"
|
|
||||||
role="status"
|
|
||||||
>
|
|
||||||
<span class="visually-hidden">Loading...</span>
|
<span class="visually-hidden">Loading...</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -562,14 +545,8 @@ const addCanvasEvents = () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const canvas = document.querySelectorAll(
|
const canvas = document.querySelectorAll("canvas")[0] as HTMLCanvasElement;
|
||||||
"canvas",
|
canvas.addEventListener("pointerup", (e) => canvasClick(e, canvas), false);
|
||||||
)[0] as HTMLCanvasElement;
|
|
||||||
canvas.addEventListener(
|
|
||||||
"pointerup",
|
|
||||||
(e) => canvasClick(e, canvas),
|
|
||||||
false,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -605,11 +582,7 @@ const hitSignature = (
|
|||||||
scaleYToCanvas(zone.y, canvas.height, zone.PDFPage.height) <
|
scaleYToCanvas(zone.y, canvas.height, zone.PDFPage.height) <
|
||||||
xy[1] &&
|
xy[1] &&
|
||||||
xy[1] <
|
xy[1] <
|
||||||
scaleYToCanvas(
|
scaleYToCanvas(zone.height - zone.y, canvas.height, zone.PDFPage.height) +
|
||||||
zone.height - zone.y,
|
|
||||||
canvas.height,
|
|
||||||
zone.PDFPage.height,
|
|
||||||
) +
|
|
||||||
zone.PDFPage.height * zoom.value;
|
zone.PDFPage.height * zoom.value;
|
||||||
|
|
||||||
const selectZone = async (z: SignatureZone, canvas: HTMLCanvasElement) => {
|
const selectZone = async (z: SignatureZone, canvas: HTMLCanvasElement) => {
|
||||||
@@ -625,8 +598,7 @@ const selectZoneEvent = (e: PointerEvent, canvas: HTMLCanvasElement) =>
|
|||||||
signature.zones
|
signature.zones
|
||||||
.filter(
|
.filter(
|
||||||
(z) =>
|
(z) =>
|
||||||
(z.PDFPage.index + 1 === getCanvasId(canvas) &&
|
(z.PDFPage.index + 1 === getCanvasId(canvas) && multiPage.value) ||
|
||||||
multiPage.value) ||
|
|
||||||
(z.PDFPage.index + 1 === page.value && !multiPage.value),
|
(z.PDFPage.index + 1 === page.value && !multiPage.value),
|
||||||
)
|
)
|
||||||
.map((z) => {
|
.map((z) => {
|
||||||
|
@@ -153,12 +153,10 @@ const handleFile = async (file: File): Promise<void> => {
|
|||||||
</p>
|
</p>
|
||||||
<!-- todo i18n -->
|
<!-- todo i18n -->
|
||||||
<p v-if="has_existing_doc">
|
<p v-if="has_existing_doc">
|
||||||
Déposez un document ou cliquez ici pour remplacer le document
|
Déposez un document ou cliquez ici pour remplacer le document existant
|
||||||
existant
|
|
||||||
</p>
|
</p>
|
||||||
<p v-else>
|
<p v-else>
|
||||||
Déposez un document ou cliquez ici pour ouvrir le navigateur de
|
Déposez un document ou cliquez ici pour ouvrir le navigateur de fichier
|
||||||
fichier
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="waiting">
|
<div v-else class="waiting">
|
||||||
|
@@ -35,9 +35,7 @@ async function download_and_open(event: Event): Promise<void> {
|
|||||||
if (null === state.content) {
|
if (null === state.content) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
const raw = await download_doc(
|
const raw = await download_doc(build_convert_link(props.storedObject.uuid));
|
||||||
build_convert_link(props.storedObject.uuid),
|
|
||||||
);
|
|
||||||
state.content = window.URL.createObjectURL(raw);
|
state.content = window.URL.createObjectURL(raw);
|
||||||
|
|
||||||
button.href = window.URL.createObjectURL(raw);
|
button.href = window.URL.createObjectURL(raw);
|
||||||
|
@@ -42,9 +42,7 @@ const editionUntilFormatted = computed<string>(() => {
|
|||||||
<modal v-if="state.modalOpened" @close="state.modalOpened = false">
|
<modal v-if="state.modalOpened" @close="state.modalOpened = false">
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<div class="desktop-edit">
|
<div class="desktop-edit">
|
||||||
<p class="center">
|
<p class="center">Veuillez enregistrer vos modifications avant le</p>
|
||||||
Veuillez enregistrer vos modifications avant le
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
<strong>{{ editionUntilFormatted }}</strong>
|
<strong>{{ editionUntilFormatted }}</strong>
|
||||||
</p>
|
</p>
|
||||||
@@ -57,23 +55,21 @@ const editionUntilFormatted = computed<string>(() => {
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
<small
|
<small
|
||||||
>Le document peut être édité uniquement en utilisant
|
>Le document peut être édité uniquement en utilisant Libre
|
||||||
Libre Office.</small
|
Office.</small
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<small
|
<small
|
||||||
>En cas d'échec lors de l'enregistrement, sauver le
|
>En cas d'échec lors de l'enregistrement, sauver le document sur
|
||||||
document sur le poste de travail avant de le déposer
|
le poste de travail avant de le déposer à nouveau ici.</small
|
||||||
à nouveau ici.</small
|
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<small
|
<small
|
||||||
>Vous pouvez naviguez sur d'autres pages pendant
|
>Vous pouvez naviguez sur d'autres pages pendant l'édition.</small
|
||||||
l'édition.</small
|
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -95,10 +95,7 @@ async function download_and_open(): Promise<void> {
|
|||||||
let raw;
|
let raw;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
raw = await download_and_decrypt_doc(
|
raw = await download_and_decrypt_doc(props.storedObject, props.atVersion);
|
||||||
props.storedObject,
|
|
||||||
props.atVersion,
|
|
||||||
);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("error while downloading and decrypting document");
|
console.error("error while downloading and decrypting document");
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
@@ -49,8 +49,7 @@ const isRestored = computed<boolean>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const isDuplicated = computed<boolean>(
|
const isDuplicated = computed<boolean>(
|
||||||
() =>
|
() => props.version.version === 0 && null !== props.version["from-restored"],
|
||||||
props.version.version === 0 && null !== props.version["from-restored"],
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const classes = computed<{
|
const classes = computed<{
|
||||||
@@ -70,16 +69,9 @@ const classes = computed<{
|
|||||||
<div :class="classes">
|
<div :class="classes">
|
||||||
<div
|
<div
|
||||||
class="col-12 tags"
|
class="col-12 tags"
|
||||||
v-if="
|
v-if="isCurrent || isKeptBeforeConversion || isRestored || isDuplicated"
|
||||||
isCurrent ||
|
|
||||||
isKeptBeforeConversion ||
|
|
||||||
isRestored ||
|
|
||||||
isDuplicated
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<span class="badge bg-success" v-if="isCurrent"
|
|
||||||
>Version actuelle</span
|
|
||||||
>
|
>
|
||||||
|
<span class="badge bg-success" v-if="isCurrent">Version actuelle</span>
|
||||||
<span class="badge bg-info" v-if="isKeptBeforeConversion"
|
<span class="badge bg-info" v-if="isKeptBeforeConversion"
|
||||||
>Conservée avant conversion dans un autre format</span
|
>Conservée avant conversion dans un autre format</span
|
||||||
>
|
>
|
||||||
@@ -96,21 +88,17 @@ const classes = computed<{
|
|||||||
<span
|
<span
|
||||||
><strong> #{{ version.version + 1 }} </strong></span
|
><strong> #{{ version.version + 1 }} </strong></span
|
||||||
>
|
>
|
||||||
<template
|
<template v-if="version.createdBy !== null && version.createdAt !== null"
|
||||||
v-if="version.createdBy !== null && version.createdAt !== null"
|
|
||||||
><strong v-if="version.version == 0">créé par</strong
|
><strong v-if="version.version == 0">créé par</strong
|
||||||
><strong v-else>modifié par</strong>
|
><strong v-else>modifié par</strong>
|
||||||
<span class="badge-user"
|
<span class="badge-user"
|
||||||
><UserRenderBoxBadge
|
><UserRenderBoxBadge :user="version.createdBy"></UserRenderBoxBadge
|
||||||
:user="version.createdBy"
|
|
||||||
></UserRenderBoxBadge
|
|
||||||
></span>
|
></span>
|
||||||
<strong>à</strong>
|
<strong>à</strong>
|
||||||
{{
|
{{
|
||||||
$d(ISOToDatetime(version.createdAt.datetime8601), "long")
|
$d(ISOToDatetime(version.createdAt.datetime8601), "long")
|
||||||
}}</template
|
}}</template
|
||||||
><template
|
><template v-if="version.createdBy === null && version.createdAt !== null"
|
||||||
v-if="version.createdBy === null && version.createdAt !== null"
|
|
||||||
><strong v-if="version.version == 0">Créé le</strong
|
><strong v-if="version.version == 0">Créé le</strong
|
||||||
><strong v-else>modifié le</strong>
|
><strong v-else>modifié le</strong>
|
||||||
{{
|
{{
|
||||||
|
@@ -2,9 +2,7 @@
|
|||||||
<a
|
<a
|
||||||
:class="Object.assign(props.classes, { btn: true })"
|
:class="Object.assign(props.classes, { btn: true })"
|
||||||
@click="beforeLeave($event)"
|
@click="beforeLeave($event)"
|
||||||
:href="
|
:href="build_wopi_editor_link(props.storedObject.uuid, props.returnPath)"
|
||||||
build_wopi_editor_link(props.storedObject.uuid, props.returnPath)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<i class="fa fa-paragraph"></i>
|
<i class="fa fa-paragraph"></i>
|
||||||
Editer en ligne
|
Editer en ligne
|
||||||
|
@@ -145,9 +145,7 @@ async function download_info_link(
|
|||||||
function build_wopi_editor_link(uuid: string, returnPath?: string) {
|
function build_wopi_editor_link(uuid: string, returnPath?: string) {
|
||||||
if (returnPath === undefined) {
|
if (returnPath === undefined) {
|
||||||
returnPath =
|
returnPath =
|
||||||
window.location.pathname +
|
window.location.pathname + window.location.search + window.location.hash;
|
||||||
window.location.search +
|
|
||||||
window.location.hash;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -186,10 +184,7 @@ async function download_and_decrypt_doc(
|
|||||||
) {
|
) {
|
||||||
downloadInfo = storedObject._links.downloadLink;
|
downloadInfo = storedObject._links.downloadLink;
|
||||||
} else {
|
} else {
|
||||||
downloadInfo = await download_info_link(
|
downloadInfo = await download_info_link(storedObject, atVersionToDownload);
|
||||||
storedObject,
|
|
||||||
atVersionToDownload,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const rawResponse = await window.fetch(downloadInfo.url);
|
const rawResponse = await window.fetch(downloadInfo.url);
|
||||||
@@ -244,10 +239,7 @@ async function download_doc_as_pdf(storedObject: StoredObject): Promise<Blob> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (storedObject.currentVersion?.type === "application/pdf") {
|
if (storedObject.currentVersion?.type === "application/pdf") {
|
||||||
return download_and_decrypt_doc(
|
return download_and_decrypt_doc(storedObject, storedObject.currentVersion);
|
||||||
storedObject,
|
|
||||||
storedObject.currentVersion,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const convertLink = build_convert_link(storedObject.uuid);
|
const convertLink = build_convert_link(storedObject.uuid);
|
||||||
|
@@ -43,11 +43,17 @@ class StoredObjectVersionNormalizer implements NormalizerInterface, NormalizerAw
|
|||||||
'createdBy' => $this->normalizer->normalize($object->getCreatedBy(), $format, [...$context, UserNormalizer::AT_DATE => $object->getCreatedAt()]),
|
'createdBy' => $this->normalizer->normalize($object->getCreatedBy(), $format, [...$context, UserNormalizer::AT_DATE => $object->getCreatedAt()]),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (in_array(self::WITH_POINT_IN_TIMES_CONTEXT, $context[AbstractNormalizer::GROUPS] ?? [], true)) {
|
$normalizationGroups = $context[AbstractNormalizer::GROUPS] ?? [];
|
||||||
|
|
||||||
|
if (is_string($normalizationGroups)) {
|
||||||
|
$normalizationGroups = [$normalizationGroups];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array(self::WITH_POINT_IN_TIMES_CONTEXT, $normalizationGroups, true)) {
|
||||||
$data['point-in-times'] = $this->normalizer->normalize($object->getPointInTimes(), $format, $context);
|
$data['point-in-times'] = $this->normalizer->normalize($object->getPointInTimes(), $format, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array(self::WITH_RESTORED_CONTEXT, $context[AbstractNormalizer::GROUPS] ?? [], true)) {
|
if (in_array(self::WITH_RESTORED_CONTEXT, $normalizationGroups, true)) {
|
||||||
$data['from-restored'] = $this->normalizer->normalize($object->getCreatedFrom(), $format, [AbstractNormalizer::GROUPS => ['read']]);
|
$data['from-restored'] = $this->normalizer->normalize($object->getCreatedFrom(), $format, [AbstractNormalizer::GROUPS => ['read']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\MainBundle\Command;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Security\RoleDumper;
|
||||||
|
use Symfony\Component\Console\Attribute\AsCommand;
|
||||||
|
use Symfony\Component\Console\Command\Command;
|
||||||
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
|
#[AsCommand(name: 'chill:main:dump-list-permissions', description: 'Print a markdown reference of permissions (roles) grouped by title with dependencies).')]
|
||||||
|
final class DumpListPermissionsCommand extends Command
|
||||||
|
{
|
||||||
|
public function __construct(private readonly RoleDumper $roleDumper)
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||||
|
{
|
||||||
|
$markdown = $this->roleDumper->dumpAsMarkdown();
|
||||||
|
$output->writeln($markdown);
|
||||||
|
|
||||||
|
return Command::SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
@@ -345,7 +345,7 @@ class ExportController extends AbstractController
|
|||||||
* @param array $dataExport Raw data from export step
|
* @param array $dataExport Raw data from export step
|
||||||
* @param array $dataFormatter Raw data from formatter step
|
* @param array $dataFormatter Raw data from formatter step
|
||||||
*/
|
*/
|
||||||
private function buildExportDataForNormalization(string $alias, ?array $dataCenters, array $dataExport, array $dataFormatter, ?SavedExport $savedExport): array
|
private function buildExportDataForNormalization(string $alias, ?array $dataCenters, array $dataExport, ?array $dataFormatter, ?SavedExport $savedExport): array
|
||||||
{
|
{
|
||||||
if ($this->filterStatsByCenters) {
|
if ($this->filterStatsByCenters) {
|
||||||
$formCenters = $this->createCreateFormExport($alias, 'generate_centers', [], null);
|
$formCenters = $this->createCreateFormExport($alias, 'generate_centers', [], null);
|
||||||
@@ -365,7 +365,7 @@ class ExportController extends AbstractController
|
|||||||
$formExport->submit($dataExport);
|
$formExport->submit($dataExport);
|
||||||
$dataExport = $formExport->getData();
|
$dataExport = $formExport->getData();
|
||||||
|
|
||||||
if (\count($dataFormatter) > 0) {
|
if (is_array($dataFormatter) && \count($dataFormatter) > 0) {
|
||||||
$formFormatter = $this->createCreateFormExport(
|
$formFormatter = $this->createCreateFormExport(
|
||||||
$alias,
|
$alias,
|
||||||
'generate_formatter',
|
'generate_formatter',
|
||||||
@@ -381,7 +381,7 @@ class ExportController extends AbstractController
|
|||||||
'export' => $dataExport['export']['export'] ?? [],
|
'export' => $dataExport['export']['export'] ?? [],
|
||||||
'filters' => $dataExport['export']['filters'] ?? [],
|
'filters' => $dataExport['export']['filters'] ?? [],
|
||||||
'aggregators' => $dataExport['export']['aggregators'] ?? [],
|
'aggregators' => $dataExport['export']['aggregators'] ?? [],
|
||||||
'pick_formatter' => $dataExport['export']['pick_formatter']['alias'],
|
'pick_formatter' => ($dataExport['export']['pick_formatter'] ?? [])['alias'] ?? '',
|
||||||
'formatter' => $dataFormatter['formatter'] ?? [],
|
'formatter' => $dataFormatter['formatter'] ?? [],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -20,7 +20,7 @@ use Chill\MainBundle\Repository\CenterRepositoryInterface;
|
|||||||
use Chill\MainBundle\Repository\RegroupmentRepositoryInterface;
|
use Chill\MainBundle\Repository\RegroupmentRepositoryInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @phpstan-type NormalizedData array{centers: array{centers: list<int>, regroupments: list<int>}, export: array{form: array<string, mixed>, version: int}, filters: array<string, array{enabled: boolean, form: array<string, mixed>, version: int}>, aggregators: array<string, array{enabled: boolean, form: array<string, mixed>, version: int}>, pick_formatter: string, formatter: array{form: array<string, mixed>, version: int}}
|
* @phpstan-type NormalizedData array{centers: array{centers: list<int>, regroupments: list<int>}, export: array{form: array<string, mixed>, version: int}, filters: array<string, array{enabled: boolean, form: array<string, mixed>, version: int}>, aggregators: array<string, array{enabled: boolean, form: array<string, mixed>, version: int}>, pick_formatter?: string, formatter: array{form: array<string, mixed>, version: int}}
|
||||||
*/
|
*/
|
||||||
class ExportConfigNormalizer
|
class ExportConfigNormalizer
|
||||||
{
|
{
|
||||||
@@ -72,10 +72,14 @@ class ExportConfigNormalizer
|
|||||||
}
|
}
|
||||||
$serialized['aggregators'] = $aggregatorsSerialized;
|
$serialized['aggregators'] = $aggregatorsSerialized;
|
||||||
|
|
||||||
|
if ($export instanceof ExportInterface) {
|
||||||
$serialized['pick_formatter'] = $formData['pick_formatter'];
|
$serialized['pick_formatter'] = $formData['pick_formatter'];
|
||||||
$formatter = $this->exportManager->getFormatter($formData['pick_formatter']);
|
$formatter = $this->exportManager->getFormatter($formData['pick_formatter']);
|
||||||
$serialized['formatter']['form'] = $formatter->normalizeFormData($formData['formatter']);
|
$serialized['formatter']['form'] = $formatter->normalizeFormData($formData['formatter']);
|
||||||
$serialized['formatter']['version'] = $formatter->getNormalizationVersion();
|
$serialized['formatter']['version'] = $formatter->getNormalizationVersion();
|
||||||
|
} elseif ($export instanceof DirectExportInterface) {
|
||||||
|
$serialized['formatter'] = ['form' => [], 'version' => 0];
|
||||||
|
}
|
||||||
|
|
||||||
return $serialized;
|
return $serialized;
|
||||||
}
|
}
|
||||||
@@ -87,7 +91,12 @@ class ExportConfigNormalizer
|
|||||||
public function denormalizeConfig(string $exportAlias, array $serializedData, bool $replaceDisabledByDefaultData = false): array
|
public function denormalizeConfig(string $exportAlias, array $serializedData, bool $replaceDisabledByDefaultData = false): array
|
||||||
{
|
{
|
||||||
$export = $this->exportManager->getExport($exportAlias);
|
$export = $this->exportManager->getExport($exportAlias);
|
||||||
$formater = $this->exportManager->getFormatter($serializedData['pick_formatter']);
|
|
||||||
|
if ($export instanceof ExportInterface) {
|
||||||
|
$formatter = $this->exportManager->getFormatter($serializedData['pick_formatter']);
|
||||||
|
} else {
|
||||||
|
$formatter = null;
|
||||||
|
}
|
||||||
|
|
||||||
$filtersConfig = [];
|
$filtersConfig = [];
|
||||||
foreach ($serializedData['filters'] as $alias => $filterData) {
|
foreach ($serializedData['filters'] as $alias => $filterData) {
|
||||||
@@ -117,8 +126,8 @@ class ExportConfigNormalizer
|
|||||||
'export' => $export->denormalizeFormData($serializedData['export']['form'], $serializedData['export']['version']),
|
'export' => $export->denormalizeFormData($serializedData['export']['form'], $serializedData['export']['version']),
|
||||||
'filters' => $filtersConfig,
|
'filters' => $filtersConfig,
|
||||||
'aggregators' => $aggregatorsConfig,
|
'aggregators' => $aggregatorsConfig,
|
||||||
'pick_formatter' => $serializedData['pick_formatter'],
|
'pick_formatter' => $serializedData['pick_formatter'] ?? '',
|
||||||
'formatter' => $formater->denormalizeFormData($serializedData['formatter']['form'], $serializedData['formatter']['version']),
|
'formatter' => $formatter?->denormalizeFormData($serializedData['formatter']['form'], $serializedData['formatter']['version']),
|
||||||
'centers' => [
|
'centers' => [
|
||||||
'centers' => array_values(array_filter(array_map(fn (int $id) => $this->centerRepository->find($id), $serializedData['centers']['centers']), fn ($item) => null !== $item)),
|
'centers' => array_values(array_filter(array_map(fn (int $id) => $this->centerRepository->find($id), $serializedData['centers']['centers']), fn ($item) => null !== $item)),
|
||||||
'regroupments' => array_values(array_filter(array_map(fn (int $id) => $this->regroupmentRepository->find($id), $serializedData['centers']['regroupments']), fn ($item) => null !== $item)),
|
'regroupments' => array_values(array_filter(array_map(fn (int $id) => $this->regroupmentRepository->find($id), $serializedData['centers']['regroupments']), fn ($item) => null !== $item)),
|
||||||
|
@@ -27,6 +27,8 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
use Symfony\Contracts\Translation\TranslatableInterface;
|
use Symfony\Contracts\Translation\TranslatableInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
|
// command to get the report with curl : curl --user "center a_social:password" "http://localhost:8000/fr/exports/generate/count_person?export[filters][person_gender_filter][enabled]=&export[filters][person_nationality_filter][enabled]=&export[filters][person_nationality_filter][form][nationalities]=&export[aggregators][person_nationality_aggregator][order]=1&export[aggregators][person_nationality_aggregator][form][group_by_level]=country&export[submit]=&export[_token]=RHpjHl389GrK-bd6iY5NsEqrD5UKOTHH40QKE9J1edU" --globoff
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a CSV List for the export.
|
* Create a CSV List for the export.
|
||||||
*/
|
*/
|
||||||
|
@@ -76,6 +76,24 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface
|
|||||||
->formatOutOfCountryCallingNumber($phoneNumber, $this->config['default_carrier_code']);
|
->formatOutOfCountryCallingNumber($phoneNumber, $this->config['default_carrier_code']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws NumberParseException
|
||||||
|
*/
|
||||||
|
public function parse(string $phoneNumber): PhoneNumber
|
||||||
|
{
|
||||||
|
$sanitizedPhoneNumber = $phoneNumber;
|
||||||
|
|
||||||
|
if (str_starts_with($sanitizedPhoneNumber, '00')) {
|
||||||
|
$sanitizedPhoneNumber = '+'.substr($sanitizedPhoneNumber, 2, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!str_starts_with($sanitizedPhoneNumber, '+') && !str_starts_with($sanitizedPhoneNumber, '0')) {
|
||||||
|
$sanitizedPhoneNumber = '+'.$sanitizedPhoneNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->phoneNumberUtil->parse($sanitizedPhoneNumber, $this->config['default_carrier_code']);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get type (mobile, landline, ...) for phone number.
|
* Get type (mobile, landline, ...) for phone number.
|
||||||
*/
|
*/
|
||||||
|
@@ -56,9 +56,7 @@ export const ISOToDatetime = (str: string | null): Date | null => {
|
|||||||
[time, timezone] = times.split(times.charAt(8)),
|
[time, timezone] = times.split(times.charAt(8)),
|
||||||
[hours, minutes, seconds] = time.split(":").map((s) => parseInt(s));
|
[hours, minutes, seconds] = time.split(":").map((s) => parseInt(s));
|
||||||
if ("0000" === timezone) {
|
if ("0000" === timezone) {
|
||||||
return new Date(
|
return new Date(Date.UTC(year, month - 1, date, hours, minutes, seconds));
|
||||||
Date.UTC(year, month - 1, date, hours, minutes, seconds),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Date(year, month - 1, date, hours, minutes, seconds);
|
return new Date(year, month - 1, date, hours, minutes, seconds);
|
||||||
@@ -154,9 +152,7 @@ export const intervalISOToDays = (str: string | null): number | null => {
|
|||||||
vstring = "";
|
vstring = "";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw Error(
|
throw Error("this character should not appears: " + str.charAt(i));
|
||||||
"this character should not appears: " + str.charAt(i),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,11 +5,16 @@ export type fetchOption = Record<string, boolean | string | number | null>;
|
|||||||
|
|
||||||
export type Params = Record<string, number | string>;
|
export type Params = Record<string, number | string>;
|
||||||
|
|
||||||
export interface PaginationResponse<T> {
|
export interface Pagination {
|
||||||
pagination: {
|
first: number;
|
||||||
more: boolean;
|
|
||||||
items_per_page: number;
|
items_per_page: number;
|
||||||
};
|
more: boolean;
|
||||||
|
next: string | null;
|
||||||
|
previous: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PaginationResponse<T> {
|
||||||
|
pagination: Pagination;
|
||||||
results: T[];
|
results: T[];
|
||||||
count: number;
|
count: number;
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,26 @@ import { TranslatableString } from "ChillMainAssets/types";
|
|||||||
* @param locale defaults to browser locale
|
* @param locale defaults to browser locale
|
||||||
* @returns The localized string or null if no translation is available
|
* @returns The localized string or null if no translation is available
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepends the current HTML lang code to the given URL.
|
||||||
|
* Example: If lang="fr" and url="/about", returns "/fr/about"
|
||||||
|
*
|
||||||
|
* @param url The URL to localize
|
||||||
|
* @returns The localized URL
|
||||||
|
*/
|
||||||
|
export function localizedUrl(url: string): string {
|
||||||
|
const lang =
|
||||||
|
document.documentElement.lang || navigator.language.split("-")[0] || "fr";
|
||||||
|
// Ensure url starts with a slash and does not already start with /{lang}/
|
||||||
|
const normalizedUrl = url.startsWith("/") ? url : `/${url}`;
|
||||||
|
const langPrefix = `/${lang}`;
|
||||||
|
if (normalizedUrl.startsWith(langPrefix + "/")) {
|
||||||
|
return normalizedUrl;
|
||||||
|
}
|
||||||
|
return `${langPrefix}${normalizedUrl}`;
|
||||||
|
}
|
||||||
|
|
||||||
export function localizeString(
|
export function localizeString(
|
||||||
translatableString: TranslatableString | null | undefined,
|
translatableString: TranslatableString | null | undefined,
|
||||||
locale?: string,
|
locale?: string,
|
||||||
|
@@ -126,7 +126,8 @@ function loadDynamicPicker(element) {
|
|||||||
-1 ===
|
-1 ===
|
||||||
this.suggested.findIndex(
|
this.suggested.findIndex(
|
||||||
(e) => e.type === entity.type && e.id === entity.id,
|
(e) => e.type === entity.type && e.id === entity.id,
|
||||||
)
|
) &&
|
||||||
|
"me" !== entity
|
||||||
) {
|
) {
|
||||||
this.suggested.push(entity);
|
this.suggested.push(entity);
|
||||||
}
|
}
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
import { createApp } from "vue";
|
|
||||||
import { _createI18n } from "ChillMainAssets/vuejs/_js/i18n";
|
|
||||||
import { appMessages } from "ChillMainAssets/vuejs/HomepageWidget/js/i18n";
|
|
||||||
import { store } from "ChillMainAssets/vuejs/HomepageWidget/js/store";
|
|
||||||
import App from "ChillMainAssets/vuejs/HomepageWidget/App";
|
|
||||||
|
|
||||||
const i18n = _createI18n(appMessages);
|
|
||||||
|
|
||||||
const app = createApp({
|
|
||||||
template: `<app></app>`,
|
|
||||||
})
|
|
||||||
.use(store)
|
|
||||||
.use(i18n)
|
|
||||||
.component("app", App)
|
|
||||||
.mount("#homepage_widget");
|
|
@@ -0,0 +1,12 @@
|
|||||||
|
import App from "ChillMainAssets/vuejs/HomepageWidget/App.vue";
|
||||||
|
import { createApp } from "vue";
|
||||||
|
import { store } from "ChillMainAssets/vuejs/HomepageWidget/store";
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
homepage_config: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const _app = createApp(App);
|
||||||
|
_app.use(store).mount("#homepage_widget");
|
@@ -11,6 +11,11 @@ export interface Civility {
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Household {
|
||||||
|
type: "household";
|
||||||
|
id: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Job {
|
export interface Job {
|
||||||
id: number;
|
id: number;
|
||||||
type: "user_job";
|
type: "user_job";
|
||||||
@@ -215,3 +220,83 @@ export interface ExportGeneration {
|
|||||||
export interface PrivateCommentEmbeddable {
|
export interface PrivateCommentEmbeddable {
|
||||||
comments: Record<number, string>;
|
comments: Record<number, string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// API Exception types
|
||||||
|
export interface TransportExceptionInterface {
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ValidationExceptionInterface
|
||||||
|
extends TransportExceptionInterface {
|
||||||
|
name: "ValidationException";
|
||||||
|
error: object;
|
||||||
|
violations: string[];
|
||||||
|
titles: string[];
|
||||||
|
propertyPaths: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AccessExceptionInterface extends TransportExceptionInterface {
|
||||||
|
name: "AccessException";
|
||||||
|
violations: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface NotFoundExceptionInterface
|
||||||
|
extends TransportExceptionInterface {
|
||||||
|
name: "NotFoundException";
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ServerExceptionInterface extends TransportExceptionInterface {
|
||||||
|
name: "ServerException";
|
||||||
|
message: string;
|
||||||
|
code: number;
|
||||||
|
body: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ConflictHttpExceptionInterface
|
||||||
|
extends TransportExceptionInterface {
|
||||||
|
name: "ConflictHttpException";
|
||||||
|
violations: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ApiException =
|
||||||
|
| ValidationExceptionInterface
|
||||||
|
| AccessExceptionInterface
|
||||||
|
| NotFoundExceptionInterface
|
||||||
|
| ServerExceptionInterface
|
||||||
|
| ConflictHttpExceptionInterface;
|
||||||
|
|
||||||
|
export interface Modal {
|
||||||
|
showModal: boolean;
|
||||||
|
modalDialogClass: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Selected {
|
||||||
|
result: UserGroupOrUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface addNewEntities {
|
||||||
|
selected: Selected[];
|
||||||
|
modal: Modal;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum HomepageTabs {
|
||||||
|
MyCustoms,
|
||||||
|
MyTickets,
|
||||||
|
MyNotifications,
|
||||||
|
MyAccompanyingCourses,
|
||||||
|
MyEvaluations,
|
||||||
|
MyTasks,
|
||||||
|
MyWorkflows,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HomepageConfig {
|
||||||
|
defaultTab: HomepageTabs;
|
||||||
|
displayTabs: HomepageTabs[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TabDefinition {
|
||||||
|
key: HomepageTabs;
|
||||||
|
label: string;
|
||||||
|
icon: string | null;
|
||||||
|
counter: () => number;
|
||||||
|
}
|
||||||
|
@@ -148,10 +148,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #action>
|
<template #action>
|
||||||
<li v-if="!this.context.edit && this.useDatePane">
|
<li v-if="!this.context.edit && this.useDatePane">
|
||||||
<button
|
<button class="btn btn-update change-icon" @click="closeEditPane">
|
||||||
class="btn btn-update change-icon"
|
|
||||||
@click="closeEditPane"
|
|
||||||
>
|
|
||||||
{{ trans(NEXT) }}
|
{{ trans(NEXT) }}
|
||||||
<i class="fa fa-fw fa-arrow-right" />
|
<i class="fa fa-fw fa-arrow-right" />
|
||||||
</button>
|
</button>
|
||||||
@@ -277,8 +274,7 @@ export default {
|
|||||||
PREVIOUS,
|
PREVIOUS,
|
||||||
NEXT,
|
NEXT,
|
||||||
};
|
};
|
||||||
},
|
},props: ["context", "options", "addressChangedCallback"],
|
||||||
props: ["context", "options", "addressChangedCallback"],
|
|
||||||
components: {
|
components: {
|
||||||
Modal,
|
Modal,
|
||||||
ShowPane,
|
ShowPane,
|
||||||
@@ -394,8 +390,7 @@ export default {
|
|||||||
getTextTitle() {
|
getTextTitle() {
|
||||||
if (
|
if (
|
||||||
typeof this.options.title !== "undefined" &&
|
typeof this.options.title !== "undefined" &&
|
||||||
(this.options.title.edit !== null ||
|
(this.options.title.edit !== null || this.options.title.create !== null)
|
||||||
this.options.title.create !== null)
|
|
||||||
) {
|
) {
|
||||||
console.log("this.options.title", this.options.title);
|
console.log("this.options.title", this.options.title);
|
||||||
|
|
||||||
@@ -515,10 +510,7 @@ export default {
|
|||||||
if (!this.context.edit) {
|
if (!this.context.edit) {
|
||||||
this.context.edit = true;
|
this.context.edit = true;
|
||||||
this.context.addressId = params.addressId;
|
this.context.addressId = params.addressId;
|
||||||
console.log(
|
console.log("context is now edit, with address", params.addressId);
|
||||||
"context is now edit, with address",
|
|
||||||
params.addressId,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -645,9 +637,7 @@ export default {
|
|||||||
? this.entity.address.confidential
|
? this.entity.address.confidential
|
||||||
: false;
|
: false;
|
||||||
this.entity.selected.isNoAddress =
|
this.entity.selected.isNoAddress =
|
||||||
this.context.edit && this.entity.address.text === ""
|
this.context.edit && this.entity.address.text === "" ? true : false;
|
||||||
? true
|
|
||||||
: false;
|
|
||||||
|
|
||||||
this.entity.selected.country = this.context.edit
|
this.entity.selected.country = this.context.edit
|
||||||
? this.entity.address.country
|
? this.entity.address.country
|
||||||
@@ -742,8 +732,7 @@ export default {
|
|||||||
// add the address reference, if any
|
// add the address reference, if any
|
||||||
if (this.entity.selected.address.addressReference !== undefined) {
|
if (this.entity.selected.address.addressReference !== undefined) {
|
||||||
newAddress = Object.assign(newAddress, {
|
newAddress = Object.assign(newAddress, {
|
||||||
addressReference:
|
addressReference: this.entity.selected.address.addressReference,
|
||||||
this.entity.selected.address.addressReference,
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
newAddress = Object.assign(newAddress, {
|
newAddress = Object.assign(newAddress, {
|
||||||
@@ -763,10 +752,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (this.validTo && null !== this.entity.selected.valid.to) {
|
if (this.validTo && null !== this.entity.selected.valid.to) {
|
||||||
console.log(
|
console.log("add validTo in fetch body", this.entity.selected.valid.to);
|
||||||
"add validTo in fetch body",
|
|
||||||
this.entity.selected.valid.to,
|
|
||||||
);
|
|
||||||
newAddress = Object.assign(newAddress, {
|
newAddress = Object.assign(newAddress, {
|
||||||
validTo: {
|
validTo: {
|
||||||
datetime: `${this.entity.selected.valid.to.toISOString().split("T")[0]}T00:00:00+0100`,
|
datetime: `${this.entity.selected.valid.to.toISOString().split("T")[0]}T00:00:00+0100`,
|
||||||
@@ -778,10 +764,7 @@ export default {
|
|||||||
newPostcode = Object.assign(newPostcode, {
|
newPostcode = Object.assign(newPostcode, {
|
||||||
country: { id: this.entity.selected.country.id },
|
country: { id: this.entity.selected.country.id },
|
||||||
}); //TODO why not assign postcodeBody here = Object.assign(postcodeBody, {'origin': 3}); ?
|
}); //TODO why not assign postcodeBody here = Object.assign(postcodeBody, {'origin': 3}); ?
|
||||||
console.log(
|
console.log("writeNew postcode is true! newPostcode: ", newPostcode);
|
||||||
"writeNew postcode is true! newPostcode: ",
|
|
||||||
newPostcode,
|
|
||||||
);
|
|
||||||
newAddress = Object.assign(newAddress, {
|
newAddress = Object.assign(newAddress, {
|
||||||
newPostcode: newPostcode,
|
newPostcode: newPostcode,
|
||||||
});
|
});
|
||||||
|
@@ -72,10 +72,7 @@ export default {
|
|||||||
this.entity.addressMap.zoom,
|
this.entity.addressMap.zoom,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.map.setView(
|
this.map.setView(lonLatForLeaflet(this.addressPoint.coordinates), 15);
|
||||||
lonLatForLeaflet(this.addressPoint.coordinates),
|
|
||||||
15,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.map.scrollWheelZoom.disable();
|
this.map.scrollWheelZoom.disable();
|
||||||
@@ -105,9 +102,7 @@ export default {
|
|||||||
},
|
},
|
||||||
update() {
|
update() {
|
||||||
if (this.marker && this.entity.addressMap.center) {
|
if (this.marker && this.entity.addressMap.center) {
|
||||||
this.marker.setLatLng(
|
this.marker.setLatLng(lonLatForLeaflet(this.entity.addressMap.center));
|
||||||
lonLatForLeaflet(this.entity.addressMap.center),
|
|
||||||
);
|
|
||||||
this.map.panTo(lonLatForLeaflet(this.entity.addressMap.center));
|
this.map.panTo(lonLatForLeaflet(this.entity.addressMap.center));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -117,8 +117,7 @@ export default {
|
|||||||
ADDRESS_FILL_AN_ADDRESS,
|
ADDRESS_FILL_AN_ADDRESS,
|
||||||
trans,
|
trans,
|
||||||
};
|
};
|
||||||
},
|
},props: ["entity", "isNoAddress"],
|
||||||
props: ["entity", "isNoAddress"],
|
|
||||||
computed: {
|
computed: {
|
||||||
floor: {
|
floor: {
|
||||||
set(value) {
|
set(value) {
|
||||||
|
@@ -96,13 +96,10 @@ export default {
|
|||||||
ADDRESS_CREATE_ADDRESS,
|
ADDRESS_CREATE_ADDRESS,
|
||||||
trans,
|
trans,
|
||||||
};
|
};
|
||||||
},
|
},props: ["entity", "context", "updateMapCenter", "flag", "checkErrors"],
|
||||||
props: ["entity", "context", "updateMapCenter", "flag", "checkErrors"],
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: this.context.edit
|
value: this.context.edit ? this.entity.address.addressReference : null,
|
||||||
? this.entity.address.addressReference
|
|
||||||
: null,
|
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -175,8 +172,7 @@ export default {
|
|||||||
.then(
|
.then(
|
||||||
(addresses) =>
|
(addresses) =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
this.entity.loaded.addresses =
|
this.entity.loaded.addresses = addresses.results;
|
||||||
addresses.results;
|
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
resolve();
|
resolve();
|
||||||
}),
|
}),
|
||||||
@@ -193,8 +189,7 @@ export default {
|
|||||||
.then(
|
.then(
|
||||||
(addresses) =>
|
(addresses) =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
this.entity.loaded.addresses =
|
this.entity.loaded.addresses = addresses.results;
|
||||||
addresses.results;
|
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
resolve();
|
resolve();
|
||||||
}),
|
}),
|
||||||
|
@@ -85,8 +85,7 @@ export default {
|
|||||||
ADDRESS_CREATE_POSTAL_CODE,
|
ADDRESS_CREATE_POSTAL_CODE,
|
||||||
trans,
|
trans,
|
||||||
};
|
};
|
||||||
},
|
},props: [
|
||||||
props: [
|
|
||||||
"entity",
|
"entity",
|
||||||
"context",
|
"context",
|
||||||
"focusOnAddress",
|
"focusOnAddress",
|
||||||
@@ -158,9 +157,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
transName(value) {
|
transName(value) {
|
||||||
return value.code && value.name
|
return value.code && value.name ? `${value.name} (${value.code})` : "";
|
||||||
? `${value.name} (${value.code})`
|
|
||||||
: "";
|
|
||||||
},
|
},
|
||||||
selectCity(value) {
|
selectCity(value) {
|
||||||
console.log(value);
|
console.log(value);
|
||||||
@@ -168,8 +165,7 @@ export default {
|
|||||||
this.entity.selected.postcode.name = value.name;
|
this.entity.selected.postcode.name = value.name;
|
||||||
this.entity.selected.postcode.code = value.code;
|
this.entity.selected.postcode.code = value.code;
|
||||||
if (value.center) {
|
if (value.center) {
|
||||||
this.entity.selected.postcode.coordinates =
|
this.entity.selected.postcode.coordinates = value.center.coordinates;
|
||||||
value.center.coordinates;
|
|
||||||
}
|
}
|
||||||
this.entity.selected.writeNew.postcode = false;
|
this.entity.selected.writeNew.postcode = false;
|
||||||
this.$emit("getReferenceAddresses", value);
|
this.$emit("getReferenceAddresses", value);
|
||||||
@@ -190,8 +186,7 @@ export default {
|
|||||||
.then(
|
.then(
|
||||||
(cities) =>
|
(cities) =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
this.entity.loaded.cities =
|
this.entity.loaded.cities = cities.results.filter(
|
||||||
cities.results.filter(
|
|
||||||
(c) => c.origin !== 3,
|
(c) => c.origin !== 3,
|
||||||
); // filter out user-defined cities
|
); // filter out user-defined cities
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
@@ -210,8 +205,7 @@ export default {
|
|||||||
.then(
|
.then(
|
||||||
(cities) =>
|
(cities) =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
this.entity.loaded.cities =
|
this.entity.loaded.cities = cities.results.filter(
|
||||||
cities.results.filter(
|
|
||||||
(c) => c.origin !== 3,
|
(c) => c.origin !== 3,
|
||||||
); // filter out user-defined cities
|
); // filter out user-defined cities
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
|
@@ -44,8 +44,7 @@ export default {
|
|||||||
ADDRESS_SELECT_COUNTRY,
|
ADDRESS_SELECT_COUNTRY,
|
||||||
trans,
|
trans,
|
||||||
};
|
};
|
||||||
},
|
},props: ["context", "entity", "flag", "checkErrors"],
|
||||||
props: ["context", "entity", "flag", "checkErrors"],
|
|
||||||
emits: ["getCities"],
|
emits: ["getCities"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -60,12 +59,8 @@ export default {
|
|||||||
sortedCountries() {
|
sortedCountries() {
|
||||||
const countries = this.entity.loaded.countries;
|
const countries = this.entity.loaded.countries;
|
||||||
let sortedCountries = [];
|
let sortedCountries = [];
|
||||||
sortedCountries.push(
|
sortedCountries.push(...countries.filter((c) => c.countryCode === "FR"));
|
||||||
...countries.filter((c) => c.countryCode === "FR"),
|
sortedCountries.push(...countries.filter((c) => c.countryCode === "BE"));
|
||||||
);
|
|
||||||
sortedCountries.push(
|
|
||||||
...countries.filter((c) => c.countryCode === "BE"),
|
|
||||||
);
|
|
||||||
sortedCountries.push(
|
sortedCountries.push(
|
||||||
...countries
|
...countries
|
||||||
.filter((c) => c.countryCode !== "FR")
|
.filter((c) => c.countryCode !== "FR")
|
||||||
|
@@ -1,9 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="insideModal === false" class="loading">
|
<div v-if="insideModal === false" class="loading">
|
||||||
<i
|
<i v-if="flag.loading" class="fa fa-circle-o-notch fa-spin fa-2x fa-fw" />
|
||||||
v-if="flag.loading"
|
|
||||||
class="fa fa-circle-o-notch fa-spin fa-2x fa-fw"
|
|
||||||
/>
|
|
||||||
<span class="sr-only">{{ $t("loading") }}</span>
|
<span class="sr-only">{{ $t("loading") }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -142,8 +139,7 @@ export default {
|
|||||||
address["street"] = this.entity.selected.address.street
|
address["street"] = this.entity.selected.address.street
|
||||||
? this.entity.selected.address.street
|
? this.entity.selected.address.street
|
||||||
: null;
|
: null;
|
||||||
address["streetNumber"] = this.entity.selected.address
|
address["streetNumber"] = this.entity.selected.address.streetNumber
|
||||||
.streetNumber
|
|
||||||
? this.entity.selected.address.streetNumber
|
? this.entity.selected.address.streetNumber
|
||||||
: null;
|
: null;
|
||||||
address["floor"] = this.entity.selected.address.floor
|
address["floor"] = this.entity.selected.address.floor
|
||||||
@@ -158,12 +154,10 @@ export default {
|
|||||||
address["flat"] = this.entity.selected.address.flat
|
address["flat"] = this.entity.selected.address.flat
|
||||||
? this.entity.selected.address.flat
|
? this.entity.selected.address.flat
|
||||||
: null;
|
: null;
|
||||||
address["buildingName"] = this.entity.selected.address
|
address["buildingName"] = this.entity.selected.address.buildingName
|
||||||
.buildingName
|
|
||||||
? this.entity.selected.address.buildingName
|
? this.entity.selected.address.buildingName
|
||||||
: null;
|
: null;
|
||||||
address["distribution"] = this.entity.selected.address
|
address["distribution"] = this.entity.selected.address.distribution
|
||||||
.distribution
|
|
||||||
? this.entity.selected.address.distribution
|
? this.entity.selected.address.distribution
|
||||||
: null;
|
: null;
|
||||||
address["extra"] = this.entity.selected.address.extra
|
address["extra"] = this.entity.selected.address.extra
|
||||||
|
@@ -2,10 +2,7 @@
|
|||||||
<div class="address-form">
|
<div class="address-form">
|
||||||
<!-- Not display in modal -->
|
<!-- Not display in modal -->
|
||||||
<div v-if="insideModal === false" class="loading">
|
<div v-if="insideModal === false" class="loading">
|
||||||
<i
|
<i v-if="flag.loading" class="fa fa-circle-o-notch fa-spin fa-2x fa-fw" />
|
||||||
v-if="flag.loading"
|
|
||||||
class="fa fa-circle-o-notch fa-spin fa-2x fa-fw"
|
|
||||||
/>
|
|
||||||
<span class="sr-only">Loading...</span>
|
<span class="sr-only">Loading...</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -132,8 +129,7 @@ export default {
|
|||||||
ADDRESS_IS_CONFIDENTIAL,
|
ADDRESS_IS_CONFIDENTIAL,
|
||||||
ADDRESS_IS_NO_ADDRESS,
|
ADDRESS_IS_NO_ADDRESS,
|
||||||
};
|
};
|
||||||
},
|
},props: [
|
||||||
props: [
|
|
||||||
"context",
|
"context",
|
||||||
"options",
|
"options",
|
||||||
"defaultz",
|
"defaultz",
|
||||||
|
@@ -1,10 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="!onlyButton" class="mt-4 flex-grow-1">
|
<div v-if="!onlyButton" class="mt-4 flex-grow-1">
|
||||||
<div class="loading">
|
<div class="loading">
|
||||||
<i
|
<i v-if="flag.loading" class="fa fa-circle-o-notch fa-spin fa-2x fa-fw" />
|
||||||
v-if="flag.loading"
|
|
||||||
class="fa fa-circle-o-notch fa-spin fa-2x fa-fw"
|
|
||||||
/>
|
|
||||||
<span class="sr-only">{{ trans(ADDRESS_LOADING) }}</span>
|
<span class="sr-only">{{ trans(ADDRESS_LOADING) }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -47,9 +44,7 @@
|
|||||||
name="button"
|
name="button"
|
||||||
:title="trans(getTextButton)"
|
:title="trans(getTextButton)"
|
||||||
>
|
>
|
||||||
<span v-if="displayTextButton">{{
|
<span v-if="displayTextButton">{{ trans(getTextButton) }}</span>
|
||||||
trans(getTextButton)
|
|
||||||
}}</span>
|
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</action-buttons>
|
</action-buttons>
|
||||||
@@ -62,9 +57,7 @@
|
|||||||
:use-date-pane="useDatePane"
|
:use-date-pane="useDatePane"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div
|
<div v-if="this.context.target.name === 'household' || this.context.edit">
|
||||||
v-if="this.context.target.name === 'household' || this.context.edit"
|
|
||||||
>
|
|
||||||
<action-buttons :options="this.options" :defaultz="this.defaultz">
|
<action-buttons :options="this.options" :defaultz="this.defaultz">
|
||||||
<template #action>
|
<template #action>
|
||||||
<button
|
<button
|
||||||
@@ -75,9 +68,7 @@
|
|||||||
name="button"
|
name="button"
|
||||||
:title="trans(getTextButton)"
|
:title="trans(getTextButton)"
|
||||||
>
|
>
|
||||||
<span v-if="displayTextButton">{{
|
<span v-if="displayTextButton">{{ trans(getTextButton) }}</span>
|
||||||
trans(getTextButton)
|
|
||||||
}}</span>
|
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</action-buttons>
|
</action-buttons>
|
||||||
@@ -99,9 +90,7 @@
|
|||||||
name="button"
|
name="button"
|
||||||
:title="trans(getTextButton)"
|
:title="trans(getTextButton)"
|
||||||
>
|
>
|
||||||
<span v-if="displayTextButton">{{
|
<span v-if="displayTextButton">{{ trans(getTextButton) }}</span>
|
||||||
trans(getTextButton)
|
|
||||||
}}</span>
|
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</action-buttons>
|
</action-buttons>
|
||||||
@@ -124,8 +113,7 @@ import {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ShowPane",
|
name: "ShowPane",
|
||||||
methods: {},
|
methods: {},components: {
|
||||||
components: {
|
|
||||||
AddressRenderBox,
|
AddressRenderBox,
|
||||||
ActionButtons,
|
ActionButtons,
|
||||||
},
|
},
|
||||||
@@ -140,8 +128,7 @@ export default {
|
|||||||
ADDRESS_ADDRESS_NEW_SUCCESS,
|
ADDRESS_ADDRESS_NEW_SUCCESS,
|
||||||
ADDRESS_ADDRESS_EDIT_SUCCESS,
|
ADDRESS_ADDRESS_EDIT_SUCCESS,
|
||||||
};
|
};
|
||||||
},
|
},props: [
|
||||||
props: [
|
|
||||||
"context",
|
"context",
|
||||||
"defaultz",
|
"defaultz",
|
||||||
"options",
|
"options",
|
||||||
@@ -192,9 +179,7 @@ export default {
|
|||||||
: this.defaultz.button.text.create;
|
: this.defaultz.button.text.create;
|
||||||
},
|
},
|
||||||
getSuccessText() {
|
getSuccessText() {
|
||||||
return this.context.edit
|
return this.context.edit ? ADDRESS_ADDRESS_EDIT_SUCCESS : ADDRESS_ADDRESS_NEW_SUCCESS;
|
||||||
? ADDRESS_ADDRESS_EDIT_SUCCESS
|
|
||||||
: ADDRESS_ADDRESS_NEW_SUCCESS;
|
|
||||||
},
|
},
|
||||||
onlyButton() {
|
onlyButton() {
|
||||||
return typeof this.options.onlyButton !== "undefined"
|
return typeof this.options.onlyButton !== "undefined"
|
||||||
|
@@ -1,9 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="insideModal === false" class="loading">
|
<div v-if="insideModal === false" class="loading">
|
||||||
<i
|
<i v-if="flag.loading" class="fa fa-circle-o-notch fa-spin fa-2x fa-fw" />
|
||||||
v-if="flag.loading"
|
|
||||||
class="fa fa-circle-o-notch fa-spin fa-2x fa-fw"
|
|
||||||
/>
|
|
||||||
<span class="sr-only">{{ $t("loading") }}</span>
|
<span class="sr-only">{{ $t("loading") }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -86,10 +86,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div id="waiting-screen">
|
<div id="waiting-screen">
|
||||||
<div
|
<div v-if="isPending && isFetching" class="alert alert-danger text-center">
|
||||||
v-if="isPending && isFetching"
|
|
||||||
class="alert alert-danger text-center"
|
|
||||||
>
|
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
{{ trans(EXPORT_GENERATION_EXPORT_GENERATION_IS_PENDING) }}
|
{{ trans(EXPORT_GENERATION_EXPORT_GENERATION_IS_PENDING) }}
|
||||||
|
@@ -1,155 +1,156 @@
|
|||||||
<template>
|
<template>
|
||||||
<h2>{{ $t("main_title") }}</h2>
|
<h2>{{ trans(MAIN_TITLE) }}</h2>
|
||||||
|
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="nav-item">
|
<li v-for="tab in displayedTabs" :key="tab.key" class="nav-item">
|
||||||
<a
|
<a
|
||||||
class="nav-link"
|
class="nav-link"
|
||||||
:class="{ active: activeTab === 'MyCustoms' }"
|
:class="{ active: activeTab === tab.key }"
|
||||||
@click="selectTab('MyCustoms')"
|
@click="selectTab(tab.key)"
|
||||||
>
|
>
|
||||||
<i class="fa fa-dashboard" />
|
<i v-if="tab.icon" :class="tab.icon" />
|
||||||
</a>
|
<span v-else>{{ tab.label }}</span>
|
||||||
</li>
|
<tab-counter v-if="tab.counter" :count="tab.counter()" />
|
||||||
<li class="nav-item">
|
|
||||||
<a
|
|
||||||
class="nav-link"
|
|
||||||
:class="{ active: activeTab === 'MyNotifications' }"
|
|
||||||
@click="selectTab('MyNotifications')"
|
|
||||||
>
|
|
||||||
{{ $t("my_notifications.tab") }}
|
|
||||||
<tab-counter :count="state.notifications.count" />
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a
|
|
||||||
class="nav-link"
|
|
||||||
:class="{ active: activeTab === 'MyAccompanyingCourses' }"
|
|
||||||
@click="selectTab('MyAccompanyingCourses')"
|
|
||||||
>
|
|
||||||
{{ $t("my_accompanying_courses.tab") }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<!-- <li class="nav-item">
|
|
||||||
<a class="nav-link"
|
|
||||||
:class="{'active': activeTab === 'MyWorks'}"
|
|
||||||
@click="selectTab('MyWorks')">
|
|
||||||
{{ $t('my_works.tab') }}
|
|
||||||
<tab-counter :count="state.works.count"></tab-counter>
|
|
||||||
</a>
|
|
||||||
</li> -->
|
|
||||||
<li class="nav-item">
|
|
||||||
<a
|
|
||||||
class="nav-link"
|
|
||||||
:class="{ active: activeTab === 'MyEvaluations' }"
|
|
||||||
@click="selectTab('MyEvaluations')"
|
|
||||||
>
|
|
||||||
{{ $t("my_evaluations.tab") }}
|
|
||||||
<tab-counter :count="state.evaluations.count" />
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a
|
|
||||||
class="nav-link"
|
|
||||||
:class="{ active: activeTab === 'MyTasks' }"
|
|
||||||
@click="selectTab('MyTasks')"
|
|
||||||
>
|
|
||||||
{{ $t("my_tasks.tab") }}
|
|
||||||
<tab-counter
|
|
||||||
:count="state.tasks.warning.count + state.tasks.alert.count"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a
|
|
||||||
class="nav-link"
|
|
||||||
:class="{ active: activeTab === 'MyWorkflows' }"
|
|
||||||
@click="selectTab('MyWorkflows')"
|
|
||||||
>
|
|
||||||
{{ $t("my_workflows.tab") }}
|
|
||||||
<tab-counter
|
|
||||||
:count="state.workflows.count + state.workflowsCc.count"
|
|
||||||
/>
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item loading ms-auto py-2" v-if="loading">
|
<li class="nav-item loading ms-auto py-2" v-if="loading">
|
||||||
<i
|
<i
|
||||||
class="fa fa-circle-o-notch fa-spin fa-lg text-chill-gray"
|
class="fa fa-circle-o-notch fa-spin fa-lg text-chill-gray"
|
||||||
:title="$t('loading')"
|
:title="trans(LOADING)"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="my-4">
|
<div class="my-4">
|
||||||
<my-customs v-if="activeTab === 'MyCustoms'" />
|
<MyCustoms v-if="activeTab === HomepageTabs.MyCustoms" />
|
||||||
<my-works v-else-if="activeTab === 'MyWorks'" />
|
<MyTickets v-else-if="activeTab === HomepageTabs.MyTickets" />
|
||||||
<my-evaluations v-else-if="activeTab === 'MyEvaluations'" />
|
<MyNotifications v-else-if="activeTab === HomepageTabs.MyNotifications" />
|
||||||
<my-tasks v-else-if="activeTab === 'MyTasks'" />
|
<MyAccompanyingCourses
|
||||||
<my-accompanying-courses
|
v-else-if="activeTab === HomepageTabs.MyAccompanyingCourses"
|
||||||
v-else-if="activeTab === 'MyAccompanyingCourses'"
|
|
||||||
/>
|
/>
|
||||||
<my-notifications v-else-if="activeTab === 'MyNotifications'" />
|
<MyEvaluations v-else-if="activeTab === HomepageTabs.MyEvaluations" />
|
||||||
<my-workflows v-else-if="activeTab === 'MyWorkflows'" />
|
<MyTasks v-else-if="activeTab === HomepageTabs.MyTasks" />
|
||||||
|
<MyWorkflows v-else-if="activeTab === HomepageTabs.MyWorkflows" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts" setup>
|
||||||
import MyCustoms from "./MyCustoms";
|
import { ref, computed, onMounted } from "vue";
|
||||||
import MyWorks from "./MyWorks";
|
import { useStore } from "vuex";
|
||||||
import MyEvaluations from "./MyEvaluations";
|
|
||||||
import MyTasks from "./MyTasks";
|
|
||||||
import MyAccompanyingCourses from "./MyAccompanyingCourses";
|
|
||||||
import MyNotifications from "./MyNotifications";
|
|
||||||
import MyWorkflows from "./MyWorkflows.vue";
|
|
||||||
import TabCounter from "./TabCounter";
|
|
||||||
import { mapState } from "vuex";
|
|
||||||
|
|
||||||
export default {
|
// Components
|
||||||
name: "App",
|
import MyCustoms from "./MyCustoms.vue";
|
||||||
components: {
|
import MyEvaluations from "./MyEvaluations.vue";
|
||||||
MyCustoms,
|
import MyTasks from "./MyTasks.vue";
|
||||||
MyWorks,
|
import MyAccompanyingCourses from "./MyAccompanyingCourses.vue";
|
||||||
MyEvaluations,
|
import MyNotifications from "./MyNotifications.vue";
|
||||||
MyTasks,
|
import MyWorkflows from "./MyWorkflows.vue";
|
||||||
MyWorkflows,
|
import MyTickets from "./MyTickets.vue";
|
||||||
MyAccompanyingCourses,
|
import TabCounter from "./TabCounter.vue";
|
||||||
MyNotifications,
|
|
||||||
TabCounter,
|
// Translations
|
||||||
|
import {
|
||||||
|
MAIN_TITLE,
|
||||||
|
MY_TICKETS_TAB,
|
||||||
|
MY_EVALUATIONS_TAB,
|
||||||
|
MY_TASKS_TAB,
|
||||||
|
MY_ACCOMPANYING_COURSES_TAB,
|
||||||
|
MY_NOTIFICATIONS_TAB,
|
||||||
|
MY_WORKFLOWS_TAB,
|
||||||
|
LOADING,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
|
// Types
|
||||||
|
import {
|
||||||
|
HomepageConfig,
|
||||||
|
HomepageTabs,
|
||||||
|
TabDefinition,
|
||||||
|
} from "ChillMainAssets/types";
|
||||||
|
|
||||||
|
const store = useStore();
|
||||||
|
|
||||||
|
defineExpose({ HomepageTabs });
|
||||||
|
|
||||||
|
const homepageConfig = ref<HomepageConfig>(JSON.parse(window.homepage_config));
|
||||||
|
const state = computed(() => store.state.homepage);
|
||||||
|
const ticketListState = computed(() => store.state.ticketList);
|
||||||
|
|
||||||
|
const tabDefinitions: TabDefinition[] = [
|
||||||
|
{
|
||||||
|
key: HomepageTabs.MyCustoms,
|
||||||
|
label: "",
|
||||||
|
icon: "fa fa-dashboard",
|
||||||
|
counter: () => 0,
|
||||||
},
|
},
|
||||||
data() {
|
{
|
||||||
return {
|
key: HomepageTabs.MyTickets,
|
||||||
activeTab: "MyCustoms",
|
label: trans(MY_TICKETS_TAB),
|
||||||
};
|
icon: null,
|
||||||
|
counter: () => ticketListState.value?.count,
|
||||||
},
|
},
|
||||||
computed: {
|
{
|
||||||
...mapState(["loading"]),
|
key: HomepageTabs.MyNotifications,
|
||||||
// just to see all in devtool :
|
label: trans(MY_NOTIFICATIONS_TAB),
|
||||||
...mapState({
|
icon: null,
|
||||||
state: (state) => state,
|
counter: () => state.value?.notifications?.count,
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
methods: {
|
{
|
||||||
selectTab(tab) {
|
key: HomepageTabs.MyAccompanyingCourses,
|
||||||
if (tab !== "MyCustoms") {
|
label: trans(MY_ACCOMPANYING_COURSES_TAB),
|
||||||
this.$store.dispatch("getByTab", { tab: tab });
|
icon: null,
|
||||||
|
counter: () => state.value?.accompanyingCourses?.count,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: HomepageTabs.MyEvaluations,
|
||||||
|
label: trans(MY_EVALUATIONS_TAB),
|
||||||
|
icon: null,
|
||||||
|
counter: () => state.value?.evaluations?.count,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: HomepageTabs.MyTasks,
|
||||||
|
label: trans(MY_TASKS_TAB),
|
||||||
|
icon: null,
|
||||||
|
counter: () =>
|
||||||
|
state.value?.tasks?.warning?.count + state.value?.tasks?.alert?.count,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: HomepageTabs.MyWorkflows,
|
||||||
|
label: trans(MY_WORKFLOWS_TAB),
|
||||||
|
icon: null,
|
||||||
|
counter: () =>
|
||||||
|
state.value?.workflows?.count + state.value?.workflowsCc?.count,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const displayedTabs = computed(() => {
|
||||||
|
// Always show MyCustoms first if present
|
||||||
|
const tabs = [] as TabDefinition[];
|
||||||
|
for (const tabEnum of homepageConfig.value.displayTabs) {
|
||||||
|
const def = tabDefinitions.find(
|
||||||
|
(t) => t.key === Number(HomepageTabs[tabEnum]),
|
||||||
|
);
|
||||||
|
if (def) tabs.push(def);
|
||||||
}
|
}
|
||||||
this.activeTab = tab;
|
return tabs.filter(Boolean);
|
||||||
console.log(this.activeTab);
|
});
|
||||||
},
|
|
||||||
},
|
const activeTab = ref(Number(HomepageTabs[homepageConfig.value.defaultTab]));
|
||||||
mounted() {
|
|
||||||
for (const m of [
|
const loading = computed(() => store.state.loading);
|
||||||
"MyNotifications",
|
|
||||||
"MyAccompanyingCourses",
|
function selectTab(tab: HomepageTabs) {
|
||||||
// 'MyWorks',
|
if (tab !== HomepageTabs.MyCustoms) {
|
||||||
"MyEvaluations",
|
store.dispatch("getByTab", { tab: tab });
|
||||||
"MyTasks",
|
|
||||||
"MyWorkflows",
|
|
||||||
]) {
|
|
||||||
this.$store.dispatch("getByTab", { tab: m, param: "countOnly=1" });
|
|
||||||
}
|
}
|
||||||
},
|
activeTab.value = tab;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
for (const tab of displayedTabs.value) {
|
||||||
|
if (tab.key !== HomepageTabs.MyCustoms) {
|
||||||
|
store.dispatch("getByTab", { tab: tab.key, param: "countOnly=1" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@@ -25,11 +25,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
<p class="news-date">
|
<p class="news-date">
|
||||||
<time
|
<time class="createdBy" datetime="{{item.startDate.datetime}}">{{
|
||||||
class="createdBy"
|
$d(newsItemStartDate(), "text")
|
||||||
datetime="{{item.startDate.datetime}}"
|
}}</time>
|
||||||
>{{ $d(newsItemStartDate(), "text") }}</time
|
|
||||||
>
|
|
||||||
</p>
|
</p>
|
||||||
<div v-html="convertMarkdownToHtml(item.content)"></div>
|
<div v-html="convertMarkdownToHtml(item.content)"></div>
|
||||||
</template>
|
</template>
|
||||||
@@ -93,10 +91,7 @@ const truncateContent = (content: string): string => {
|
|||||||
|
|
||||||
// Truncate if amount of lines are too many
|
// Truncate if amount of lines are too many
|
||||||
if (lines.length > props.maxLines && content.length < props.maxLength) {
|
if (lines.length > props.maxLines && content.length < props.maxLength) {
|
||||||
const truncatedContent = lines
|
const truncatedContent = lines.slice(0, props.maxLines).join("\n").trim();
|
||||||
.slice(0, props.maxLines)
|
|
||||||
.join("\n")
|
|
||||||
.trim();
|
|
||||||
return truncatedContent + "...";
|
return truncatedContent + "...";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,8 +120,7 @@ const truncateContent = (content: string): string => {
|
|||||||
if (linkStartIndex !== -1) {
|
if (linkStartIndex !== -1) {
|
||||||
const linkEndIndex = content.indexOf(")", linkStartIndex);
|
const linkEndIndex = content.indexOf(")", linkStartIndex);
|
||||||
const url = content.slice(linkStartIndex + 1, linkEndIndex);
|
const url = content.slice(linkStartIndex + 1, linkEndIndex);
|
||||||
truncatedContent =
|
truncatedContent = truncatedContent.slice(0, linkStartIndex) + `(${url})`;
|
||||||
truncatedContent.slice(0, linkStartIndex) + `(${url})`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
truncatedContent += "...";
|
truncatedContent += "...";
|
||||||
|
@@ -1,47 +1,40 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="alert alert-light">
|
<div class="alert alert-light">
|
||||||
{{ $t("my_accompanying_courses.description") }}
|
{{ trans(MY_ACCOMPANYING_COURSES_DESCRIPTION) }}
|
||||||
</div>
|
</div>
|
||||||
<span v-if="noResults" class="chill-no-data-statement">{{
|
<span v-if="noResults" class="chill-no-data-statement">
|
||||||
$t("no_data")
|
{{ trans(NO_DATA) }}
|
||||||
}}</span>
|
</span>
|
||||||
<tab-table v-else>
|
<tab-table v-else>
|
||||||
<template #thead>
|
<template #thead>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("opening_date") }}
|
{{ trans(OPENING_DATE) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("social_issues") }}
|
{{ trans(SOCIAL_ISSUES) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("concerned_persons") }}
|
{{ trans(CONCERNED_PERSONS) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" />
|
<th scope="col" />
|
||||||
<th scope="col" />
|
<th scope="col" />
|
||||||
</template>
|
</template>
|
||||||
<template #tbody>
|
<template #tbody>
|
||||||
<tr
|
<tr v-for="(c, i) in accompanyingCourses.results" :key="`course-${i}`">
|
||||||
v-for="(c, i) in accompanyingCourses.results"
|
<td>{{ $d(new Date(c.openingDate.datetime), "short") }}</td>
|
||||||
:key="`course-${i}`"
|
|
||||||
>
|
|
||||||
<td>{{ $d(c.openingDate.datetime, "short") }}</td>
|
|
||||||
<td>
|
<td>
|
||||||
<span
|
<span
|
||||||
v-for="(i, index) in c.socialIssues"
|
v-for="(issue, index) in c.socialIssues"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="chill-entity entity-social-issue"
|
class="chill-entity entity-social-issue"
|
||||||
>
|
>
|
||||||
<span class="badge bg-chill-l-gray text-dark">
|
<span class="badge bg-chill-l-gray text-dark">
|
||||||
{{ localizeString(i.title) }}
|
{{ localizeString(issue.title) }}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span
|
<span v-for="p in c.participations" class="me-1" :key="p.person.id">
|
||||||
v-for="p in c.participations"
|
|
||||||
class="me-1"
|
|
||||||
:key="p.person.id"
|
|
||||||
>
|
|
||||||
<on-the-fly
|
<on-the-fly
|
||||||
:type="p.person.type"
|
:type="p.person.type"
|
||||||
:id="p.person.id"
|
:id="p.person.id"
|
||||||
@@ -52,20 +45,16 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span
|
<span v-if="c.emergency" class="badge rounded-pill bg-danger me-1">{{
|
||||||
v-if="c.emergency"
|
trans(EMERGENCY)
|
||||||
class="badge rounded-pill bg-danger me-1"
|
}}</span>
|
||||||
>{{ $t("emergency") }}</span
|
<span v-if="c.confidential" class="badge rounded-pill bg-danger">{{
|
||||||
>
|
trans(CONFIDENTIAL)
|
||||||
<span
|
}}</span>
|
||||||
v-if="c.confidential"
|
|
||||||
class="badge rounded-pill bg-danger"
|
|
||||||
>{{ $t("confidential") }}</span
|
|
||||||
>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-sm btn-show" :href="getUrl(c)">
|
<a class="btn btn-sm btn-show" :href="getUrl(c)">
|
||||||
{{ $t("show_entity", { entity: $t("the_course") }) }}
|
{{ trans(SHOW_ENTITY, { entity: trans(THE_COURSE) }) }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -73,36 +62,45 @@
|
|||||||
</tab-table>
|
</tab-table>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts" setup>
|
||||||
import { mapState, mapGetters } from "vuex";
|
import { computed, ComputedRef } from "vue";
|
||||||
import TabTable from "./TabTable";
|
import { useStore } from "vuex";
|
||||||
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly";
|
import TabTable from "./TabTable.vue";
|
||||||
|
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue";
|
||||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||||
|
import { AccompanyingCourse } from "ChillPersonAssets/types";
|
||||||
|
import { PaginationResponse } from "ChillMainAssets/lib/api/apiMethods";
|
||||||
|
import {
|
||||||
|
MY_ACCOMPANYING_COURSES_DESCRIPTION,
|
||||||
|
OPENING_DATE,
|
||||||
|
SOCIAL_ISSUES,
|
||||||
|
CONCERNED_PERSONS,
|
||||||
|
SHOW_ENTITY,
|
||||||
|
THE_COURSE,
|
||||||
|
NO_DATA,
|
||||||
|
EMERGENCY,
|
||||||
|
CONFIDENTIAL,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
const store = useStore();
|
||||||
|
|
||||||
export default {
|
const accompanyingCourses: ComputedRef<PaginationResponse<AccompanyingCourse>> =
|
||||||
name: "MyAccompanyingCourses",
|
computed(() => store.state.homepage.accompanyingCourses);
|
||||||
components: {
|
const isAccompanyingCoursesLoaded = computed(
|
||||||
TabTable,
|
() => store.getters.isAccompanyingCoursesLoaded,
|
||||||
OnTheFly,
|
);
|
||||||
},
|
|
||||||
computed: {
|
const noResults = computed(() => {
|
||||||
...mapState(["accompanyingCourses"]),
|
if (!isAccompanyingCoursesLoaded.value) {
|
||||||
...mapGetters(["isAccompanyingCoursesLoaded"]),
|
|
||||||
noResults() {
|
|
||||||
if (!this.isAccompanyingCoursesLoaded) {
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return this.accompanyingCourses.count === 0;
|
return accompanyingCourses.value.count === 0;
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
},
|
|
||||||
methods: {
|
function getUrl(c: { id: number }): string {
|
||||||
localizeString,
|
|
||||||
getUrl(c) {
|
|
||||||
return `/fr/parcours/${c.id}`;
|
return `/fr/parcours/${c.id}`;
|
||||||
},
|
}
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@@ -1,95 +1,72 @@
|
|||||||
<template>
|
<template>
|
||||||
<span v-if="noResults" class="chill-no-data-statement">{{
|
<span v-if="noResults" class="chill-no-data-statement">
|
||||||
$t("no_dashboard")
|
{{ trans(NO_DASHBOARD) }}
|
||||||
}}</span>
|
</span>
|
||||||
<div v-else id="dashboards" class="container g-3">
|
<div v-else id="dashboards" class="container g-3">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="mbloc col-xs-12 col-sm-4">
|
<div class="mbloc col-xs-12 col-sm-4">
|
||||||
<div class="custom1">
|
<div class="custom1">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li v-if="counter.notifications > 0">
|
<li v-if="(counter.value?.notifications || 0) > 0">
|
||||||
<i18n-t
|
<span :class="counterClass">
|
||||||
keypath="counter.unread_notifications"
|
{{
|
||||||
tag="span"
|
trans(COUNTER_UNREAD_NOTIFICATIONS, {
|
||||||
:class="counterClass"
|
n: counter.value?.notifications || 0,
|
||||||
:plural="counter.notifications"
|
})
|
||||||
>
|
}}
|
||||||
<template #n>
|
</span>
|
||||||
<span>{{ counter.notifications }}</span>
|
|
||||||
</template>
|
|
||||||
</i18n-t>
|
|
||||||
</li>
|
</li>
|
||||||
<li v-if="counter.accompanyingCourses > 0">
|
<li v-if="(counter.value?.accompanyingCourses || 0) > 0">
|
||||||
<i18n-t
|
<span :class="counterClass">
|
||||||
keypath="counter.assignated_courses"
|
{{
|
||||||
tag="span"
|
trans(COUNTER_ASSIGNATED_COURSES, {
|
||||||
:class="counterClass"
|
n: counter.value?.accompanyingCourses || 0,
|
||||||
:plural="counter.accompanyingCourses"
|
})
|
||||||
>
|
}}
|
||||||
<template #n>
|
</span>
|
||||||
<span>{{
|
|
||||||
counter.accompanyingCourses
|
|
||||||
}}</span>
|
|
||||||
</template>
|
|
||||||
</i18n-t>
|
|
||||||
</li>
|
</li>
|
||||||
<li v-if="counter.works > 0">
|
<li v-if="(counter.value?.works || 0) > 0">
|
||||||
<i18n-t
|
<span :class="counterClass">
|
||||||
keypath="counter.assignated_actions"
|
{{
|
||||||
tag="span"
|
trans(COUNTER_ASSIGNATED_ACTIONS, {
|
||||||
:class="counterClass"
|
n: counter.value?.works || 0,
|
||||||
:plural="counter.works"
|
})
|
||||||
>
|
}}
|
||||||
<template #n>
|
</span>
|
||||||
<span>{{ counter.works }}</span>
|
|
||||||
</template>
|
|
||||||
</i18n-t>
|
|
||||||
</li>
|
</li>
|
||||||
<li v-if="counter.evaluations > 0">
|
<li v-if="(counter.value?.evaluations || 0) > 0">
|
||||||
<i18n-t
|
<span :class="counterClass">
|
||||||
keypath="counter.assignated_evaluations"
|
{{
|
||||||
tag="span"
|
trans(COUNTER_ASSIGNATED_EVALUATIONS, {
|
||||||
:class="counterClass"
|
n: counter.value?.evaluations || 0,
|
||||||
:plural="counter.evaluations"
|
})
|
||||||
>
|
}}
|
||||||
<template #n>
|
</span>
|
||||||
<span>{{ counter.evaluations }}</span>
|
|
||||||
</template>
|
|
||||||
</i18n-t>
|
|
||||||
</li>
|
</li>
|
||||||
<li v-if="counter.tasksAlert > 0">
|
<li v-if="(counter.value?.tasksAlert || 0) > 0">
|
||||||
<i18n-t
|
<span :class="counterClass">
|
||||||
keypath="counter.alert_tasks"
|
{{
|
||||||
tag="span"
|
trans(COUNTER_ALERT_TASKS, {
|
||||||
:class="counterClass"
|
n: counter.value?.tasksAlert || 0,
|
||||||
:plural="counter.tasksAlert"
|
})
|
||||||
>
|
}}
|
||||||
<template #n>
|
</span>
|
||||||
<span>{{ counter.tasksAlert }}</span>
|
|
||||||
</template>
|
|
||||||
</i18n-t>
|
|
||||||
</li>
|
</li>
|
||||||
<li v-if="counter.tasksWarning > 0">
|
<li v-if="(counter.value?.tasksWarning || 0) > 0">
|
||||||
<i18n-t
|
<span :class="counterClass">
|
||||||
keypath="counter.warning_tasks"
|
{{
|
||||||
tag="span"
|
trans(COUNTER_WARNING_TASKS, {
|
||||||
:class="counterClass"
|
n: counter.value?.tasksWarning || 0,
|
||||||
:plural="counter.tasksWarning"
|
})
|
||||||
>
|
}}
|
||||||
<template #n>
|
</span>
|
||||||
<span>{{ counter.tasksWarning }}</span>
|
|
||||||
</template>
|
|
||||||
</i18n-t>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template v-if="this.hasDashboardItems">
|
<template v-if="hasDashboardItems">
|
||||||
<template
|
<template v-for="(dashboardItem, index) in dashboardItems" :key="index">
|
||||||
v-for="(dashboardItem, index) in this.dashboardItems"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
class="mbloc col-xs-12 col-sm-8 news"
|
class="mbloc col-xs-12 col-sm-8 news"
|
||||||
v-if="dashboardItem.type === 'news'"
|
v-if="dashboardItem.type === 'news'"
|
||||||
@@ -102,44 +79,53 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts" setup>
|
||||||
import { mapGetters } from "vuex";
|
import { ref, computed, onMounted } from "vue";
|
||||||
|
import { useStore } from "vuex";
|
||||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||||
import News from "./DashboardWidgets/News.vue";
|
import News from "./DashboardWidgets/News.vue";
|
||||||
|
import {
|
||||||
|
NO_DASHBOARD,
|
||||||
|
COUNTER_UNREAD_NOTIFICATIONS,
|
||||||
|
COUNTER_ASSIGNATED_COURSES,
|
||||||
|
COUNTER_ASSIGNATED_ACTIONS,
|
||||||
|
COUNTER_ASSIGNATED_EVALUATIONS,
|
||||||
|
COUNTER_ALERT_TASKS,
|
||||||
|
COUNTER_WARNING_TASKS,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
export default {
|
interface MyCustom {
|
||||||
name: "MyCustoms",
|
id: number;
|
||||||
components: {
|
type: string;
|
||||||
News,
|
metadata: Record<string, unknown>;
|
||||||
},
|
userId: number;
|
||||||
data() {
|
position: string;
|
||||||
return {
|
}
|
||||||
counterClass: {
|
|
||||||
counter: true, //hack to pass class 'counter' in i18n-t
|
const store = useStore();
|
||||||
},
|
|
||||||
dashboardItems: [],
|
const counter = computed(() => store.getters.counter);
|
||||||
masonry: null,
|
|
||||||
};
|
const counterClass = { counter: true };
|
||||||
},
|
|
||||||
computed: {
|
const dashboardItems = ref<MyCustom[]>([]);
|
||||||
...mapGetters(["counter"]),
|
|
||||||
noResults() {
|
const noResults = computed(() => false);
|
||||||
return false;
|
|
||||||
},
|
const hasDashboardItems = computed(() => dashboardItems.value.length > 0);
|
||||||
hasDashboardItems() {
|
|
||||||
return this.dashboardItems.length > 0;
|
onMounted(async () => {
|
||||||
},
|
try {
|
||||||
},
|
const response: MyCustom[] = await makeFetch(
|
||||||
mounted() {
|
"GET",
|
||||||
makeFetch("GET", "/api/1.0/main/dashboard-config-item.json")
|
"/api/1.0/main/dashboard-config-item.json",
|
||||||
.then((response) => {
|
);
|
||||||
this.dashboardItems = response;
|
dashboardItems.value = response;
|
||||||
})
|
} catch (error) {
|
||||||
.catch((error) => {
|
|
||||||
throw error;
|
throw error;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@@ -1,50 +1,50 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="accompanying-course-work">
|
<div class="accompanying-course-work">
|
||||||
<div class="alert alert-light">
|
<div class="alert alert-light">
|
||||||
{{ $t("my_evaluations.description") }}
|
{{ trans(MY_EVALUATIONS_DESCRIPTION) }}
|
||||||
</div>
|
</div>
|
||||||
<span v-if="noResults" class="chill-no-data-statement">{{
|
<span v-if="noResults" class="chill-no-data-statement">
|
||||||
$t("no_data")
|
{{ trans(NO_DATA) }}
|
||||||
}}</span>
|
</span>
|
||||||
<tab-table v-else>
|
<tab-table v-else>
|
||||||
<template #thead>
|
<template #thead>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("max_date") }}
|
{{ trans(MAX_DATE) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("evaluation") }}
|
{{ trans(EVALUATION) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("SocialAction") }}
|
{{ trans(SOCIAL_ACTION) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" />
|
<th scope="col" />
|
||||||
</template>
|
</template>
|
||||||
<template #tbody>
|
<template #tbody>
|
||||||
<tr
|
<tr v-for="(e, i) in evaluations.results" :key="`evaluation-${i}`">
|
||||||
v-for="(e, i) in evaluations.results"
|
|
||||||
:key="`evaluation-${i}`"
|
|
||||||
>
|
|
||||||
<td>{{ $d(e.maxDate.datetime, "short") }}</td>
|
|
||||||
<td>
|
<td>
|
||||||
{{ localizeString(e.evaluation.title) }}
|
{{
|
||||||
|
e.maxDate?.datetime
|
||||||
|
? $d(new Date(e.maxDate.datetime), "short")
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ localizeString(e.evaluation?.title ?? null) }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="chill-entity entity-social-issue">
|
<span class="chill-entity entity-social-issue">
|
||||||
<span class="badge bg-chill-l-gray text-dark">
|
<span class="badge bg-chill-l-gray text-dark">
|
||||||
{{
|
{{ e.accompanyingPeriodWork?.socialAction?.issue?.text ?? "" }}
|
||||||
e.accompanyingPeriodWork.socialAction.issue
|
|
||||||
.text
|
|
||||||
}}
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<h4 class="badge-title">
|
<h4 class="badge-title">
|
||||||
<span class="title_label" />
|
<span class="title_label" />
|
||||||
<span class="title_action">
|
<span class="title_action">
|
||||||
{{ e.accompanyingPeriodWork.socialAction.text }}
|
{{ e.accompanyingPeriodWork?.socialAction?.text ?? "" }}
|
||||||
</span>
|
</span>
|
||||||
</h4>
|
</h4>
|
||||||
<span
|
<span
|
||||||
v-for="person in e.accompanyingPeriodWork.persons"
|
v-for="person in e.accompanyingPeriodWork?.persons ?? []"
|
||||||
class="me-1"
|
class="me-1"
|
||||||
:key="person.id"
|
:key="person.id"
|
||||||
>
|
>
|
||||||
@@ -58,30 +58,25 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div
|
<div class="btn-group-vertical" role="group" aria-label="Actions">
|
||||||
class="btn-group-vertical"
|
|
||||||
role="group"
|
|
||||||
aria-label="Actions"
|
|
||||||
>
|
|
||||||
<a class="btn btn-sm btn-show" :href="getUrl(e)">
|
<a class="btn btn-sm btn-show" :href="getUrl(e)">
|
||||||
{{
|
{{
|
||||||
$t("show_entity", {
|
trans(SHOW_ENTITY, {
|
||||||
entity: $t("the_evaluation"),
|
entity: trans(THE_EVALUATION),
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
class="btn btn-sm btn-show"
|
class="btn btn-sm btn-show"
|
||||||
:href="
|
:href="getUrl(e.accompanyingPeriodWork.accompanyingPeriod!)"
|
||||||
getUrl(
|
v-if="
|
||||||
e.accompanyingPeriodWork
|
e.accompanyingPeriodWork &&
|
||||||
.accompanyingPeriod,
|
e.accompanyingPeriodWork.accompanyingPeriod
|
||||||
)
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
$t("show_entity", {
|
trans(SHOW_ENTITY, {
|
||||||
entity: $t("the_course"),
|
entity: trans(THE_COURSE),
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
</a>
|
</a>
|
||||||
@@ -93,36 +88,60 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts" setup>
|
||||||
import { mapState, mapGetters } from "vuex";
|
import { computed } from "vue";
|
||||||
import TabTable from "./TabTable";
|
import { useStore } from "vuex";
|
||||||
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly";
|
import TabTable from "./TabTable.vue";
|
||||||
|
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue";
|
||||||
import { localizeString } from "../../lib/localizationHelper/localizationHelper";
|
import { localizeString } from "../../lib/localizationHelper/localizationHelper";
|
||||||
|
|
||||||
export default {
|
const store = useStore();
|
||||||
name: "MyEvaluations",
|
|
||||||
components: {
|
import type { ComputedRef } from "vue";
|
||||||
TabTable,
|
import {
|
||||||
OnTheFly,
|
AccompanyingPeriod,
|
||||||
},
|
AccompanyingPeriodWorkEvaluation,
|
||||||
computed: {
|
AccompanyingPeriodWork,
|
||||||
...mapState(["evaluations"]),
|
} from "ChillPersonAssets/types";
|
||||||
...mapGetters(["isEvaluationsLoaded"]),
|
import { PaginationResponse } from "ChillMainAssets/lib/api/apiMethods";
|
||||||
noResults() {
|
import {
|
||||||
if (!this.isEvaluationsLoaded) {
|
MY_EVALUATIONS_DESCRIPTION,
|
||||||
|
MAX_DATE,
|
||||||
|
EVALUATION,
|
||||||
|
SHOW_ENTITY,
|
||||||
|
THE_COURSE,
|
||||||
|
THE_EVALUATION,
|
||||||
|
SOCIAL_ACTION,
|
||||||
|
NO_DATA,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
const evaluations: ComputedRef<
|
||||||
|
PaginationResponse<AccompanyingPeriodWorkEvaluation>
|
||||||
|
> = computed(() => store.state.homepage.evaluations);
|
||||||
|
const isEvaluationsLoaded = computed(() => store.getters.isEvaluationsLoaded);
|
||||||
|
|
||||||
|
const noResults = computed(() => {
|
||||||
|
if (!isEvaluationsLoaded.value) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return this.evaluations.count === 0;
|
return evaluations.value.count === 0;
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
},
|
|
||||||
methods: {
|
function getUrl(
|
||||||
localizeString,
|
e:
|
||||||
getUrl(e) {
|
| AccompanyingPeriodWorkEvaluation
|
||||||
|
| AccompanyingPeriod
|
||||||
|
| AccompanyingPeriodWork,
|
||||||
|
): string {
|
||||||
|
if (!e) {
|
||||||
|
throw "entity is undefined";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("type" in e && typeof e.type === "string") {
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case "accompanying_period_work_evaluation":
|
case "accompanying_period_work_evaluation":
|
||||||
let anchor = "#evaluations";
|
return `/fr/person/accompanying-period/work/${e.accompanyingPeriodWork?.id}/edit#evaluations`;
|
||||||
return `/fr/person/accompanying-period/work/${e.accompanyingPeriodWork.id}/edit${anchor}`;
|
|
||||||
case "accompanying_period_work":
|
case "accompanying_period_work":
|
||||||
return `/fr/person/accompanying-period/work/${e.id}/edit`;
|
return `/fr/person/accompanying-period/work/${e.id}/edit`;
|
||||||
case "accompanying_period":
|
case "accompanying_period":
|
||||||
@@ -130,9 +149,9 @@ export default {
|
|||||||
default:
|
default:
|
||||||
throw "entity type unknown";
|
throw "entity type unknown";
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
return "";
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@@ -1,26 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="alert alert-light">
|
<div class="alert alert-light">
|
||||||
{{ $t("my_notifications.description") }}
|
{{ trans(MY_NOTIFICATIONS_DESCRIPTION) }}
|
||||||
</div>
|
</div>
|
||||||
<span v-if="noResults" class="chill-no-data-statement">{{
|
<span v-if="noResults" class="chill-no-data-statement">
|
||||||
$t("no_data")
|
{{ trans(NO_DATA) }}
|
||||||
}}</span>
|
</span>
|
||||||
<tab-table v-else>
|
<tab-table v-else>
|
||||||
<template #thead>
|
<template #thead>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("Date") }}
|
{{ trans(DATE) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("Subject") }}
|
{{ trans(SUBJECT) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("From") }}
|
{{ trans(FROM) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" />
|
<th scope="col" />
|
||||||
</template>
|
</template>
|
||||||
<template #tbody>
|
<template #tbody>
|
||||||
<tr v-for="(n, i) in notifications.results" :key="`notify-${i}`">
|
<tr v-for="(n, i) in notifications.results" :key="`notify-${i}`">
|
||||||
<td>{{ $d(n.date.datetime, "long") }}</td>
|
<td>{{ $d(new Date(n.date.datetime), "long") }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="unread">
|
<span class="unread">
|
||||||
<i class="fa fa-envelope-o" />
|
<i class="fa fa-envelope-o" />
|
||||||
@@ -31,11 +31,11 @@
|
|||||||
{{ n.sender.text }}
|
{{ n.sender.text }}
|
||||||
</td>
|
</td>
|
||||||
<td v-else>
|
<td v-else>
|
||||||
{{ $t("automatic_notification") }}
|
{{ trans(AUTOMATIC_NOTIFICATION) }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-sm btn-show" :href="getEntityUrl(n)">
|
<a class="btn btn-sm btn-show" :href="getEntityUrl(n)">
|
||||||
{{ $t("show_entity", { entity: getEntityName(n) }) }}
|
{{ trans(SHOW_ENTITY, { entity: getEntityName(n) }) }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -43,48 +43,67 @@
|
|||||||
</tab-table>
|
</tab-table>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts" setup>
|
||||||
import { mapState, mapGetters } from "vuex";
|
import { computed, ComputedRef } from "vue";
|
||||||
import TabTable from "./TabTable";
|
import { useStore } from "vuex";
|
||||||
import { appMessages } from "ChillMainAssets/vuejs/HomepageWidget/js/i18n";
|
import TabTable from "./TabTable.vue";
|
||||||
|
import { Notification } from "ChillPersonAssets/types";
|
||||||
|
|
||||||
export default {
|
import {
|
||||||
name: "MyNotifications",
|
MY_NOTIFICATIONS_DESCRIPTION,
|
||||||
components: {
|
DATE,
|
||||||
TabTable,
|
FROM,
|
||||||
},
|
SUBJECT,
|
||||||
computed: {
|
SHOW_ENTITY,
|
||||||
...mapState(["notifications"]),
|
THE_ACTIVITY,
|
||||||
...mapGetters(["isNotificationsLoaded"]),
|
THE_COURSE,
|
||||||
noResults() {
|
THE_ACTION,
|
||||||
if (!this.isNotificationsLoaded) {
|
THE_EVALUATION_DOCUMENT,
|
||||||
|
THE_WORKFLOW,
|
||||||
|
NO_DATA,
|
||||||
|
AUTOMATIC_NOTIFICATION,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
import { PaginationResponse } from "ChillMainAssets/lib/api/apiMethods";
|
||||||
|
const store = useStore();
|
||||||
|
|
||||||
|
const notifications: ComputedRef<PaginationResponse<Notification>> = computed(
|
||||||
|
() => store.state.homepage.notifications,
|
||||||
|
);
|
||||||
|
const isNotificationsLoaded = computed(
|
||||||
|
() => store.getters.isNotificationsLoaded,
|
||||||
|
);
|
||||||
|
|
||||||
|
const noResults = computed(() => {
|
||||||
|
if (!isNotificationsLoaded.value) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return this.notifications.count === 0;
|
return notifications.value.count === 0;
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
},
|
|
||||||
methods: {
|
function getNotificationUrl(n: Notification): string {
|
||||||
getNotificationUrl(n) {
|
|
||||||
return `/fr/notification/${n.id}/show`;
|
return `/fr/notification/${n.id}/show`;
|
||||||
},
|
}
|
||||||
getEntityName(n) {
|
|
||||||
|
function getEntityName(n: Notification): string {
|
||||||
switch (n.relatedEntityClass) {
|
switch (n.relatedEntityClass) {
|
||||||
case "Chill\\ActivityBundle\\Entity\\Activity":
|
case "Chill\\ActivityBundle\\Entity\\Activity":
|
||||||
return appMessages.fr.the_activity;
|
return trans(THE_ACTIVITY);
|
||||||
case "Chill\\PersonBundle\\Entity\\AccompanyingPeriod":
|
case "Chill\\PersonBundle\\Entity\\AccompanyingPeriod":
|
||||||
return appMessages.fr.the_course;
|
return trans(THE_COURSE);
|
||||||
case "Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork":
|
case "Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork":
|
||||||
return appMessages.fr.the_action;
|
return trans(THE_ACTION);
|
||||||
case "Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument":
|
case "Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument":
|
||||||
return appMessages.fr.the_evaluation_document;
|
return trans(THE_EVALUATION_DOCUMENT);
|
||||||
case "Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow":
|
case "Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow":
|
||||||
return appMessages.fr.the_workflow;
|
return trans(THE_WORKFLOW);
|
||||||
default:
|
default:
|
||||||
throw "notification type unknown";
|
throw "notification type unknown";
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
getEntityUrl(n) {
|
|
||||||
|
function getEntityUrl(n: Notification): string {
|
||||||
switch (n.relatedEntityClass) {
|
switch (n.relatedEntityClass) {
|
||||||
case "Chill\\ActivityBundle\\Entity\\Activity":
|
case "Chill\\ActivityBundle\\Entity\\Activity":
|
||||||
return `/fr/activity/${n.relatedEntityId}/show`;
|
return `/fr/activity/${n.relatedEntityId}/show`;
|
||||||
@@ -99,9 +118,7 @@ export default {
|
|||||||
default:
|
default:
|
||||||
throw "notification type unknown";
|
throw "notification type unknown";
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@@ -1,38 +1,38 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="alert alert-light">
|
<div class="alert alert-light">
|
||||||
{{ $t("my_tasks.description_warning") }}
|
{{ trans(MY_TASKS_DESCRIPTION_WARNING) }}
|
||||||
</div>
|
</div>
|
||||||
<span v-if="noResultsAlert" class="chill-no-data-statement">{{
|
<span v-if="noResultsAlert" class="chill-no-data-statement">
|
||||||
$t("no_data")
|
{{ trans(NO_DATA) }}
|
||||||
}}</span>
|
</span>
|
||||||
<tab-table v-else>
|
<tab-table v-else>
|
||||||
<template #thead>
|
<template #thead>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("warning_date") }}
|
{{ trans(WARNING_DATE) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("max_date") }}
|
{{ trans(MAX_DATE) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("task") }}
|
{{ trans(TASK) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" />
|
<th scope="col" />
|
||||||
</template>
|
</template>
|
||||||
<template #tbody>
|
<template #tbody>
|
||||||
<tr v-for="(t, i) in tasks.alert.results" :key="`task-alert-${i}`">
|
<tr v-for="(t, i) in tasks.alert.results" :key="`task-alert-${i}`">
|
||||||
<td v-if="null !== t.warningDate">
|
<td v-if="t.warningDate !== null">
|
||||||
{{ $d(t.warningDate.datetime, "short") }}
|
{{ $d(new Date(t.warningDate.datetime), "short") }}
|
||||||
</td>
|
</td>
|
||||||
<td v-else />
|
<td v-else />
|
||||||
<td>
|
<td>
|
||||||
<span class="outdated">{{
|
<span class="outdated">{{
|
||||||
$d(t.endDate.datetime, "short")
|
$d(new Date(t.endDate.datetime), "short")
|
||||||
}}</span>
|
}}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ t.title }}</td>
|
<td>{{ t.title }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-sm btn-show" :href="getUrl(t)">
|
<a class="btn btn-sm btn-show" :href="getUrl(t)">
|
||||||
{{ $t("show_entity", { entity: $t("the_task") }) }}
|
{{ trans(SHOW_ENTITY, { entity: trans(THE_TASK) }) }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -40,39 +40,36 @@
|
|||||||
</tab-table>
|
</tab-table>
|
||||||
|
|
||||||
<div class="alert alert-light">
|
<div class="alert alert-light">
|
||||||
{{ $t("my_tasks.description_alert") }}
|
{{ trans(MY_TASKS_DESCRIPTION_ALERT) }}
|
||||||
</div>
|
</div>
|
||||||
<span v-if="noResultsWarning" class="chill-no-data-statement">{{
|
<span v-if="noResultsWarning" class="chill-no-data-statement">
|
||||||
$t("no_data")
|
{{ trans(NO_DATA) }}
|
||||||
}}</span>
|
</span>
|
||||||
<tab-table v-else>
|
<tab-table v-else>
|
||||||
<template #thead>
|
<template #thead>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("warning_date") }}
|
{{ trans(WARNING_DATE) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("max_date") }}
|
{{ trans(MAX_DATE) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("task") }}
|
{{ trans(TASK) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" />
|
<th scope="col" />
|
||||||
</template>
|
</template>
|
||||||
<template #tbody>
|
<template #tbody>
|
||||||
<tr
|
<tr v-for="(t, i) in tasks.warning.results" :key="`task-warning-${i}`">
|
||||||
v-for="(t, i) in tasks.warning.results"
|
|
||||||
:key="`task-warning-${i}`"
|
|
||||||
>
|
|
||||||
<td>
|
<td>
|
||||||
<span class="outdated">{{
|
<span class="outdated">{{
|
||||||
$d(t.warningDate.datetime, "short")
|
$d(new Date(t.warningDate.datetime), "short")
|
||||||
}}</span>
|
}}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ $d(t.endDate.datetime, "short") }}</td>
|
<td>{{ $d(new Date(t.endDate.datetime), "short") }}</td>
|
||||||
<td>{{ t.title }}</td>
|
<td>{{ t.title }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-sm btn-show" :href="getUrl(t)">
|
<a class="btn btn-sm btn-show" :href="getUrl(t)">
|
||||||
{{ $t("show_entity", { entity: $t("the_task") }) }}
|
{{ trans(SHOW_ENTITY, { entity: trans(THE_TASK) }) }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -80,39 +77,51 @@
|
|||||||
</tab-table>
|
</tab-table>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts" setup>
|
||||||
import { mapState, mapGetters } from "vuex";
|
import { computed, ComputedRef } from "vue";
|
||||||
import TabTable from "./TabTable";
|
import { useStore } from "vuex";
|
||||||
|
import TabTable from "./TabTable.vue";
|
||||||
|
import {
|
||||||
|
MY_TASKS_DESCRIPTION_ALERT,
|
||||||
|
MY_TASKS_DESCRIPTION_WARNING,
|
||||||
|
MAX_DATE,
|
||||||
|
WARNING_DATE,
|
||||||
|
TASK,
|
||||||
|
SHOW_ENTITY,
|
||||||
|
THE_TASK,
|
||||||
|
NO_DATA,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
import { TasksState } from "./store/modules/homepage";
|
||||||
|
import { Alert, Warning } from "ChillPersonAssets/types";
|
||||||
|
|
||||||
export default {
|
const store = useStore();
|
||||||
name: "MyTasks",
|
|
||||||
components: {
|
const tasks: ComputedRef<TasksState> = computed(
|
||||||
TabTable,
|
() => store.state.homepage.tasks,
|
||||||
},
|
);
|
||||||
computed: {
|
const isTasksWarningLoaded = computed(() => store.getters.isTasksWarningLoaded);
|
||||||
...mapState(["tasks"]),
|
const isTasksAlertLoaded = computed(() => store.getters.isTasksAlertLoaded);
|
||||||
...mapGetters(["isTasksWarningLoaded", "isTasksAlertLoaded"]),
|
|
||||||
noResultsAlert() {
|
const noResultsAlert = computed(() => {
|
||||||
if (!this.isTasksAlertLoaded) {
|
if (!isTasksAlertLoaded.value) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return this.tasks.alert.count === 0;
|
return tasks.value.alert.count === 0;
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
noResultsWarning() {
|
|
||||||
if (!this.isTasksWarningLoaded) {
|
const noResultsWarning = computed(() => {
|
||||||
|
if (!isTasksWarningLoaded.value) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return this.tasks.warning.count === 0;
|
return tasks.value.warning.count === 0;
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
},
|
|
||||||
methods: {
|
function getUrl(t: Warning | Alert): string {
|
||||||
getUrl(t) {
|
|
||||||
return `/fr/task/single-task/${t.id}/show`;
|
return `/fr/task/single-task/${t.id}/show`;
|
||||||
},
|
}
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@@ -0,0 +1,58 @@
|
|||||||
|
<template>
|
||||||
|
<div class="col-12">
|
||||||
|
<!-- Loading state -->
|
||||||
|
<div
|
||||||
|
v-if="isTicketLoading"
|
||||||
|
class="d-flex justify-content-center align-items-center"
|
||||||
|
style="height: 200px"
|
||||||
|
>
|
||||||
|
<div class="text-center">
|
||||||
|
<div class="spinner-border mb-3" role="status">
|
||||||
|
<span class="visually-hidden">{{
|
||||||
|
trans(CHILL_TICKET_LIST_LOADING_TICKET)
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="text-muted">
|
||||||
|
{{ trans(CHILL_TICKET_LIST_LOADING_TICKET) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Ticket list -->
|
||||||
|
<ticket-list-component
|
||||||
|
v-else
|
||||||
|
:tickets="ticketList"
|
||||||
|
title=""
|
||||||
|
:hasMoreTickets="pagination.next !== null"
|
||||||
|
@fetchNextPage="fetchNextPage"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed } from "vue";
|
||||||
|
import { useStore } from "vuex";
|
||||||
|
// Components
|
||||||
|
import TicketListComponent from "../../../../../ChillTicketBundle/src/Resources/public/vuejs/TicketList/components/TicketListComponent.vue";
|
||||||
|
|
||||||
|
// Types
|
||||||
|
import { Pagination } from "ChillMainAssets/lib/api/apiMethods";
|
||||||
|
import { TicketSimple } from "src/Bundle/ChillTicketBundle/src/Resources/public/types";
|
||||||
|
|
||||||
|
// Translation
|
||||||
|
import { CHILL_TICKET_LIST_LOADING_TICKET, trans } from "translator";
|
||||||
|
|
||||||
|
const store = useStore();
|
||||||
|
const pagination = computed(() => store.getters.getPagination as Pagination);
|
||||||
|
|
||||||
|
const ticketList = computed(
|
||||||
|
() => store.getters.getTicketList as TicketSimple[],
|
||||||
|
);
|
||||||
|
const isTicketLoading = computed(() => store.getters.isTicketLoading);
|
||||||
|
|
||||||
|
const fetchNextPage = async () => {
|
||||||
|
if (pagination.value.next) {
|
||||||
|
await store.dispatch("fetchTicketListByUrl", pagination.value.next);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@@ -1,26 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="alert alert-light">
|
<div class="alert alert-light">
|
||||||
{{ $t("my_workflows.description") }}
|
{{ trans(MY_WORKFLOWS_DESCRIPTION) }}
|
||||||
</div>
|
</div>
|
||||||
<my-workflows-table :workflows="workflows" />
|
<my-workflows-table :workflows="workflows" />
|
||||||
|
|
||||||
<div class="alert alert-light">
|
<div class="alert alert-light">
|
||||||
{{ $t("my_workflows.description_cc") }}
|
{{ trans(MY_WORKFLOWS_DESCRIPTION_CC) }}
|
||||||
</div>
|
</div>
|
||||||
<my-workflows-table :workflows="workflowsCc" />
|
<my-workflows-table :workflows="workflowsCc" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts" setup>
|
||||||
import { mapState } from "vuex";
|
import { computed } from "vue";
|
||||||
|
import { useStore } from "vuex";
|
||||||
import MyWorkflowsTable from "./MyWorkflowsTable.vue";
|
import MyWorkflowsTable from "./MyWorkflowsTable.vue";
|
||||||
|
import {
|
||||||
|
MY_WORKFLOWS_DESCRIPTION,
|
||||||
|
MY_WORKFLOWS_DESCRIPTION_CC,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
export default {
|
const store = useStore();
|
||||||
name: "MyWorkflows",
|
|
||||||
components: {
|
const workflows = computed(() => store.state.homepage.workflows);
|
||||||
MyWorkflowsTable,
|
const workflowsCc = computed(() => store.state.homepage.workflowsCc);
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["workflows", "workflowsCc"]),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
@@ -1,17 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<span v-if="hasNoResults(workflows)" class="chill-no-data-statement">{{
|
<span v-if="hasNoResults" class="chill-no-data-statement">
|
||||||
$t("no_data")
|
{{ trans(NO_DATA) }}
|
||||||
}}</span>
|
</span>
|
||||||
<tab-table v-else>
|
<tab-table v-else>
|
||||||
<template #thead>
|
<template #thead>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("Object_workflow") }}
|
{{ trans(OBJECT_WORKFLOW) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("Step") }}
|
{{ trans(STEP) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("concerned_users") }}
|
{{ trans(CONCERNED_USERS) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" />
|
<th scope="col" />
|
||||||
</template>
|
</template>
|
||||||
@@ -23,15 +23,13 @@
|
|||||||
<td>
|
<td>
|
||||||
<div class="workflow">
|
<div class="workflow">
|
||||||
<div class="breadcrumb">
|
<div class="breadcrumb">
|
||||||
<i
|
<i class="fa fa-circle me-1 text-chill-yellow mx-2" />
|
||||||
class="fa fa-circle me-1 text-chill-yellow mx-2"
|
|
||||||
/>
|
|
||||||
<span class="mx-2">{{ getStep(w) }}</span>
|
<span class="mx-2">{{ getStep(w) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
v-if="w.isOnHoldAtCurrentStep"
|
v-if="w.isOnHoldAtCurrentStep"
|
||||||
class="badge bg-success rounded-pill"
|
class="badge bg-success rounded-pill"
|
||||||
>{{ $t("on_hold") }}</span
|
>{{ trans(ON_HOLD) }}</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -48,7 +46,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-sm btn-show" :href="getUrl(w)">
|
<a class="btn btn-sm btn-show" :href="getUrl(w)">
|
||||||
{{ $t("show_entity", { entity: $t("the_workflow") }) }}
|
{{ trans(SHOW_ENTITY, { entity: trans(THE_WORKFLOW) }) }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -56,38 +54,48 @@
|
|||||||
</tab-table>
|
</tab-table>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts" setup>
|
||||||
import { mapGetters } from "vuex";
|
import { computed } from "vue";
|
||||||
import TabTable from "./TabTable";
|
import { useStore } from "vuex";
|
||||||
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly";
|
import TabTable from "./TabTable.vue";
|
||||||
|
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue";
|
||||||
|
import { Workflow } from "ChillPersonAssets/types";
|
||||||
|
import {
|
||||||
|
CONCERNED_USERS,
|
||||||
|
OBJECT_WORKFLOW,
|
||||||
|
ON_HOLD,
|
||||||
|
SHOW_ENTITY,
|
||||||
|
THE_WORKFLOW,
|
||||||
|
NO_DATA,
|
||||||
|
STEP,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
import { PaginationResponse } from "ChillMainAssets/lib/api/apiMethods";
|
||||||
|
|
||||||
export default {
|
const props = defineProps<{
|
||||||
name: "MyWorkflows",
|
workflows: PaginationResponse<Workflow>;
|
||||||
components: {
|
}>();
|
||||||
TabTable,
|
|
||||||
OnTheFly,
|
const store = useStore();
|
||||||
},
|
|
||||||
props: ["workflows"],
|
const isWorkflowsLoaded = computed(() => store.getters.isWorkflowsLoaded);
|
||||||
computed: {
|
|
||||||
...mapGetters(["isWorkflowsLoaded"]),
|
const hasNoResults = computed(() => {
|
||||||
},
|
if (!isWorkflowsLoaded.value) {
|
||||||
methods: {
|
|
||||||
hasNoResults(workflows) {
|
|
||||||
if (!this.isWorkflowsLoaded) {
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return workflows.count === 0;
|
return props.workflows.count === 0;
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
getUrl(w) {
|
|
||||||
|
function getUrl(w: Workflow): string {
|
||||||
return `/fr/main/workflow/${w.id}/show`;
|
return `/fr/main/workflow/${w.id}/show`;
|
||||||
},
|
}
|
||||||
getStep(w) {
|
|
||||||
|
function getStep(w: Workflow): string {
|
||||||
const lastStep = w.steps.length - 1;
|
const lastStep = w.steps.length - 1;
|
||||||
return w.steps[lastStep].currentStep.text;
|
return w.steps[lastStep].currentStep.text;
|
||||||
},
|
}
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@@ -1,27 +1,26 @@
|
|||||||
// CURRENTLY NOT IN USE
|
|
||||||
<template>
|
<template>
|
||||||
<div class="accompanying-course-work">
|
<div class="accompanying-course-work">
|
||||||
<div class="alert alert-light">
|
<div class="alert alert-light">
|
||||||
{{ $t("my_works.description") }}
|
{{ trans(MY_WORKS_DESCRIPTION) }}
|
||||||
</div>
|
</div>
|
||||||
<span v-if="noResults" class="chill-no-data-statement">{{
|
<span v-if="noResults" class="chill-no-data-statement">
|
||||||
$t("no_data")
|
{{ trans(NO_DATA) }}
|
||||||
}}</span>
|
</span>
|
||||||
<tab-table v-else>
|
<tab-table v-else>
|
||||||
<template #thead>
|
<template #thead>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("StartDate") }}
|
{{ trans(START_DATE) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("SocialAction") }}
|
{{ trans(SOCIAL_ACTION) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ $t("concerned_persons") }}
|
{{ trans(CONCERNED_PERSONS) }}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" />
|
<th scope="col" />
|
||||||
</template>
|
</template>
|
||||||
<template #tbody>
|
<template #tbody>
|
||||||
<tr v-for="(w, i) in works.results" :key="`works-${i}`">
|
<tr v-for="(w, i) in works.value.results" :key="`works-${i}`">
|
||||||
<td>{{ $d(w.startDate.datetime, "short") }}</td>
|
<td>{{ $d(w.startDate.datetime, "short") }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="chill-entity entity-social-issue">
|
<span class="chill-entity entity-social-issue">
|
||||||
@@ -37,11 +36,7 @@
|
|||||||
</h4>
|
</h4>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span
|
<span v-for="person in w.persons" class="me-1" :key="person.id">
|
||||||
v-for="person in w.persons"
|
|
||||||
class="me-1"
|
|
||||||
:key="person.id"
|
|
||||||
>
|
|
||||||
<on-the-fly
|
<on-the-fly
|
||||||
:type="person.type"
|
:type="person.type"
|
||||||
:id="person.id"
|
:id="person.id"
|
||||||
@@ -52,15 +47,11 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div
|
<div class="btn-group-vertical" role="group" aria-label="Actions">
|
||||||
class="btn-group-vertical"
|
|
||||||
role="group"
|
|
||||||
aria-label="Actions"
|
|
||||||
>
|
|
||||||
<a class="btn btn-sm btn-update" :href="getUrl(w)">
|
<a class="btn btn-sm btn-update" :href="getUrl(w)">
|
||||||
{{
|
{{
|
||||||
$t("show_entity", {
|
trans(SHOW_ENTITY, {
|
||||||
entity: $t("the_action"),
|
entity: trans(THE_ACTION),
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
</a>
|
</a>
|
||||||
@@ -69,8 +60,8 @@
|
|||||||
:href="getUrl(w.accompanyingPeriod)"
|
:href="getUrl(w.accompanyingPeriod)"
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
$t("show_entity", {
|
trans(SHOW_ENTITY, {
|
||||||
entity: $t("the_course"),
|
entity: trans(THE_COURSE),
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
</a>
|
</a>
|
||||||
@@ -82,30 +73,38 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts" setup>
|
||||||
import { mapState, mapGetters } from "vuex";
|
import { computed } from "vue";
|
||||||
import TabTable from "./TabTable";
|
import { useStore } from "vuex";
|
||||||
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly";
|
import TabTable from "./TabTable.vue";
|
||||||
|
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue";
|
||||||
|
import {
|
||||||
|
MY_WORKS_DESCRIPTION,
|
||||||
|
CONCERNED_PERSONS,
|
||||||
|
SHOW_ENTITY,
|
||||||
|
THE_COURSE,
|
||||||
|
THE_ACTION,
|
||||||
|
SOCIAL_ACTION,
|
||||||
|
START_DATE,
|
||||||
|
NO_DATA,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
import { Workflow } from "ChillPersonAssets/types";
|
||||||
|
|
||||||
export default {
|
const store = useStore();
|
||||||
name: "MyWorks",
|
|
||||||
components: {
|
const works = computed(() => store.state.homepage.works);
|
||||||
TabTable,
|
const isWorksLoaded = computed(() => store.getters.isWorksLoaded);
|
||||||
OnTheFly,
|
|
||||||
},
|
const noResults = computed(() => {
|
||||||
computed: {
|
if (!isWorksLoaded.value) {
|
||||||
...mapState(["works"]),
|
|
||||||
...mapGetters(["isWorksLoaded"]),
|
|
||||||
noResults() {
|
|
||||||
if (!this.isWorksLoaded) {
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return this.works.count === 0;
|
return works.value.count === 0;
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
},
|
|
||||||
methods: {
|
function getUrl(e: Workflow): string {
|
||||||
getUrl(e) {
|
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case "accompanying_period_work":
|
case "accompanying_period_work":
|
||||||
return `/fr/person/accompanying-period/work/${e.id}/edit`;
|
return `/fr/person/accompanying-period/work/${e.id}/edit`;
|
||||||
@@ -114,9 +113,7 @@ export default {
|
|||||||
default:
|
default:
|
||||||
throw "entity type unknown";
|
throw "entity type unknown";
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@@ -1,17 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<span v-if="isCounterAvailable" class="badge rounded-pill bg-danger">
|
<span v-if="isCounterAvailable" class="badge rounded-pill bg-danger mx-2">
|
||||||
{{ count }}
|
{{ count }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts" setup>
|
||||||
export default {
|
import { computed } from "vue";
|
||||||
name: "TabCounter",
|
|
||||||
props: ["count"],
|
const props = defineProps<{
|
||||||
computed: {
|
count: number;
|
||||||
isCounterAvailable() {
|
}>();
|
||||||
return typeof this.count !== "undefined" && this.count > 0;
|
|
||||||
},
|
const isCounterAvailable = computed(
|
||||||
},
|
() => typeof props.count !== "undefined" && props.count > 0,
|
||||||
};
|
);
|
||||||
</script>
|
</script>
|
||||||
|
@@ -11,11 +11,8 @@
|
|||||||
</table>
|
</table>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts" setup>
|
||||||
export default {
|
// Pas de props à définir, composant slot simple
|
||||||
name: "TabTable",
|
|
||||||
props: [],
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@@ -1,89 +0,0 @@
|
|||||||
const appMessages = {
|
|
||||||
fr: {
|
|
||||||
main_title: "Vue d'ensemble",
|
|
||||||
my_works: {
|
|
||||||
tab: "Mes actions",
|
|
||||||
description:
|
|
||||||
"Liste des actions d'accompagnement dont je suis référent et qui arrivent à échéance.",
|
|
||||||
},
|
|
||||||
my_evaluations: {
|
|
||||||
tab: "Mes évaluations",
|
|
||||||
description:
|
|
||||||
"Liste des évaluations dont je suis référent et qui arrivent à échéance.",
|
|
||||||
},
|
|
||||||
my_tasks: {
|
|
||||||
tab: "Mes tâches",
|
|
||||||
description_alert:
|
|
||||||
"Liste des tâches auxquelles je suis assigné et dont la date de rappel est dépassée.",
|
|
||||||
description_warning:
|
|
||||||
"Liste des tâches auxquelles je suis assigné et dont la date d'échéance est dépassée.",
|
|
||||||
},
|
|
||||||
my_accompanying_courses: {
|
|
||||||
tab: "Mes nouveaux parcours",
|
|
||||||
description:
|
|
||||||
"Liste des parcours d'accompagnement que l'on vient de m'attribuer depuis moins de 15 jours.",
|
|
||||||
},
|
|
||||||
my_notifications: {
|
|
||||||
tab: "Mes nouvelles notifications",
|
|
||||||
description: "Liste des notifications reçues et non lues.",
|
|
||||||
},
|
|
||||||
my_workflows: {
|
|
||||||
tab: "Mes workflows",
|
|
||||||
description: "Liste des workflows en attente d'une action.",
|
|
||||||
description_cc: "Liste des workflows dont je suis en copie.",
|
|
||||||
},
|
|
||||||
opening_date: "Date d'ouverture",
|
|
||||||
social_issues: "Problématiques sociales",
|
|
||||||
concerned_persons: "Usagers concernés",
|
|
||||||
max_date: "Date d'échéance",
|
|
||||||
warning_date: "Date de rappel",
|
|
||||||
evaluation: "Évaluation",
|
|
||||||
task: "Tâche",
|
|
||||||
Date: "Date",
|
|
||||||
From: "Expéditeur",
|
|
||||||
Subject: "Objet",
|
|
||||||
Entity: "Associé à",
|
|
||||||
Step: "Étape",
|
|
||||||
concerned_users: "Usagers concernés",
|
|
||||||
Object_workflow: "Objet du workflow",
|
|
||||||
on_hold: "En attente",
|
|
||||||
show_entity: "Voir {entity}",
|
|
||||||
the_activity: "l'échange",
|
|
||||||
the_course: "le parcours",
|
|
||||||
the_action: "l'action",
|
|
||||||
the_evaluation: "l'évaluation",
|
|
||||||
the_evaluation_document: "le document",
|
|
||||||
the_task: "la tâche",
|
|
||||||
the_workflow: "le workflow",
|
|
||||||
StartDate: "Date d'ouverture",
|
|
||||||
SocialAction: "Action d'accompagnement",
|
|
||||||
no_data: "Aucun résultats",
|
|
||||||
no_dashboard: "Pas de tableaux de bord",
|
|
||||||
counter: {
|
|
||||||
unread_notifications:
|
|
||||||
"{n} notification non lue | {n} notifications non lues",
|
|
||||||
assignated_courses:
|
|
||||||
"{n} parcours récent assigné | {n} parcours récents assignés",
|
|
||||||
assignated_actions: "{n} action assignée | {n} actions assignées",
|
|
||||||
assignated_evaluations:
|
|
||||||
"{n} évaluation assignée | {n} évaluations assignées",
|
|
||||||
alert_tasks: "{n} tâche en rappel | {n} tâches en rappel",
|
|
||||||
warning_tasks: "{n} tâche à échéance | {n} tâches à échéance",
|
|
||||||
},
|
|
||||||
emergency: "Urgent",
|
|
||||||
confidential: "Confidentiel",
|
|
||||||
automatic_notification: "Notification automatique",
|
|
||||||
widget: {
|
|
||||||
news: {
|
|
||||||
title: "Actualités",
|
|
||||||
readMore: "Lire la suite",
|
|
||||||
date: "Date",
|
|
||||||
none: "Aucune actualité",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
Object.assign(appMessages.fr);
|
|
||||||
|
|
||||||
export { appMessages };
|
|
@@ -0,0 +1,55 @@
|
|||||||
|
import { createStore } from "vuex";
|
||||||
|
import { State as HomepageStates, moduleHomepage } from "./modules/homepage";
|
||||||
|
|
||||||
|
import {
|
||||||
|
State as TicketListStates,
|
||||||
|
moduleTicketList,
|
||||||
|
} from "../../../../../../ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket_list";
|
||||||
|
import {
|
||||||
|
State as TicketStates,
|
||||||
|
moduleTicket,
|
||||||
|
} from "../../../../../../ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket";
|
||||||
|
import {
|
||||||
|
State as CommentStates,
|
||||||
|
moduleComment,
|
||||||
|
} from "../../../../../../ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/comment";
|
||||||
|
import {
|
||||||
|
moduleMotive,
|
||||||
|
State as MotiveStates,
|
||||||
|
} from "../../../../../../ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/motive";
|
||||||
|
import {
|
||||||
|
State as AddresseeStates,
|
||||||
|
moduleAddressee,
|
||||||
|
} from "../../../../../../ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/addressee";
|
||||||
|
import {
|
||||||
|
modulePersons,
|
||||||
|
State as PersonsState,
|
||||||
|
} from "../../../../../../ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/persons";
|
||||||
|
|
||||||
|
import {
|
||||||
|
moduleUser,
|
||||||
|
State as UserState,
|
||||||
|
} from "../../../../../../ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user";
|
||||||
|
|
||||||
|
export interface RootState {
|
||||||
|
homepage: HomepageStates;
|
||||||
|
motive: MotiveStates;
|
||||||
|
ticket: TicketStates;
|
||||||
|
comment: CommentStates;
|
||||||
|
addressee: AddresseeStates;
|
||||||
|
persons: PersonsState;
|
||||||
|
ticketList: TicketListStates;
|
||||||
|
user: UserState;
|
||||||
|
}
|
||||||
|
export const store = createStore<RootState>({
|
||||||
|
modules: {
|
||||||
|
homepage: moduleHomepage,
|
||||||
|
motive: moduleMotive,
|
||||||
|
ticket: moduleTicket,
|
||||||
|
comment: moduleComment,
|
||||||
|
addressee: moduleAddressee,
|
||||||
|
person: modulePersons,
|
||||||
|
ticketList: moduleTicketList,
|
||||||
|
user: moduleUser,
|
||||||
|
},
|
||||||
|
});
|
@@ -1,90 +1,103 @@
|
|||||||
import "es6-promise/auto";
|
import "es6-promise/auto";
|
||||||
import { createStore } from "vuex";
|
import { Module } from "vuex";
|
||||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
import {
|
||||||
|
makeFetch,
|
||||||
|
PaginationResponse,
|
||||||
|
} from "ChillMainAssets/lib/api/apiMethods";
|
||||||
|
import {
|
||||||
|
AccompanyingCourse,
|
||||||
|
Alert,
|
||||||
|
Evaluation,
|
||||||
|
Warning,
|
||||||
|
Workflow,
|
||||||
|
WorflowCc,
|
||||||
|
} from "ChillPersonAssets/types";
|
||||||
|
import { RootState } from "..";
|
||||||
|
import { HomepageTabs } from "ChillMainAssets/types";
|
||||||
|
|
||||||
const debug = process.env.NODE_ENV !== "production";
|
export interface TasksState {
|
||||||
|
warning: PaginationResponse<Warning>;
|
||||||
|
alert: PaginationResponse<Alert>;
|
||||||
|
}
|
||||||
|
|
||||||
const isEmpty = (obj) => {
|
export interface State {
|
||||||
return (
|
evaluations: PaginationResponse<Evaluation>;
|
||||||
obj &&
|
tasks: TasksState;
|
||||||
Object.keys(obj).length <= 1 &&
|
accompanyingCourses: PaginationResponse<AccompanyingCourse>;
|
||||||
Object.getPrototypeOf(obj) === Object.prototype
|
notifications: PaginationResponse<Notification>;
|
||||||
);
|
workflows: PaginationResponse<Workflow>;
|
||||||
};
|
workflowsCc: PaginationResponse<WorflowCc>;
|
||||||
|
errorMsg: unknown[];
|
||||||
|
loading: boolean;
|
||||||
|
ticketsLoading: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
const store = createStore({
|
export const moduleHomepage: Module<State, RootState> = {
|
||||||
strict: debug,
|
|
||||||
state: {
|
state: {
|
||||||
// works: {},
|
evaluations: {
|
||||||
evaluations: {},
|
count: 0,
|
||||||
|
} as PaginationResponse<Evaluation>,
|
||||||
tasks: {
|
tasks: {
|
||||||
warning: {},
|
warning: {
|
||||||
alert: {},
|
count: 0,
|
||||||
|
} as PaginationResponse<Warning>,
|
||||||
|
alert: {
|
||||||
|
count: 0,
|
||||||
|
} as PaginationResponse<Alert>,
|
||||||
},
|
},
|
||||||
accompanyingCourses: {},
|
accompanyingCourses: {
|
||||||
notifications: {},
|
count: 0,
|
||||||
workflows: {},
|
} as PaginationResponse<AccompanyingCourse>,
|
||||||
workflowsCc: {},
|
notifications: {
|
||||||
|
count: 0,
|
||||||
|
} as PaginationResponse<Notification>,
|
||||||
|
workflows: {
|
||||||
|
count: 0,
|
||||||
|
} as PaginationResponse<Workflow>,
|
||||||
|
workflowsCc: {
|
||||||
|
count: 0,
|
||||||
|
} as PaginationResponse<WorflowCc>,
|
||||||
|
ticketsLoading: false,
|
||||||
errorMsg: [],
|
errorMsg: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
// isWorksLoaded(state) {
|
isTicketLoading: (state) => {
|
||||||
// return !isEmpty(state.works);
|
return state.ticketsLoading;
|
||||||
// },
|
},
|
||||||
isEvaluationsLoaded(state) {
|
isEvaluationsLoaded(state) {
|
||||||
return !isEmpty(state.evaluations);
|
return Array.isArray(state.evaluations.results);
|
||||||
},
|
},
|
||||||
isTasksWarningLoaded(state) {
|
isTasksWarningLoaded(state) {
|
||||||
return !isEmpty(state.tasks.warning);
|
return Array.isArray(state.tasks.warning.results);
|
||||||
},
|
},
|
||||||
isTasksAlertLoaded(state) {
|
isTasksAlertLoaded(state) {
|
||||||
return !isEmpty(state.tasks.alert);
|
return Array.isArray(state.tasks.alert.results);
|
||||||
},
|
},
|
||||||
isAccompanyingCoursesLoaded(state) {
|
isAccompanyingCoursesLoaded(state) {
|
||||||
return !isEmpty(state.accompanyingCourses);
|
return Array.isArray(state.accompanyingCourses.results);
|
||||||
},
|
},
|
||||||
isNotificationsLoaded(state) {
|
isNotificationsLoaded(state) {
|
||||||
return !isEmpty(state.notifications);
|
return Array.isArray(state.notifications.results);
|
||||||
},
|
},
|
||||||
isWorkflowsLoaded(state) {
|
isWorkflowsLoaded(state) {
|
||||||
return !isEmpty(state.workflows);
|
return Array.isArray(state.workflows.results);
|
||||||
},
|
|
||||||
counter(state) {
|
|
||||||
return {
|
|
||||||
// works: state.works.count,
|
|
||||||
evaluations: state.evaluations.count,
|
|
||||||
tasksWarning: state.tasks.warning.count,
|
|
||||||
tasksAlert: state.tasks.alert.count,
|
|
||||||
accompanyingCourses: state.accompanyingCourses.count,
|
|
||||||
notifications: state.notifications.count,
|
|
||||||
workflows: state.workflows.count,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
// addWorks(state, works) {
|
|
||||||
// //console.log('addWorks', works);
|
|
||||||
// state.works = works;
|
|
||||||
// },
|
|
||||||
addEvaluations(state, evaluations) {
|
addEvaluations(state, evaluations) {
|
||||||
//console.log('addEvaluations', evaluations);
|
|
||||||
state.evaluations = evaluations;
|
state.evaluations = evaluations;
|
||||||
},
|
},
|
||||||
addTasksWarning(state, tasks) {
|
addTasksWarning(state, tasks) {
|
||||||
//console.log('addTasksWarning', tasks);
|
|
||||||
state.tasks.warning = tasks;
|
state.tasks.warning = tasks;
|
||||||
},
|
},
|
||||||
addTasksAlert(state, tasks) {
|
addTasksAlert(state, tasks) {
|
||||||
//console.log('addTasksAlert', tasks);
|
|
||||||
state.tasks.alert = tasks;
|
state.tasks.alert = tasks;
|
||||||
},
|
},
|
||||||
addCourses(state, courses) {
|
addCourses(state, courses) {
|
||||||
//console.log('addCourses', courses);
|
|
||||||
state.accompanyingCourses = courses;
|
state.accompanyingCourses = courses;
|
||||||
},
|
},
|
||||||
addNotifications(state, notifications) {
|
addNotifications(state, notifications) {
|
||||||
//console.log('addNotifications', notifications);
|
|
||||||
state.notifications = notifications;
|
state.notifications = notifications;
|
||||||
},
|
},
|
||||||
addWorkflows(state, workflows) {
|
addWorkflows(state, workflows) {
|
||||||
@@ -96,30 +109,30 @@ const store = createStore({
|
|||||||
setLoading(state, bool) {
|
setLoading(state, bool) {
|
||||||
state.loading = bool;
|
state.loading = bool;
|
||||||
},
|
},
|
||||||
|
setTicketsLoading(state, bool) {
|
||||||
|
state.ticketsLoading = bool;
|
||||||
|
},
|
||||||
catchError(state, error) {
|
catchError(state, error) {
|
||||||
state.errorMsg.push(error);
|
state.errorMsg.push(error);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
getByTab({ commit, getters }, { tab, param }) {
|
async getByTab({ commit, getters, dispatch }, { tab, param }) {
|
||||||
switch (tab) {
|
switch (tab) {
|
||||||
// case 'MyWorks':
|
case HomepageTabs.MyTickets:
|
||||||
// if (!getters.isWorksLoaded) {
|
if (!getters.isTicketsLoaded) {
|
||||||
// commit('setLoading', true);
|
commit("setTicketsLoading", true);
|
||||||
// const url = `/api/1.0/person/accompanying-period/work/my-near-end${'?'+ param}`;
|
// Utilise l'action du module ticket_list
|
||||||
// makeFetch('GET', url)
|
await dispatch(
|
||||||
// .then((response) => {
|
"fetchTicketList",
|
||||||
// commit('addWorks', response);
|
{ byAddresseeToMe: true, byCurrentState: "open" },
|
||||||
// commit('setLoading', false);
|
{ root: true },
|
||||||
// })
|
);
|
||||||
// .catch((error) => {
|
|
||||||
// commit('catchError', error);
|
commit("setTicketsLoading", false);
|
||||||
// throw error;
|
}
|
||||||
// })
|
break;
|
||||||
// ;
|
case HomepageTabs.MyEvaluations:
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
case "MyEvaluations":
|
|
||||||
if (!getters.isEvaluationsLoaded) {
|
if (!getters.isEvaluationsLoaded) {
|
||||||
commit("setLoading", true);
|
commit("setLoading", true);
|
||||||
const url = `/api/1.0/person/accompanying-period/work/evaluation/my-near-end${"?" + param}`;
|
const url = `/api/1.0/person/accompanying-period/work/evaluation/my-near-end${"?" + param}`;
|
||||||
@@ -134,7 +147,7 @@ const store = createStore({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "MyTasks":
|
case HomepageTabs.MyTasks:
|
||||||
if (!(getters.isTasksWarningLoaded && getters.isTasksAlertLoaded)) {
|
if (!(getters.isTasksWarningLoaded && getters.isTasksAlertLoaded)) {
|
||||||
commit("setLoading", true);
|
commit("setLoading", true);
|
||||||
const urlWarning = `/api/1.0/task/single-task/list/my?f[q]=&f[checkboxes][status][]=warning&f[checkboxes][states][]=new&f[checkboxes][states][]=in_progress${"&" + param}`,
|
const urlWarning = `/api/1.0/task/single-task/list/my?f[q]=&f[checkboxes][status][]=warning&f[checkboxes][states][]=new&f[checkboxes][states][]=in_progress${"&" + param}`,
|
||||||
@@ -159,7 +172,7 @@ const store = createStore({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "MyAccompanyingCourses":
|
case HomepageTabs.MyAccompanyingCourses:
|
||||||
if (!getters.isAccompanyingCoursesLoaded) {
|
if (!getters.isAccompanyingCoursesLoaded) {
|
||||||
commit("setLoading", true);
|
commit("setLoading", true);
|
||||||
const url = `/api/1.0/person/accompanying-course/list/by-recent-attributions${"?" + param}`;
|
const url = `/api/1.0/person/accompanying-course/list/by-recent-attributions${"?" + param}`;
|
||||||
@@ -174,13 +187,12 @@ const store = createStore({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "MyNotifications":
|
case HomepageTabs.MyNotifications:
|
||||||
if (!getters.isNotificationsLoaded) {
|
if (!getters.isNotificationsLoaded) {
|
||||||
commit("setLoading", true);
|
commit("setLoading", true);
|
||||||
const url = `/api/1.0/main/notification/my/unread${"?" + param}`;
|
const url = `/api/1.0/main/notification/my/unread${"?" + param}`;
|
||||||
makeFetch("GET", url)
|
makeFetch("GET", url)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log("notifications", response);
|
|
||||||
commit("addNotifications", response);
|
commit("addNotifications", response);
|
||||||
commit("setLoading", false);
|
commit("setLoading", false);
|
||||||
})
|
})
|
||||||
@@ -190,7 +202,7 @@ const store = createStore({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "MyWorkflows":
|
case HomepageTabs.MyWorkflows:
|
||||||
if (!getters.isWorflowsLoaded) {
|
if (!getters.isWorflowsLoaded) {
|
||||||
commit("setLoading", true);
|
commit("setLoading", true);
|
||||||
makeFetch("GET", "/api/1.0/main/workflow/my")
|
makeFetch("GET", "/api/1.0/main/workflow/my")
|
||||||
@@ -217,6 +229,4 @@ const store = createStore({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
};
|
||||||
|
|
||||||
export { store };
|
|
@@ -10,7 +10,7 @@
|
|||||||
v-model="radioType"
|
v-model="radioType"
|
||||||
value="person"
|
value="person"
|
||||||
/>
|
/>
|
||||||
{{ $t("onthefly.create.person") }}
|
{{ trans(ONTHEFLY_CREATE_PERSON) }}
|
||||||
</label>
|
</label>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
v-model="radioType"
|
v-model="radioType"
|
||||||
value="thirdparty"
|
value="thirdparty"
|
||||||
/>
|
/>
|
||||||
{{ $t("onthefly.create.thirdparty") }}
|
{{ trans(ONTHEFLY_CREATE_THIRDPARTY) }}
|
||||||
</label>
|
</label>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -46,64 +46,66 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<script setup>
|
||||||
<script>
|
import { ref, computed, onMounted } from "vue";
|
||||||
import OnTheFlyPerson from "ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue";
|
import OnTheFlyPerson from "ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue";
|
||||||
import OnTheFlyThirdparty from "ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue";
|
import OnTheFlyThirdparty from "ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue";
|
||||||
|
import {
|
||||||
|
trans,
|
||||||
|
ONTHEFLY_CREATE_PERSON,
|
||||||
|
ONTHEFLY_CREATE_THIRDPARTY,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
export default {
|
const props = defineProps({
|
||||||
name: "OnTheFlyCreate",
|
action: String,
|
||||||
props: ["action", "allowedTypes", "query"],
|
allowedTypes: Array,
|
||||||
components: {
|
query: String,
|
||||||
OnTheFlyPerson,
|
});
|
||||||
OnTheFlyThirdparty,
|
|
||||||
|
const type = ref(null);
|
||||||
|
|
||||||
|
const radioType = computed({
|
||||||
|
get: () => type.value,
|
||||||
|
set: (val) => {
|
||||||
|
type.value = val;
|
||||||
|
console.log("## type:", val, ", action:", props.action);
|
||||||
},
|
},
|
||||||
data() {
|
});
|
||||||
return {
|
|
||||||
type: null,
|
const castPerson = ref(null);
|
||||||
};
|
const castThirdparty = ref(null);
|
||||||
},
|
|
||||||
computed: {
|
onMounted(() => {
|
||||||
radioType: {
|
type.value =
|
||||||
set(type) {
|
props.allowedTypes.length === 1 && props.allowedTypes.includes("thirdparty")
|
||||||
this.type = type;
|
|
||||||
console.log("## type:", type, ", action:", this.action);
|
|
||||||
},
|
|
||||||
get() {
|
|
||||||
return this.type;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.type =
|
|
||||||
this.allowedTypes.length === 1 &&
|
|
||||||
this.allowedTypes.includes("thirdparty")
|
|
||||||
? "thirdparty"
|
? "thirdparty"
|
||||||
: "person";
|
: "person";
|
||||||
},
|
});
|
||||||
methods: {
|
|
||||||
isActive(tab) {
|
function isActive(tab) {
|
||||||
return this.type === tab ? true : false;
|
return type.value === tab;
|
||||||
},
|
}
|
||||||
castDataByType() {
|
|
||||||
switch (this.radioType) {
|
function castDataByType() {
|
||||||
|
switch (radioType.value) {
|
||||||
case "person":
|
case "person":
|
||||||
return this.$refs.castPerson.$data.person;
|
return castPerson.value.$data.person;
|
||||||
case "thirdparty":
|
case "thirdparty":
|
||||||
let data = this.$refs.castThirdparty.$data.thirdparty;
|
let data = castThirdparty.value.$data.thirdparty;
|
||||||
if (data.address !== undefined && data.address !== null) {
|
if (data.address !== undefined && data.address !== null) {
|
||||||
data.address = { id: data.address.address_id };
|
data.address = { id: data.address.address_id };
|
||||||
} else {
|
} else {
|
||||||
data.address = null;
|
data.address = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
default:
|
default:
|
||||||
throw Error("Invalid type of entity");
|
throw Error("Invalid type of entity");
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
|
||||||
};
|
defineExpose({
|
||||||
|
castDataByType,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
class="btn btn-sm"
|
class="btn btn-sm"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
:class="classAction"
|
:class="classAction"
|
||||||
:title="$t(titleAction)"
|
:title="trans(titleAction)"
|
||||||
@click="openModal"
|
@click="openModal"
|
||||||
>
|
>
|
||||||
{{ buttonText }}<span v-if="isDead"> (‡)</span>
|
{{ buttonText }}<span v-if="isDead"> (‡)</span>
|
||||||
@@ -23,10 +23,10 @@
|
|||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<h3 v-if="parent" class="modal-title">
|
<h3 v-if="parent" class="modal-title">
|
||||||
{{ $t(titleModal, { q: parent.text }) }}
|
{{ trans(titleModal, { q: parent.text }) }}
|
||||||
</h3>
|
</h3>
|
||||||
<h3 v-else class="modal-title">
|
<h3 v-else class="modal-title">
|
||||||
{{ $t(titleModal) }}
|
{{ trans(titleModal) }}
|
||||||
</h3>
|
</h3>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
ref="castPerson"
|
ref="castPerson"
|
||||||
/>
|
/>
|
||||||
<div v-if="hasResourceComment">
|
<div v-if="hasResourceComment">
|
||||||
<h3>{{ $t("onthefly.resource_comment_title") }}</h3>
|
<h3>{{ trans(ONTHEFLY_RESOURCE_COMMENT_TITLE) }}</h3>
|
||||||
<blockquote class="chill-user-quote">
|
<blockquote class="chill-user-quote">
|
||||||
{{ parent.comment }}
|
{{ parent.comment }}
|
||||||
</blockquote>
|
</blockquote>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
ref="castThirdparty"
|
ref="castThirdparty"
|
||||||
/>
|
/>
|
||||||
<div v-if="hasResourceComment">
|
<div v-if="hasResourceComment">
|
||||||
<h3>{{ $t("onthefly.resource_comment_title") }}</h3>
|
<h3>{{ trans(ONTHEFLY_RESOURCE_COMMENT_TITLE) }}</h3>
|
||||||
<blockquote class="chill-user-quote">
|
<blockquote class="chill-user-quote">
|
||||||
{{ parent.comment }}
|
{{ parent.comment }}
|
||||||
</blockquote>
|
</blockquote>
|
||||||
@@ -82,65 +82,82 @@
|
|||||||
<a
|
<a
|
||||||
v-if="action === 'show'"
|
v-if="action === 'show'"
|
||||||
:href="buildLocation(id, type)"
|
:href="buildLocation(id, type)"
|
||||||
:title="$t(titleMessage)"
|
:title="trans(titleMessage)"
|
||||||
class="btn btn-show"
|
class="btn btn-show"
|
||||||
>{{ $t(buttonMessage) }}
|
>{{ trans(buttonMessage) }}
|
||||||
</a>
|
</a>
|
||||||
<a v-else class="btn btn-save" @click="saveAction">
|
<a v-else class="btn btn-save" @click="saveAction">
|
||||||
{{ $t("action.save") }}
|
{{ trans(ACTION_SAVE) }}
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
</modal>
|
</modal>
|
||||||
</teleport>
|
</teleport>
|
||||||
</template>
|
</template>
|
||||||
|
<script setup>
|
||||||
<script>
|
import { ref, computed, defineEmits, defineProps } from "vue";
|
||||||
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
|
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
|
||||||
import OnTheFlyCreate from "./Create.vue";
|
import OnTheFlyCreate from "./Create.vue";
|
||||||
import OnTheFlyPerson from "ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue";
|
import OnTheFlyPerson from "ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue";
|
||||||
import OnTheFlyThirdparty from "ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue";
|
import OnTheFlyThirdparty from "ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue";
|
||||||
|
import {
|
||||||
|
trans,
|
||||||
|
ACTION_SHOW,
|
||||||
|
ACTION_EDIT,
|
||||||
|
ACTION_CREATE,
|
||||||
|
ACTION_ADDCONTACT,
|
||||||
|
ONTHEFLY_CREATE_TITLE_DEFAULT,
|
||||||
|
ONTHEFLY_CREATE_TITLE_PERSON,
|
||||||
|
ONTHEFLY_CREATE_TITLE_THIRDPARTY,
|
||||||
|
ONTHEFLY_SHOW_PERSON,
|
||||||
|
ONTHEFLY_SHOW_THIRDPARTY,
|
||||||
|
ONTHEFLY_EDIT_PERSON,
|
||||||
|
ONTHEFLY_EDIT_THIRDPARTY,
|
||||||
|
ONTHEFLY_ADDCONTACT_TITLE,
|
||||||
|
ACTION_REDIRECT_PERSON,
|
||||||
|
ACTION_REDIRECT_THIRDPARTY,
|
||||||
|
ONTHEFLY_SHOW_FILE_PERSON,
|
||||||
|
ONTHEFLY_SHOW_FILE_THIRDPARTY,
|
||||||
|
ONTHEFLY_SHOW_FILE_DEFAULT,
|
||||||
|
ONTHEFLY_RESOURCE_COMMENT_TITLE,
|
||||||
|
ACTION_SAVE,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
export default {
|
const props = defineProps({
|
||||||
name: "OnTheFly",
|
type: String,
|
||||||
components: {
|
id: [String, Number],
|
||||||
Modal,
|
action: String,
|
||||||
OnTheFlyPerson,
|
buttonText: String,
|
||||||
OnTheFlyThirdparty,
|
displayBadge: Boolean,
|
||||||
OnTheFlyCreate,
|
isDead: Boolean,
|
||||||
},
|
parent: Object,
|
||||||
props: [
|
allowedTypes: Array,
|
||||||
"type",
|
query: String,
|
||||||
"id",
|
});
|
||||||
"action",
|
|
||||||
"buttonText",
|
const emit = defineEmits(["saveFormOnTheFly"]);
|
||||||
"displayBadge",
|
|
||||||
"isDead",
|
const modal = ref({
|
||||||
"parent",
|
|
||||||
"allowedTypes",
|
|
||||||
"query",
|
|
||||||
],
|
|
||||||
emits: ["saveFormOnTheFly"],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
modal: {
|
|
||||||
showModal: false,
|
showModal: false,
|
||||||
modalDialogClass: "modal-dialog-scrollable modal-xl",
|
modalDialogClass: "modal-dialog-scrollable modal-xl",
|
||||||
},
|
});
|
||||||
};
|
|
||||||
},
|
const castPerson = ref();
|
||||||
computed: {
|
const castThirdparty = ref();
|
||||||
hasResourceComment() {
|
const castNew = ref();
|
||||||
|
|
||||||
|
const hasResourceComment = computed(() => {
|
||||||
return (
|
return (
|
||||||
typeof this.parent !== "undefined" &&
|
typeof props.parent !== "undefined" &&
|
||||||
this.parent !== null &&
|
props.parent !== null &&
|
||||||
this.action === "show" &&
|
props.action === "show" &&
|
||||||
this.parent.type === "accompanying_period_resource" &&
|
props.parent.type === "accompanying_period_resource" &&
|
||||||
this.parent.comment !== null &&
|
props.parent.comment !== null &&
|
||||||
this.parent.comment !== ""
|
props.parent.comment !== ""
|
||||||
);
|
);
|
||||||
},
|
});
|
||||||
classAction() {
|
|
||||||
switch (this.action) {
|
const classAction = computed(() => {
|
||||||
|
switch (props.action) {
|
||||||
case "show":
|
case "show":
|
||||||
return "btn-show";
|
return "btn-show";
|
||||||
case "edit":
|
case "edit":
|
||||||
@@ -152,114 +169,125 @@ export default {
|
|||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
},
|
|
||||||
titleAction() {
|
|
||||||
switch (this.action) {
|
|
||||||
case "show":
|
|
||||||
return "action.show";
|
|
||||||
case "edit":
|
|
||||||
return "action.edit";
|
|
||||||
case "create":
|
|
||||||
return "action.create";
|
|
||||||
case "addContact":
|
|
||||||
return "action.addContact";
|
|
||||||
default:
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
titleCreate() {
|
|
||||||
if (typeof this.allowedTypes === "undefined") {
|
|
||||||
return "onthefly.create.title.default";
|
|
||||||
}
|
|
||||||
return this.allowedTypes.every((t) => t === "person")
|
|
||||||
? "onthefly.create.title.person"
|
|
||||||
: this.allowedTypes.every((t) => t === "thirdparty")
|
|
||||||
? "onthefly.create.title.thirdparty"
|
|
||||||
: "onthefly.create.title.default";
|
|
||||||
},
|
|
||||||
titleModal() {
|
|
||||||
switch (this.action) {
|
|
||||||
case "show":
|
|
||||||
return "onthefly.show." + this.type;
|
|
||||||
case "edit":
|
|
||||||
return "onthefly.edit." + this.type;
|
|
||||||
case "create":
|
|
||||||
return this.titleCreate;
|
|
||||||
case "addContact":
|
|
||||||
return "onthefly.addContact.title";
|
|
||||||
default:
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
titleMessage() {
|
|
||||||
switch (this.type) {
|
|
||||||
case "person":
|
|
||||||
return "action.redirect." + this.type;
|
|
||||||
case "thirdparty":
|
|
||||||
return "action.redirect." + this.type;
|
|
||||||
default:
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
buttonMessage() {
|
|
||||||
switch (this.type) {
|
|
||||||
case "person":
|
|
||||||
return "onthefly.show.file_" + this.type;
|
|
||||||
case "thirdparty":
|
|
||||||
return "onthefly.show.file_" + this.type;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
isDisplayBadge() {
|
|
||||||
return this.displayBadge === true && this.buttonText !== null;
|
|
||||||
},
|
|
||||||
badgeType() {
|
|
||||||
return "entity-" + this.type + " badge-" + this.type;
|
|
||||||
},
|
|
||||||
getReturnPath() {
|
|
||||||
return `?returnPath=${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
closeModal() {
|
|
||||||
this.modal.showModal = false;
|
|
||||||
},
|
|
||||||
openModal() {
|
|
||||||
// console.log('## OPEN ON THE FLY MODAL');
|
|
||||||
// console.log('## type:', this.type, ', action:', this.action);
|
|
||||||
this.modal.showModal = true;
|
|
||||||
this.$nextTick(function () {
|
|
||||||
//this.$refs.search.focus();
|
|
||||||
});
|
});
|
||||||
},
|
|
||||||
changeActionTo(action) {
|
const titleAction = computed(() => {
|
||||||
this.$data.action = action;
|
switch (props.action) {
|
||||||
},
|
case "show":
|
||||||
saveAction() {
|
return ACTION_SHOW;
|
||||||
// console.log('saveAction button: create/edit action with', this.type);
|
case "edit":
|
||||||
let type = this.type,
|
return ACTION_EDIT;
|
||||||
|
case "create":
|
||||||
|
return ACTION_CREATE;
|
||||||
|
case "addContact":
|
||||||
|
return ACTION_ADDCONTACT;
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const titleCreate = computed(() => {
|
||||||
|
if (typeof props.allowedTypes === "undefined") {
|
||||||
|
return ONTHEFLY_CREATE_TITLE_DEFAULT;
|
||||||
|
}
|
||||||
|
return props.allowedTypes.every((t) => t === "person")
|
||||||
|
? ONTHEFLY_CREATE_TITLE_PERSON
|
||||||
|
: props.allowedTypes.every((t) => t === "thirdparty")
|
||||||
|
? ONTHEFLY_CREATE_TITLE_THIRDPARTY
|
||||||
|
: ONTHEFLY_CREATE_TITLE_DEFAULT;
|
||||||
|
});
|
||||||
|
|
||||||
|
const titleModal = computed(() => {
|
||||||
|
switch (props.action) {
|
||||||
|
case "show":
|
||||||
|
if (props.type == "person") {
|
||||||
|
return ONTHEFLY_SHOW_PERSON;
|
||||||
|
} else if (props.type == "thirdparty") {
|
||||||
|
return ONTHEFLY_SHOW_THIRDPARTY;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "edit":
|
||||||
|
if (props.type == "person") {
|
||||||
|
return ONTHEFLY_EDIT_PERSON;
|
||||||
|
} else if (props.type == "thirdparty") {
|
||||||
|
return ONTHEFLY_EDIT_THIRDPARTY;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "create":
|
||||||
|
return titleCreate.value;
|
||||||
|
case "addContact":
|
||||||
|
return ONTHEFLY_ADDCONTACT_TITLE;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
});
|
||||||
|
|
||||||
|
const titleMessage = computed(() => {
|
||||||
|
switch (props.type) {
|
||||||
|
case "person":
|
||||||
|
return ACTION_REDIRECT_PERSON;
|
||||||
|
case "thirdparty":
|
||||||
|
return ACTION_REDIRECT_THIRDPARTY;
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const buttonMessage = computed(() => {
|
||||||
|
switch (props.type) {
|
||||||
|
case "person":
|
||||||
|
return ONTHEFLY_SHOW_FILE_PERSON;
|
||||||
|
case "thirdparty":
|
||||||
|
return ONTHEFLY_SHOW_FILE_THIRDPARTY;
|
||||||
|
default:
|
||||||
|
return ONTHEFLY_SHOW_FILE_DEFAULT;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const isDisplayBadge = computed(() => {
|
||||||
|
return props.displayBadge === true && props.buttonText !== null;
|
||||||
|
});
|
||||||
|
|
||||||
|
const badgeType = computed(() => {
|
||||||
|
return "entity-" + props.type + " badge-" + props.type;
|
||||||
|
});
|
||||||
|
|
||||||
|
const getReturnPath = computed(() => {
|
||||||
|
return `?returnPath=${window.location.pathname}${window.location.search}${window.location.hash}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
function closeModal() {
|
||||||
|
modal.value.showModal = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function openModal() {
|
||||||
|
modal.value.showModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeActionTo(action) {
|
||||||
|
console.log(action);
|
||||||
|
// Not reactive in setup, but you can emit or use a ref if needed
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveAction() {
|
||||||
|
let type = props.type,
|
||||||
data = {};
|
data = {};
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "person":
|
case "person":
|
||||||
data = this.$refs.castPerson.$data.person;
|
data = castPerson.value?.$data.person;
|
||||||
console.log("person data are", data);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "thirdparty":
|
case "thirdparty":
|
||||||
data = this.$refs.castThirdparty.$data.thirdparty;
|
data = castThirdparty.value?.$data.thirdparty;
|
||||||
/* never executed ? */
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (typeof this.type === "undefined") {
|
if (typeof props.type === "undefined") {
|
||||||
// action=create or addContact
|
if (props.action === "addContact") {
|
||||||
// console.log('will rewrite data');
|
|
||||||
if (this.action === "addContact") {
|
|
||||||
type = "thirdparty";
|
type = "thirdparty";
|
||||||
data = this.$refs.castThirdparty.$data.thirdparty;
|
data = castThirdparty.value?.$data.thirdparty;
|
||||||
// console.log('data original', data);
|
|
||||||
data.parent = {
|
data.parent = {
|
||||||
type: "thirdparty",
|
type: "thirdparty",
|
||||||
id: this.parent.id,
|
id: props.parent.id,
|
||||||
};
|
};
|
||||||
data.civility =
|
data.civility =
|
||||||
data.civility !== null
|
data.civility !== null
|
||||||
@@ -268,16 +296,11 @@ export default {
|
|||||||
id: data.civility.id,
|
id: data.civility.id,
|
||||||
}
|
}
|
||||||
: null;
|
: null;
|
||||||
data.profession =
|
data.profession = data.profession !== "" ? data.profession : "";
|
||||||
data.profession !== "" ? data.profession : "";
|
|
||||||
} else {
|
} else {
|
||||||
type = this.$refs.castNew.radioType;
|
type = castNew.value.radioType;
|
||||||
data = this.$refs.castNew.castDataByType();
|
data = castNew.value.castDataByType();
|
||||||
// console.log('type', type);
|
if (typeof data.civility !== "undefined" && null !== data.civility) {
|
||||||
if (
|
|
||||||
typeof data.civility !== "undefined" &&
|
|
||||||
null !== data.civility
|
|
||||||
) {
|
|
||||||
data.civility =
|
data.civility =
|
||||||
data.civility !== null
|
data.civility !== null
|
||||||
? {
|
? {
|
||||||
@@ -290,34 +313,37 @@ export default {
|
|||||||
typeof data.profession !== "undefined" &&
|
typeof data.profession !== "undefined" &&
|
||||||
"" !== data.profession
|
"" !== data.profession
|
||||||
) {
|
) {
|
||||||
data.profession =
|
data.profession = data.profession !== "" ? data.profession : "";
|
||||||
data.profession !== ""
|
|
||||||
? data.profession
|
|
||||||
: "";
|
|
||||||
}
|
}
|
||||||
// console.log('onthefly data', data);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw "error with object type";
|
throw "error with object type";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// pass datas to parent
|
emit("saveFormOnTheFly", { type: type, data: data });
|
||||||
this.$emit("saveFormOnTheFly", { type: type, data: data });
|
|
||||||
},
|
|
||||||
buildLocation(id, type) {
|
|
||||||
if (type === "person") {
|
|
||||||
// TODO i18n
|
|
||||||
return encodeURI(
|
|
||||||
`/fr/person/${id}/general${this.getReturnPath}`,
|
|
||||||
);
|
|
||||||
} else if (type === "thirdparty") {
|
|
||||||
return encodeURI(
|
|
||||||
`/fr/3party/3party/${id}/view${this.getReturnPath}`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
},
|
function buildLocation(id, type) {
|
||||||
};
|
if (type === "person") {
|
||||||
|
return encodeURI(`/fr/person/${id}/general${getReturnPath.value}`);
|
||||||
|
} else if (type === "thirdparty") {
|
||||||
|
return encodeURI(`/fr/3party/3party/${id}/view${getReturnPath.value}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
openModal,
|
||||||
|
closeModal,
|
||||||
|
changeActionTo,
|
||||||
|
saveAction,
|
||||||
|
castPerson,
|
||||||
|
castThirdparty,
|
||||||
|
castNew,
|
||||||
|
hasResourceComment,
|
||||||
|
modal,
|
||||||
|
isDisplayBadge,
|
||||||
|
Modal,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
|
@@ -1,22 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<ul :class="listClasses" v-if="picked.length && displayPicked">
|
<div class="grey-card p-2">
|
||||||
<li v-for="p in picked" @click="removeEntity(p)" :key="p.type + p.id">
|
<ul :class="listClasses" v-if="displayPicked">
|
||||||
|
<li
|
||||||
|
v-for="p in picked"
|
||||||
|
@click="removeEntity(p)"
|
||||||
|
:key="p === 'me' ? 'me' : p.type + p.id"
|
||||||
|
>
|
||||||
<span
|
<span
|
||||||
v-if="'me' === p"
|
v-if="'me' === p"
|
||||||
class="chill_denomination current-user updatedBy"
|
class="chill_denomination current-user updatedBy"
|
||||||
>{{ trans(USER_CURRENT_USER) }}</span
|
>{{ trans(USER_CURRENT_USER) }}</span
|
||||||
>
|
>
|
||||||
<span v-else class="chill_denomination">{{ p.text }}</span>
|
<span
|
||||||
|
v-else
|
||||||
|
:class="getBadgeClass(p)"
|
||||||
|
class="chill_denomination"
|
||||||
|
:style="getBadgeStyle(p)"
|
||||||
|
>
|
||||||
|
{{ p.text }}
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions mb-0">
|
||||||
<li v-if="isCurrentUserPicker" class="btn btn-sm btn-misc">
|
<li v-if="isCurrentUserPicker" class="btn btn-sm btn-misc">
|
||||||
<label class="flex items-center gap-2">
|
<label class="flex items-center gap-1">
|
||||||
<input
|
<input
|
||||||
:checked="picked.indexOf('me') >= 0 ? true : null"
|
:checked="isMePicked"
|
||||||
ref="itsMeCheckbox"
|
ref="itsMeCheckbox"
|
||||||
:type="multiple ? 'checkbox' : 'radio'"
|
:type="multiple ? 'checkbox' : 'radio'"
|
||||||
@change="selectItsMe"
|
@change="selectItsMe($event as InputEvent)"
|
||||||
|
style="margin: 0"
|
||||||
/>
|
/>
|
||||||
{{ trans(USER_CURRENT_USER) }}
|
{{ trans(USER_CURRENT_USER) }}
|
||||||
</label>
|
</label>
|
||||||
@@ -27,94 +40,287 @@
|
|||||||
:key="uniqid"
|
:key="uniqid"
|
||||||
:buttonTitle="translatedListOfTypes"
|
:buttonTitle="translatedListOfTypes"
|
||||||
:modalTitle="translatedListOfTypes"
|
:modalTitle="translatedListOfTypes"
|
||||||
ref="addPersons"
|
|
||||||
@addNewPersons="addNewEntity"
|
@addNewPersons="addNewEntity"
|
||||||
>
|
>
|
||||||
</add-persons>
|
</add-persons>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="list-suggest add-items inline">
|
|
||||||
<li v-for="s in suggested" :key="s.id" @click="addNewSuggested(s)">
|
<ul class="badge-suggest add-items inline text-end">
|
||||||
<span>{{ s.text }}</span>
|
<li
|
||||||
|
v-for="s in suggested"
|
||||||
|
:key="s.type + s.id"
|
||||||
|
@click="addNewSuggested(s)"
|
||||||
|
style="margin: 0"
|
||||||
|
>
|
||||||
|
<span :class="getBadgeClass(s)" :style="getBadgeStyle(s)">
|
||||||
|
{{ s.text }}
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed } from "vue";
|
import {
|
||||||
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue"; // eslint-disable-line
|
ref,
|
||||||
import { appMessages } from "./i18n";
|
computed,
|
||||||
import { trans, USER_CURRENT_USER } from "translator";
|
defineProps,
|
||||||
|
defineEmits,
|
||||||
|
defineComponent,
|
||||||
|
withDefaults,
|
||||||
|
} from "vue";
|
||||||
|
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue";
|
||||||
|
import {
|
||||||
|
Entities,
|
||||||
|
EntitiesOrMe,
|
||||||
|
EntityType,
|
||||||
|
SearchOptions,
|
||||||
|
} from "ChillPersonAssets/types";
|
||||||
|
import {
|
||||||
|
PICK_ENTITY_MODAL_TITLE,
|
||||||
|
PICK_ENTITY_USER,
|
||||||
|
PICK_ENTITY_USER_GROUP,
|
||||||
|
PICK_ENTITY_PERSON,
|
||||||
|
PICK_ENTITY_THIRDPARTY,
|
||||||
|
USER_CURRENT_USER,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
import { addNewEntities } from "ChillMainAssets/types";
|
||||||
|
|
||||||
const props = defineProps({
|
defineComponent({
|
||||||
multiple: Boolean,
|
components: {
|
||||||
types: Array,
|
AddPersons,
|
||||||
picked: Array,
|
},
|
||||||
uniqid: String,
|
|
||||||
removableIfSet: { type: Boolean, default: true },
|
|
||||||
displayPicked: { type: Boolean, default: true },
|
|
||||||
suggested: { type: Array, default: () => [] },
|
|
||||||
label: String,
|
|
||||||
isCurrentUserPicker: { type: Boolean, default: false },
|
|
||||||
});
|
});
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
multiple: boolean;
|
||||||
|
types: EntityType[];
|
||||||
|
picked: EntitiesOrMe[];
|
||||||
|
uniqid: string;
|
||||||
|
removableIfSet?: boolean;
|
||||||
|
displayPicked?: boolean;
|
||||||
|
suggested?: Entities[];
|
||||||
|
label?: string;
|
||||||
|
isCurrentUserPicker?: boolean;
|
||||||
|
}>(),
|
||||||
|
{ isCurrentUserPicker: false, displayPicked: true, removableIfSet: true },
|
||||||
|
);
|
||||||
|
|
||||||
const emit = defineEmits([
|
const emits = defineEmits<{
|
||||||
"addNewEntity",
|
(e: "addNewEntity", payload: { entity: EntitiesOrMe }): void;
|
||||||
"removeEntity",
|
(e: "removeEntity", payload: { entity: EntitiesOrMe }): void;
|
||||||
"addNewEntityProcessEnded",
|
(e: "addNewEntityProcessEnded"): void;
|
||||||
]);
|
}>();
|
||||||
|
|
||||||
const itsMeCheckbox = ref(null);
|
const itsMeCheckbox = ref<null | HTMLInputElement>(null);
|
||||||
const addPersons = ref(null);
|
const addPersons = ref();
|
||||||
|
|
||||||
const addPersonsOptions = computed(() => ({
|
const addPersonsOptions = computed(
|
||||||
|
() =>
|
||||||
|
({
|
||||||
uniq: !props.multiple,
|
uniq: !props.multiple,
|
||||||
type: props.types,
|
type: props.types,
|
||||||
priority: null,
|
priority: null,
|
||||||
button: { size: "btn-sm", class: "btn-submit" },
|
button: {
|
||||||
}));
|
size: "btn-sm",
|
||||||
|
class: "btn-submit",
|
||||||
|
},
|
||||||
|
}) as SearchOptions,
|
||||||
|
);
|
||||||
|
|
||||||
|
const isMePicked = computed<boolean>(() => props.picked.indexOf("me") >= 0);
|
||||||
|
|
||||||
const translatedListOfTypes = computed(() => {
|
const translatedListOfTypes = computed(() => {
|
||||||
if (props.label) return props.label;
|
if (props.label !== undefined && props.label !== "") {
|
||||||
let trans = props.types.map((t) =>
|
return props.label;
|
||||||
props.multiple
|
}
|
||||||
? appMessages.fr.pick_entity[t].toLowerCase()
|
|
||||||
: appMessages.fr.pick_entity[t + "_one"].toLowerCase(),
|
const translatedTypes = props.types.map((type: EntityType) => {
|
||||||
);
|
switch (type) {
|
||||||
return props.multiple
|
case "user":
|
||||||
? appMessages.fr.pick_entity.modal_title + trans.join(", ")
|
return trans(PICK_ENTITY_USER, {
|
||||||
: appMessages.fr.pick_entity.modal_title_one + trans.join(", ");
|
count: props.multiple ? 2 : 1,
|
||||||
|
});
|
||||||
|
case "person":
|
||||||
|
return trans(PICK_ENTITY_PERSON, {
|
||||||
|
count: props.multiple ? 2 : 1,
|
||||||
|
});
|
||||||
|
case "thirdparty":
|
||||||
|
return trans(PICK_ENTITY_THIRDPARTY, {
|
||||||
|
count: props.multiple ? 2 : 1,
|
||||||
|
});
|
||||||
|
case "user_group":
|
||||||
|
return trans(PICK_ENTITY_USER_GROUP, {
|
||||||
|
count: props.multiple ? 2 : 1,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return `${trans(PICK_ENTITY_MODAL_TITLE, {
|
||||||
|
count: props.multiple ? 2 : 1,
|
||||||
|
})} ${translatedTypes.join(", ")}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
const listClasses = computed(() => ({
|
const listClasses = computed(() => ({
|
||||||
"list-suggest": true,
|
"badge-suggest": true,
|
||||||
"remove-items": props.removableIfSet,
|
"remove-items": props.removableIfSet,
|
||||||
|
inline: true,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const selectItsMe = (event) =>
|
const selectItsMe = (event: InputEvent): void => {
|
||||||
event.target.checked ? addNewSuggested("me") : removeEntity("me");
|
const target = event.target as HTMLInputElement;
|
||||||
|
if (target.checked) {
|
||||||
const addNewSuggested = (entity) => {
|
addNewSuggested("me");
|
||||||
emit("addNewEntity", { entity });
|
} else {
|
||||||
|
removeEntity("me");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const addNewEntity = ({ selected, modal }) => {
|
function addNewSuggested(entity: EntitiesOrMe) {
|
||||||
selected.forEach((item) => emit("addNewEntity", { entity: item.result }));
|
emits("addNewEntity", { entity });
|
||||||
|
}
|
||||||
|
|
||||||
|
function addNewEntity({ selected }: addNewEntities) {
|
||||||
|
Object.values(selected).forEach((item) => {
|
||||||
|
emits("addNewEntity", { entity: item.result });
|
||||||
|
});
|
||||||
addPersons.value?.resetSearch();
|
addPersons.value?.resetSearch();
|
||||||
modal.showModal = false;
|
|
||||||
emit("addNewEntityProcessEnded");
|
|
||||||
};
|
|
||||||
|
|
||||||
const removeEntity = (entity) => {
|
emits("addNewEntityProcessEnded");
|
||||||
|
}
|
||||||
|
|
||||||
|
const removeEntity = (entity: EntitiesOrMe): void => {
|
||||||
if (!props.removableIfSet) return;
|
if (!props.removableIfSet) return;
|
||||||
if (entity === "me" && itsMeCheckbox.value) {
|
if (entity === "me" && itsMeCheckbox.value) {
|
||||||
itsMeCheckbox.value.checked = false;
|
itsMeCheckbox.value.checked = false;
|
||||||
}
|
}
|
||||||
emit("removeEntity", { entity });
|
emits("removeEntity", { entity });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function getBadgeClass(entities: Entities) {
|
||||||
|
if (entities.type !== "user_group") {
|
||||||
|
return entities.type;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBadgeStyle(entities: Entities) {
|
||||||
|
if (entities.type === "user_group") {
|
||||||
|
return [
|
||||||
|
`ul.badge-suggest li > span {
|
||||||
|
color: ${entities.foregroundColor}!important;
|
||||||
|
border-bottom-color: ${entities.backgroundColor};
|
||||||
|
}`,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.grey-card {
|
||||||
|
background: #f8f9fa;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-check:checked + .btn,
|
||||||
|
:not(.btn-check) + .btn:active,
|
||||||
|
.btn:first-child:active,
|
||||||
|
.btn.active,
|
||||||
|
.btn.show {
|
||||||
|
color: white;
|
||||||
|
box-shadow: 0 0 0 0.2rem var(--bs-chill-green);
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.as-user-group {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
ul.badge-suggest {
|
||||||
|
list-style-type: none;
|
||||||
|
padding-left: 0;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
min-height: 30px;
|
||||||
|
}
|
||||||
|
ul.badge-suggest li > span {
|
||||||
|
white-space: normal;
|
||||||
|
text-align: start;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.badge-suggest.inline li {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 0.2em;
|
||||||
|
}
|
||||||
|
ul.badge-suggest.add-items li {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
ul.badge-suggest.add-items li span {
|
||||||
|
cursor: pointer;
|
||||||
|
padding-left: 2rem;
|
||||||
|
}
|
||||||
|
ul.badge-suggest.add-items li span:hover {
|
||||||
|
color: #ced4da;
|
||||||
|
}
|
||||||
|
ul.badge-suggest.add-items li > span:before {
|
||||||
|
font: normal normal normal 13px ForkAwesome;
|
||||||
|
margin-right: 1.8em;
|
||||||
|
content: "\f067";
|
||||||
|
color: var(--bs-success);
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
top: 50%;
|
||||||
|
left: 0.75rem;
|
||||||
|
-webkit-transform: translateY(-50%);
|
||||||
|
-moz-transform: translateY(-50%);
|
||||||
|
-ms-transform: translateY(-50%);
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
ul.badge-suggest.remove-items li {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
ul.badge-suggest.remove-items li span {
|
||||||
|
cursor: pointer;
|
||||||
|
padding-left: 2rem;
|
||||||
|
}
|
||||||
|
ul.badge-suggest.remove-items li span:hover {
|
||||||
|
color: #ced4da;
|
||||||
|
}
|
||||||
|
ul.badge-suggest.remove-items li > span:before {
|
||||||
|
font: normal normal normal 13px ForkAwesome;
|
||||||
|
margin-right: 1.8em;
|
||||||
|
content: "\f1f8";
|
||||||
|
color: var(--bs-danger);
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
top: 50%;
|
||||||
|
left: 0.75rem;
|
||||||
|
-webkit-transform: translateY(-50%);
|
||||||
|
-moz-transform: translateY(-50%);
|
||||||
|
-ms-transform: translateY(-50%);
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
ul.badge-suggest li > span {
|
||||||
|
margin: 0.2rem 0.1rem;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 1em 0 2.2em !important;
|
||||||
|
background-color: #fff;
|
||||||
|
border: 1px solid #dee2e6;
|
||||||
|
border-bottom-width: 3px;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 0.75em;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.badge-suggest li > span.person {
|
||||||
|
border-bottom-color: #43b29d;
|
||||||
|
}
|
||||||
|
ul.badge-suggest li > span.thirdparty {
|
||||||
|
border-bottom-color: rgb(198.9, 72, 98.1);
|
||||||
|
}
|
||||||
.current-user {
|
.current-user {
|
||||||
color: var(--bs-body-color);
|
color: var(--bs-body-color);
|
||||||
background-color: var(--bs-chill-l-gray) !important;
|
background-color: var(--bs-chill-l-gray) !important;
|
||||||
|
@@ -61,9 +61,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
transName(value) {
|
transName(value) {
|
||||||
return value.code && value.name
|
return value.code && value.name ? `${value.name} (${value.code})` : "";
|
||||||
? `${value.name} (${value.code})`
|
|
||||||
: "";
|
|
||||||
},
|
},
|
||||||
selectCity(city) {
|
selectCity(city) {
|
||||||
this.$emit("selectCity", city);
|
this.$emit("selectCity", city);
|
||||||
@@ -86,9 +84,7 @@ export default {
|
|||||||
|
|
||||||
searchCities(query, this.country, controller)
|
searchCities(query, this.country, controller)
|
||||||
.then((newCities) => {
|
.then((newCities) => {
|
||||||
this.cities = this.cities.filter(
|
this.cities = this.cities.filter((city) => city.id === this.picked);
|
||||||
(city) => city.id === this.picked,
|
|
||||||
);
|
|
||||||
newCities.forEach((item) => {
|
newCities.forEach((item) => {
|
||||||
this.cities.push(item);
|
this.cities.push(item);
|
||||||
});
|
});
|
||||||
|
@@ -10,9 +10,7 @@ const props = defineProps<SavedExportButtonsConfig>();
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<generate-button
|
<generate-button :saved-export-uuid="props.savedExportUuid"></generate-button>
|
||||||
:saved-export-uuid="props.savedExportUuid"
|
|
||||||
></generate-button>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
|
@@ -125,9 +125,7 @@ const onObjectNewStatusCallback = async function (): Promise<void> {
|
|||||||
|
|
||||||
const onClickGenerate = async (): Promise<void> => {
|
const onClickGenerate = async (): Promise<void> => {
|
||||||
emits("generate");
|
emits("generate");
|
||||||
exportGeneration.value = await generateFromSavedExport(
|
exportGeneration.value = await generateFromSavedExport(props.savedExportUuid);
|
||||||
props.savedExportUuid,
|
|
||||||
);
|
|
||||||
|
|
||||||
onObjectNewStatusCallback();
|
onObjectNewStatusCallback();
|
||||||
|
|
||||||
|
@@ -110,9 +110,7 @@ const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return needles.every((n: string) =>
|
return needles.every((n: string) => title.toLowerCase().includes(n));
|
||||||
title.toLowerCase().includes(n),
|
|
||||||
);
|
|
||||||
})
|
})
|
||||||
.filter((genericDoc: GenericDocForAccompanyingPeriod) => {
|
.filter((genericDoc: GenericDocForAccompanyingPeriod) => {
|
||||||
if (placesFilter.value.length === 0) {
|
if (placesFilter.value.length === 0) {
|
||||||
@@ -153,8 +151,7 @@ const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
|||||||
aria-controls="filterOrderCollapse"
|
aria-controls="filterOrderCollapse"
|
||||||
>
|
>
|
||||||
<strong
|
<strong
|
||||||
><i class="fa fa-fw fa-filter"></i>Filtrer la
|
><i class="fa fa-fw fa-filter"></i>Filtrer la liste</strong
|
||||||
liste</strong
|
|
||||||
>
|
>
|
||||||
</button>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
@@ -179,10 +176,7 @@ const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
|||||||
placeholder="Chercher dans la liste"
|
placeholder="Chercher dans la liste"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
/>
|
/>
|
||||||
<button
|
<button type="submit" class="btn btn-misc">
|
||||||
type="submit"
|
|
||||||
class="btn btn-misc"
|
|
||||||
>
|
|
||||||
<i class="fa fa-search"></i>
|
<i class="fa fa-search"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -190,9 +184,7 @@ const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row my-2">
|
<div class="row my-2">
|
||||||
<legend
|
<legend class="col-form-label col-sm-4 required">
|
||||||
class="col-form-label col-sm-4 required"
|
|
||||||
>
|
|
||||||
Date du document
|
Date du document
|
||||||
</legend>
|
</legend>
|
||||||
<div class="col-sm-8 pt-1">
|
<div class="col-sm-8 pt-1">
|
||||||
@@ -218,15 +210,9 @@ const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row my-2">
|
<div class="row my-2">
|
||||||
<div class="col-sm-4 col-form-label">
|
<div class="col-sm-4 col-form-label">Filtrer par</div>
|
||||||
Filtrer par
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-8 pt-2">
|
<div class="col-sm-8 pt-2">
|
||||||
<div
|
<div class="form-check" v-for="p in availablePlaces" :key="p">
|
||||||
class="form-check"
|
|
||||||
v-for="p in availablePlaces"
|
|
||||||
:key="p"
|
|
||||||
>
|
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
v-model="placesFilter"
|
v-model="placesFilter"
|
||||||
@@ -234,9 +220,7 @@ const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
|||||||
class="form-check-input"
|
class="form-check-input"
|
||||||
:value="p"
|
:value="p"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label">{{
|
<label class="form-check-label">{{ placeTrans(p) }}</label>
|
||||||
placeTrans(p)
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -81,16 +81,8 @@ const clickOnAddButton = () => {
|
|||||||
rgba(25, 135, 84, 1) 0px,
|
rgba(25, 135, 84, 1) 0px,
|
||||||
rgba(25, 135, 84, 0) 9px
|
rgba(25, 135, 84, 0) 9px
|
||||||
),
|
),
|
||||||
linear-gradient(
|
linear-gradient(0deg, rgba(25, 135, 84, 1) 0px, rgba(25, 135, 84, 0) 9px),
|
||||||
0deg,
|
linear-gradient(90deg, rgba(25, 135, 84, 1) 0px, rgba(25, 135, 84, 0) 9px);
|
||||||
rgba(25, 135, 84, 1) 0px,
|
|
||||||
rgba(25, 135, 84, 0) 9px
|
|
||||||
),
|
|
||||||
linear-gradient(
|
|
||||||
90deg,
|
|
||||||
rgba(25, 135, 84, 1) 0px,
|
|
||||||
rgba(25, 135, 84, 0) 9px
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -97,8 +97,8 @@ defineExpose({ openModal, closeModal });
|
|||||||
@click="onConfirm"
|
@click="onConfirm"
|
||||||
>
|
>
|
||||||
<template v-if="numberOfPicked > 1">
|
<template v-if="numberOfPicked > 1">
|
||||||
<i class="fa fa-plus"></i> Ajouter
|
<i class="fa fa-plus"></i> Ajouter {{ numberOfPicked }} pièces
|
||||||
{{ numberOfPicked }} pièces jointes
|
jointes
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<i class="fa fa-plus"></i> Ajouter une pièce jointe
|
<i class="fa fa-plus"></i> Ajouter une pièce jointe
|
||||||
|
@@ -81,17 +81,12 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||||||
"this document is already attached to the workflow",
|
"this document is already attached to the workflow",
|
||||||
genericDoc,
|
genericDoc,
|
||||||
);
|
);
|
||||||
this.$toast.error(
|
this.$toast.error("Ce document est déjà attaché au workflow");
|
||||||
"Ce document est déjà attaché au workflow",
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const attachment = await create_attachment(
|
const attachment = await create_attachment(workflowId, genericDoc);
|
||||||
workflowId,
|
|
||||||
genericDoc,
|
|
||||||
);
|
|
||||||
this.$data.attachments.push(attachment);
|
this.$data.attachments.push(attachment);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="props.address.isNoAddress" class="alert alert-info">
|
<div v-if="props.address.isNoAddress" class="alert alert-info">
|
||||||
Cette adresse est incomplète. La position géographique est
|
Cette adresse est incomplète. La position géographique est approximative.
|
||||||
approximative.
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="props.address.point !== null"
|
v-if="props.address.point !== null"
|
||||||
@@ -10,9 +9,7 @@
|
|||||||
></div>
|
></div>
|
||||||
<p>
|
<p>
|
||||||
Voir sur
|
Voir sur
|
||||||
<a :href="makeUrlGoogleMap(props.address)" target="_blank"
|
<a :href="makeUrlGoogleMap(props.address)" target="_blank">Google Maps</a>
|
||||||
>Google Maps</a
|
|
||||||
>
|
|
||||||
<a :href="makeUrlOsm(props.address)" target="_blank">OSM</a>
|
<a :href="makeUrlOsm(props.address)" target="_blank">OSM</a>
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -12,8 +12,7 @@
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<p v-if="props.address.refStatus === 'to_review'">
|
<p v-if="props.address.refStatus === 'to_review'">
|
||||||
<i class="fa fa-warning"></i> L'adresse de référence a été
|
<i class="fa fa-warning"></i> L'adresse de référence a été modifiée.
|
||||||
modifiée.
|
|
||||||
</p>
|
</p>
|
||||||
<p v-if="props.address.refStatus === 'reviewed'">
|
<p v-if="props.address.refStatus === 'reviewed'">
|
||||||
L'adresse est conservée, mais diffère de l'adresse de référence.
|
L'adresse est conservée, mais diffère de l'adresse de référence.
|
||||||
@@ -21,8 +20,7 @@
|
|||||||
|
|
||||||
<template
|
<template
|
||||||
v-if="
|
v-if="
|
||||||
props.address.addressReference.street !==
|
props.address.addressReference.street !== props.address.street ||
|
||||||
props.address.street ||
|
|
||||||
props.address.addressReference.streetNumber !==
|
props.address.addressReference.streetNumber !==
|
||||||
props.address.streetNumber
|
props.address.streetNumber
|
||||||
"
|
"
|
||||||
@@ -30,22 +28,18 @@
|
|||||||
<template v-if="props.address.country.code === 'BE'">
|
<template v-if="props.address.country.code === 'BE'">
|
||||||
<div class="difference">
|
<div class="difference">
|
||||||
<span class="old"
|
<span class="old"
|
||||||
>{{ props.address.street }}
|
>{{ props.address.street }} {{ props.address.streetNumber }}</span
|
||||||
{{ props.address.streetNumber }}</span
|
|
||||||
>
|
>
|
||||||
<span class="new"
|
<span class="new"
|
||||||
>{{ props.address.addressReference.street }}
|
>{{ props.address.addressReference.street }}
|
||||||
{{
|
{{ props.address.addressReference.streetNumber }}</span
|
||||||
props.address.addressReference.streetNumber
|
|
||||||
}}</span
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div class="difference">
|
<div class="difference">
|
||||||
<span class="old"
|
<span class="old"
|
||||||
>{{ props.address.streetNumber }}
|
>{{ props.address.streetNumber }} {{ props.address.street }}</span
|
||||||
{{ props.address.street }}</span
|
|
||||||
>
|
>
|
||||||
<span class="new"
|
<span class="new"
|
||||||
>{{ props.address.addressReference.streetNumber }}
|
>{{ props.address.addressReference.streetNumber }}
|
||||||
@@ -88,12 +82,8 @@
|
|||||||
{{ props.address.point.coordinates[1] }}</span
|
{{ props.address.point.coordinates[1] }}</span
|
||||||
>
|
>
|
||||||
<span class="new"
|
<span class="new"
|
||||||
>{{
|
>{{ props.address.addressReference.point.coordinates[0] }}
|
||||||
props.address.addressReference.point.coordinates[0]
|
{{ props.address.addressReference.point.coordinates[1] }}</span
|
||||||
}}
|
|
||||||
{{
|
|
||||||
props.address.addressReference.point.coordinates[1]
|
|
||||||
}}</span
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -105,18 +95,12 @@
|
|||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="props.address.refStatus === 'to_review'">
|
<li v-if="props.address.refStatus === 'to_review'">
|
||||||
<button
|
<button class="btn btn-sm btn-primary" @click="keepCurrentAddress">
|
||||||
class="btn btn-sm btn-primary"
|
|
||||||
@click="keepCurrentAddress"
|
|
||||||
>
|
|
||||||
Conserver
|
Conserver
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="props.address.refStatus === 'reviewed'">
|
<li v-if="props.address.refStatus === 'reviewed'">
|
||||||
<button
|
<button class="btn btn-sm btn-primary" @click="backToReview">
|
||||||
class="btn btn-sm btn-primary"
|
|
||||||
@click="backToReview"
|
|
||||||
>
|
|
||||||
Ré-examiner
|
Ré-examiner
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user