Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
59f8734
compatibilite / dependance a crudit studio 2le/crudit#556
TheoHab Sep 17, 2025
2ac2bf1
compatibilite / dependance a crudit studio 2le/crudit#556
TheoHab Sep 17, 2025
4b90e6b
cache + allegement cmd
Oct 24, 2025
1ab9c55
pipeline
Oct 24, 2025
dc0681b
github action cache v2->v4
Oct 24, 2025
e6d9957
Refactor load service
valentin-helies Oct 24, 2025
c793eb4
Refactor init + warmup services
valentin-helies Oct 24, 2025
932ce96
Rename command
valentin-helies Oct 24, 2025
3df05e5
Rename configs
valentin-helies Oct 24, 2025
c9cca4b
Delete useless service
valentin-helies Oct 24, 2025
559631d
Update matrice
valentin-helies Oct 24, 2025
33021a2
add client
Oct 24, 2025
e9f3ae5
Update design
valentin-helies Oct 24, 2025
edc8fc6
Update design
valentin-helies Oct 24, 2025
37228e4
api toggle
Oct 24, 2025
da55b03
controller et js
Oct 24, 2025
9355b3e
Merge branch 'compatibilite_crudit_studio' of github.com:2lenet/Crede…
Oct 24, 2025
fdb7971
Modify controllers
valentin-helies Oct 27, 2025
63fe5ef
Modify routes + warmup service
valentin-helies Oct 27, 2025
9754900
Rename entity column
valentin-helies Oct 27, 2025
26944b1
PHPCS
valentin-helies Oct 27, 2025
2750eb9
PHPSTAN
valentin-helies Oct 27, 2025
af30db3
Add token for api call security
valentin-helies Oct 27, 2025
b6607fc
Modify load service
valentin-helies Oct 27, 2025
fe7a745
PHPCS
valentin-helies Oct 27, 2025
e081434
Merge master
valentin-helies Dec 2, 2025
a20e9a2
Fix phpstan
valentin-helies Dec 2, 2025
bb04d21
Fix phpstan annotation error
valentin-helies Dec 2, 2025
358e579
Credential: modify setLabel parameter name
valentin-helies Dec 3, 2025
d7a1131
Fix some problems + finish client adaptation
valentin-helies Dec 3, 2025
0460dc8
Fix PHPStan
valentin-helies Dec 4, 2025
1ef6175
Lable => label
valentin-helies Dec 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/vendor/
/.phpcs-cache
/node_modules
209 changes: 209 additions & 0 deletions assets/scripts/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
import Toastify from 'toastify-js'

window.addEventListener('load', () => {
let matrice = document.getElementById('lle-credential-matrice');
if (matrice) {
checkSections();
checkGroups();

checkAllCredentialsOfGroup();
checkAllCredentialsOfSection();
checkCredential();
enableCredentialByStatus();
checkCredentialByStatus();
}
});

function checkSections() {
const sectionCheckboxes = document.querySelectorAll('.lle-credential-checkbox-group-section');

// Check sectionCheckbox if all credentials are checked
for (let sectionCheckbox of sectionCheckboxes) {
let groupId = sectionCheckbox.dataset.groupId;
let sectionName = sectionCheckbox.dataset.sectionName;

let allChecked = true;
let checkboxes = document.querySelectorAll('.lle-credential-checkbox-group-' + groupId + '-section-' + sectionName + '-credential');

for (let checkbox of checkboxes) {
if (!checkbox.checked) {
allChecked = false;
break;
}
}

sectionCheckbox.checked = allChecked;
}
}

function checkGroups() {
const groupCheckboxes = document.querySelectorAll('.lle-credential-checkbox-group');

// Check groupCheckbox if all sections are checked
for (let groupCheckbox of groupCheckboxes) {
let groupId = groupCheckbox.dataset.groupId;

let allChecked = true;
let checkboxes = document.querySelectorAll('.lle-credential-checkbox-group-' + groupId + '-section');

for (let checkbox of checkboxes) {
if (!checkbox.checked) {
allChecked = false;
break;
}
}

groupCheckbox.checked = allChecked;
}
}

function checkAllCredentialsOfGroup() {
const groupCheckboxes = document.querySelectorAll('.lle-credential-checkbox-group');
groupCheckboxes.forEach((groupCheckbox) => {
groupCheckbox.addEventListener('click', () => {
let shouldCheck = window.confirm(groupCheckbox.dataset.confirmMessage);
if (!shouldCheck) {
groupCheckbox.checked = !groupCheckbox.checked;
return;
}

let groupId = groupCheckbox.dataset.groupId;
fetch('/admin/credential/toggle-group/' + groupId + '/' + (groupCheckbox.checked ? 1 : 0), { method: 'post' })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

du coup on part du principe qu'on met /admin en préfixe. bon j'imagine que c'était déjà le cas en v1

.then((response) => {
if (response.status === 200) {
let checkboxes = document.querySelectorAll('.lle-credential-checkbox-group-' + groupId + '-credential');
checkboxes.forEach((checkbox) => {
checkbox.checked = groupCheckbox.checked;
});

let sectionCheckboxes = document.querySelectorAll('.lle-credential-checkbox-group-' + groupId + '-section');
sectionCheckboxes.forEach((sectionCheckbox) => {
sectionCheckbox.checked = groupCheckbox.checked;
});

showToast("Success", "#1CC88A");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

le message est toujours en anglais ?

} else {
groupCheckbox.checked = !groupCheckbox.checked;

showToast("Error", "#E74A3B");
}
});
});
});
}

function checkAllCredentialsOfSection() {
const sectionCheckboxes = document.querySelectorAll('.lle-credential-checkbox-group-section');
sectionCheckboxes.forEach((sectionCheckbox) => {
sectionCheckbox.addEventListener('click', () => {
let shouldCheck = window.confirm(sectionCheckbox.dataset.confirmMessage);
if (!shouldCheck) {
sectionCheckbox.checked = !sectionCheckbox.checked;
return;
}

let groupId = sectionCheckbox.dataset.groupId;
let sectionName = sectionCheckbox.dataset.sectionName;
fetch('/admin/credential/toggle-section/' + sectionName + '/' + groupId + '/' + (sectionCheckbox.checked ? 1 : 0), { method: 'post' })
.then((response) => {
if (response.status === 200) {
let checkboxes = document.querySelectorAll('.lle-credential-checkbox-group-' + groupId + '-section-' + sectionName + '-credential');
checkboxes.forEach((checkbox) => {
checkbox.checked = sectionCheckbox.checked;
});

showToast("Success", "#1CC88A");
} else {
sectionCheckbox.checked = !sectionCheckbox.checked;

showToast("Error", "#E74A3B");
}
});

checkGroups();
});
});
}

function checkCredential() {
const credentialCheckboxes = document.querySelectorAll('.lle-credential-checkbox');
credentialCheckboxes.forEach((credentialCheckbox) => {
credentialCheckbox.addEventListener('click', () => {
let groupId = credentialCheckbox.dataset.groupId;
let credentialId = credentialCheckbox.dataset.credentialId;
fetch('/admin/credential/toggle-credential/' + credentialId + '/' + groupId + '/' + (credentialCheckbox.checked ? 1 : 0), { method: 'post' })
.then((response) => {
if (response.status === 200) {
showToast("Success", "#1CC88A");
} else {
credentialCheckbox.checked = !credentialCheckbox.checked;

showToast("Error", "#E74A3B");
}
});

checkSections();
checkGroups();
});
});
}

function enableCredentialByStatus() {
const credentialsByStatus = document.querySelectorAll('.lle-credential-checkbox-status-list');
credentialsByStatus.forEach((credentialByStatus) => {
credentialByStatus.addEventListener('click', () => {
let groupId = credentialByStatus.dataset.groupId;
let credentialId = credentialByStatus.dataset.credentialId;
fetch('/admin/credential/allowed-status/' + credentialId + '/' + groupId + '/' + (credentialByStatus.checked ? 1 : 0), { method: 'post' })
.then((response) => {
if (response.status === 200) {
let statusList = document.querySelector('.lle-credential-group-' + groupId + '-credential-' + credentialId + '-show-status');
if (statusList.classList.contains('d-none')) {
statusList.classList.remove('d-none');
} else {
statusList.classList.add('d-none');
}

showToast("Success", "#1CC88A");
} else {
credentialByStatus.checked = !credentialByStatus.checked;

showToast("Error", "#E74A3B");
}
});
});
});
}

function checkCredentialByStatus() {
const credentialStatusCheckboxes = document.querySelectorAll('.lle-credential-checkbox-group-credential-status');
credentialStatusCheckboxes.forEach((credentialStatusCheckbox) => {
credentialStatusCheckbox.addEventListener('click', () => {
let groupId = credentialStatusCheckbox.dataset.groupId;
let credentialId = credentialStatusCheckbox.dataset.credentialId;
let credentialStatus = credentialStatusCheckbox.dataset.credentialStatus;
fetch('/admin/credential/allowed-by-status/' + credentialId + '/' + groupId + '/' + credentialStatus + '/' + (credentialStatusCheckbox.checked ? 1 : 0), { method: 'post' })
.then((response) => {
if (response.status === 200) {
showToast("Success", "#1CC88A");
} else {
credentialStatusCheckbox.checked = !credentialStatusCheckbox.checked;

showToast("Error", "#E74A3B");
}
});
});
});
}

function showToast(text, color) {
Toastify({
text: text,
duration: 1500,
style: {
background: color,
padding: '15px 20px',
fontSize: '17px',
},
}).showToast();
}
27 changes: 27 additions & 0 deletions assets/styles/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@import 'toastify-js/src/toastify.css';

#lle-credential-matrice {
.card-header {
background-color: #cccccc;
}

tbody {
tr {
th:first-child {
width: 450px;
}
}

tr:first-child {
.groups {
height: 200px;
display: flex;
justify-content: center;

span {
writing-mode: vertical-lr;
}
}
}
}
}
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
"symfony/console": "^7.0 || ^8.0",
"symfony/form": "^7.0 || ^8.0",
"symfony/framework-bundle": "^7.0 || ^8.0",
"symfony/http-client": "^7.0 || ^8.0",
"symfony/http-kernel": "^7.0 || ^8.0",
"symfony/security-bundle": "^7.0 || ^8.0",
"symfony/serializer": "^7.0 || ^8.0",
"symfony/translation": "^7.0 || ^8.0",
"symfony/validator": "^7.0 || ^8.0",
"symfony/var-exporter": "^7.0"
Expand Down
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"devDependencies": {
"@symfony/webpack-encore": "^1.5.0",
"eslint": "^7.29.0",
"file-loader": "^6.2.0",
"jest": "^26.6.3",
"prettier": "^2.3.1",
"sass-loader": "^11.1.1"
},
"license": "MIT",
"private": true,
"scripts": {
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production"
},
"dependencies": {
"@popperjs/core": "^2.9.2",
"bootstrap": "^5.0.2",
"toastify-js": "^1.12.0"
}
}
37 changes: 0 additions & 37 deletions src/Command/CredentialDumpCommand.php

This file was deleted.

47 changes: 0 additions & 47 deletions src/Command/CredentialLoadCommand.php

This file was deleted.

Loading
Loading