Fix linting issues
Some checks failed
Compile Java Backend / Compile Backend Code (push) Successful in 1m23s
Lint Java Backend / Checkstyle Java Linting (push) Successful in 46s
Lint Dockerfiles / Lint Dockerfiles (push) Failing after 30s
Lint Frontend / Lint HTML, CSS, and JS (push) Successful in 31s

This commit is contained in:
2025-11-10 18:10:46 +01:00
parent 73ed8b8878
commit 95b26b2e6e
18 changed files with 102 additions and 57 deletions

View File

@@ -16,6 +16,11 @@ jobs:
with: with:
ssh-key: ${{ secrets.SSH_JOHN_PRIVATE_KEY }} ssh-key: ${{ secrets.SSH_JOHN_PRIVATE_KEY }}
- name: Run hadolint - name: Run hadolint
uses: hadolint/hadolint-action@v3.1.0 uses: hadolint/hadolint-action@v3.3.0
with: with:
dockerfile: ./SmartClinicManagementSystem/app/Dockerfile dockerfile: ./SmartClinicManagementSystem/app/Dockerfile
output-file: hadolint.log
- uses: actions/upload-artifact@v4
with:
name: hadolint.log
path: hadolint.log

View File

@@ -17,10 +17,10 @@ jobs:
ssh-key: ${{ secrets.SSH_JOHN_PRIVATE_KEY }} ssh-key: ${{ secrets.SSH_JOHN_PRIVATE_KEY }}
- name: Install linters - name: Install linters
run: | run: |
npm install -g htmlhint stylelint eslint npm install -g htmlhint stylelint stylelint-config-standard eslint
- name: Lint HTML - name: Lint HTML
run: htmlhint "./SmartClinicManagementSystem/app/src/main/resources/static/assets/pages/*.html" || true run: htmlhint "./SmartClinicManagementSystem/app/src/main/resources/static/pages//*.html" || true
- name: Lint CSS - name: Lint CSS
run: stylelint "./SmartClinicManagementSystem/app/src/main/resources/static/assets/css/*.css" || true run: stylelint "./SmartClinicManagementSystem/app/src/main/resources/static/assets/css//*.css" || true
- name: Lint JS - name: Lint JS
run: eslint "./SmartClinicManagementSystem/app/src/main/resources/static/js/*.js" || true run: eslint -c SmartClinicManagementSystem/eslint.config.js "./SmartClinicManagementSystem/app/src/main/resources/static/js//*.js" || true

View File

@@ -7,7 +7,7 @@
margin: 50px auto; margin: 50px auto;
padding: 30px; padding: 30px;
border-radius: 15px; border-radius: 15px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
animation: fadeIn 0.5s ease-in-out; animation: fadeIn 0.5s ease-in-out;
} }
@@ -41,7 +41,7 @@
font-size: 15px; font-size: 15px;
outline: none; outline: none;
transition: 0.3s; transition: 0.3s;
font-family: "Verdana"; font-family: Verdana, serif;
} }
input:focus, textarea:focus { input:focus, textarea:focus {
@@ -53,6 +53,7 @@
#patientName{ #patientName{
background-color: #bdbcbc80; background-color: #bdbcbc80;
} }
.btn-primary { .btn-primary {
background-color: #047857; background-color: #047857;
color: #fff; color: #fff;
@@ -86,6 +87,13 @@
} }
@keyframes fadeIn { @keyframes fadeIn {
from { opacity: 0; transform: translateY(30px); } from {
to { opacity: 1; transform: translateY(0); } opacity: 0;
} transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

View File

@@ -45,7 +45,7 @@ button {
font-size: 16px; font-size: 16px;
} }
button::hover { button:hover {
background-color: #A62B1F; background-color: #A62B1F;
} }
@@ -59,6 +59,6 @@ button::hover {
cursor: pointer; cursor: pointer;
} }
.adminBtn::hover { .adminBtn:hover {
color: #A62B1F; color: #A62B1F;
} }

View File

@@ -59,7 +59,7 @@ tr:nth-child(odd) {
background-color: #ffffffc0; background-color: #ffffffc0;
} }
tr::hover { tr:hover {
background-color: #015c5d39; background-color: #015c5d39;
} }
@@ -71,11 +71,11 @@ tr::hover {
.prescription-btn:hover { .prescription-btn:hover {
transform: scale(1.1); transform: scale(1.1);
background-color: lighten(0.1); filter: brightness(110%);
} }
.prescription-btn:active { .prescription-btn:active {
transform: scale(0.95); transform: scale(0.95);
} }
.noPatientRecord { .noPatientRecord {
@@ -93,7 +93,7 @@ tr::hover {
.date-picker { .date-picker {
margin-left: 10px; margin-left: 10px;
margin-top: 13px; margin-top: 13px;
corner-radius: 8px; border-radius: 8px;
padding: 10px; padding: 10px;
height: 30px; height: 30px;
} }

View File

@@ -6,7 +6,7 @@
html, body { html, body {
height: 100%; height: 100%;
font-family: 'Roboto' sans-serif; font-family: Roboto, sans-serif;
} }
.wrapper { .wrapper {
@@ -19,7 +19,7 @@ h2 {
font-size: 48px; font-size: 48px;
margin-bottom: 50px; margin-bottom: 50px;
color: #003e3e; color: #003e3e;
font-family: 'Alegreya', 'Roboto', sans-serif; font-family: Alegreya, Roboto, sans-serif;
font-weight: bold; font-weight: bold;
} }
@@ -41,11 +41,11 @@ button {
padding: 10px 20px; padding: 10px 20px;
width: 200px; width: 200px;
margin: 10px; margin: 10px;
pointer:cursor; cursor: pointer;
font-size: 16px; font-size: 16px;
} }
button::hover { button:hover {
background-color: #A62B1F; background-color: #A62B1F;
} }
@@ -53,7 +53,6 @@ button::hover {
background-color: #015c5d; background-color: #015c5d;
} }
.dashboard-btn:hover {
.dashboard-btn::hover {
background: #003e3e; background: #003e3e;
} }

View File

@@ -8,6 +8,7 @@
.card-actions:hover{ .card-actions:hover{
background-color: #1c3745; background-color: #1c3745;
} }
.ripple-overlay { .ripple-overlay {
position: fixed; position: fixed;
width: 20px; width: 20px;
@@ -34,7 +35,7 @@
padding: 20px; padding: 20px;
z-index: 10000; z-index: 10000;
transition: bottom 1.5s ease-in; transition: bottom 1.5s ease-in;
box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.3); box-shadow: 0 -5px 10px rgb(0 0 0 / 30%);
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
text-align: center; text-align: center;
} }
@@ -73,6 +74,7 @@
} }
.confirm-booking:hover { .confirm-booking:hover {
filter: brightness(1.2); filter: brightness(1.2);
background-color: #1c3745; background-color: #1c3745;

View File

@@ -50,7 +50,7 @@
/* Responsive behavior */ /* Responsive behavior */
@media (max-width: 600px) { @media (width <= 600px) {
.header { .header {
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
@@ -77,9 +77,11 @@
.doctorHeader{ .doctorHeader{
margin-right: 30px margin-right: 30px
} }
.doctorHeader:hover{ .doctorHeader:hover{
color:#A62B1F; color:#A62B1F;
} }
/* Footer Section */ /* Footer Section */
.footer { .footer {
background-color: #f4f4f4; background-color: #f4f4f4;
@@ -149,7 +151,7 @@
} }
/* Mobile Responsiveness */ /* Mobile Responsiveness */
@media (max-width: 768px) { @media (width <= 768px) {
.footer-container { .footer-container {
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
@@ -171,7 +173,7 @@
top: 0; top: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: rgba(0,0,0,0.6); background-color: rgb(0 0 0 / 60%);
} }
.modal-content { .modal-content {
@@ -229,7 +231,7 @@
.input-field:focus { .input-field:focus {
outline: none; outline: none;
border-color: #015c5d; border-color: #015c5d;
box-shadow: 0 0 5px rgba(1, 92, 93, 0.5); box-shadow: 0 0 5px rgb(1 92 93 / 50%);
filter: brightness(1.2); filter: brightness(1.2);
} }
@@ -255,7 +257,7 @@
width:auto; width:auto;
overflow: hidden; overflow: hidden;
background-color: #fff; background-color: #fff;
box-shadow: 0 4px 6px rgba(0,0,0,0.1); box-shadow: 0 4px 6px rgb(0 0 0 / 10%);
transition: transform 0.2s ease; transition: transform 0.2s ease;
} }
@@ -275,7 +277,7 @@
} }
.doctor-info p { .doctor-info p {
margin: 20px 0px; margin: 20px 0;
font-size: 14px; font-size: 14px;
color: #555; color: #555;
} }
@@ -323,7 +325,7 @@
.searchBar:focus{ .searchBar:focus{
outline: none; outline: none;
border-color: #015c5d; border-color: #015c5d;
box-shadow: 0 0 5px rgba(1, 92, 93, 0.697); box-shadow: 0 0 5px rgb(1 92 93 / 69.7%);
} }
.filter-wrapper { .filter-wrapper {
@@ -350,7 +352,7 @@
.filter-select:focus { .filter-select:focus {
border-color: #015c5d; border-color: #015c5d;
box-shadow: 0 0 5px rgba(1, 92, 93, 0.697); box-shadow: 0 0 5px rgb(1 92 93 / 69.7%);
outline: none; outline: none;
} }

View File

@@ -5,7 +5,7 @@
margin: 10px auto; margin: 10px auto;
padding: 30px; padding: 30px;
border-radius: 15px; border-radius: 15px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
animation: fadeIn 0.5s ease-in-out; animation: fadeIn 0.5s ease-in-out;
} }
@@ -39,7 +39,7 @@
font-size: 15px; font-size: 15px;
outline: none; outline: none;
transition: 0.3s; transition: 0.3s;
font-family: "Verdana"; font-family: Verdana, sans-serif;
} }
input:focus, textarea:focus { input:focus, textarea:focus {
@@ -51,6 +51,7 @@
#patientName{ #patientName{
background-color: #bdbcbc80; background-color: #bdbcbc80;
} }
.btn-primary { .btn-primary {
background-color: #047857; background-color: #047857;
color: #fff; color: #fff;
@@ -84,6 +85,13 @@
} }
@keyframes fadeIn { @keyframes fadeIn {
from { opacity: 0; transform: translateY(30px); } from {
to { opacity: 1; transform: translateY(0); } opacity: 0;
} transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

View File

@@ -6,14 +6,14 @@ document.addEventListener('DOMContentLoaded', async () => {
const medicinesInput = document.getElementById("medicines"); const medicinesInput = document.getElementById("medicines");
const dosageInput = document.getElementById("dosage"); const dosageInput = document.getElementById("dosage");
const notesInput = document.getElementById("notes"); const notesInput = document.getElementById("notes");
const heading = document.getElementById("heading") const heading = document.getElementById("heading");
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
const appointmentId = urlParams.get("appointmentId"); const appointmentId = urlParams.get("appointmentId");
const mode = urlParams.get("mode"); const mode = urlParams.get("mode");
const token = localStorage.getItem("token"); const token = localStorage.getItem("token");
const patientName = urlParams.get("patientName") const patientName = urlParams.get("patientName");
if (heading) { if (heading) {
if (mode === "view") { if (mode === "view") {

View File

@@ -23,7 +23,7 @@ window.adminAddDoctor = async function() {
"specialty": document.getElementById("specialization").value, "specialty": document.getElementById("specialization").value,
"phone": document.getElementById("doctorPhone").value, "phone": document.getElementById("doctorPhone").value,
"availableTimes": Array.from( document.querySelectorAll('input[name=availability]:checked').values()).map(input => input.value) "availableTimes": Array.from( document.querySelectorAll('input[name=availability]:checked').values()).map(input => input.value)
} };
const token = localStorage.getItem("token"); const token = localStorage.getItem("token");
if (token == 'undefined') { if (token == 'undefined') {
@@ -41,4 +41,4 @@ window.adminAddDoctor = async function() {
console.error("Registration failed:", error); console.error("Registration failed:", error);
alert("❌ An error occurred while registering up."); alert("❌ An error occurred while registering up.");
} }
} };

View File

@@ -30,8 +30,8 @@ function loadDoctorCards() {
export function showBookingOverlay(e, doctor, patient) { export function showBookingOverlay(e, doctor, patient) {
const button = e.target; const button = e.target;
const rect = button.getBoundingClientRect(); const rect = button.getBoundingClientRect();
console.log(patient.name) console.log(patient.name);
console.log(patient) console.log(patient);
const ripple = document.createElement("div"); const ripple = document.createElement("div");
ripple.classList.add("ripple-overlay"); ripple.classList.add("ripple-overlay");
ripple.style.left = `${e.clientX}px`; ripple.style.left = `${e.clientX}px`;

View File

@@ -18,13 +18,13 @@ document.addEventListener("DOMContentLoaded", () => {
}); });
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
const loginBtn = document.getElementById("patientLogin") const loginBtn = document.getElementById("patientLogin");
if (loginBtn) { if (loginBtn) {
loginBtn.addEventListener("click", () => { loginBtn.addEventListener("click", () => {
openModal("patientLogin") openModal("patientLogin");
}) });
} }
}) });
document.getElementById("searchBar").addEventListener("input", filterDoctorsOnChange); document.getElementById("searchBar").addEventListener("input", filterDoctorsOnChange);
document.getElementById("filterTime").addEventListener("change", filterDoctorsOnChange); document.getElementById("filterTime").addEventListener("change", filterDoctorsOnChange);
@@ -40,7 +40,7 @@ function loadDoctorCards() {
const card = createDoctorCard(doctor); const card = createDoctorCard(doctor);
contentDiv.appendChild(card); contentDiv.appendChild(card);
}); });
}) });
} }
@@ -67,7 +67,7 @@ function filterDoctorsOnChange() {
contentDiv.innerHTML = "<p>No doctors found with the given filters.</p>"; contentDiv.innerHTML = "<p>No doctors found with the given filters.</p>";
console.log("Nothing"); console.log("Nothing");
} }
}) });
} }
@@ -101,8 +101,8 @@ window.loginPatient = async function () {
const data = { const data = {
email, email,
password password
} };
console.log("loginPatient :: ", data) console.log("loginPatient :: ", data);
const response = await patientLogin(data); const response = await patientLogin(data);
console.log("Status Code:", response.status); console.log("Status Code:", response.status);
console.log("Response OK:", response.ok); console.log("Response OK:", response.ok);
@@ -110,7 +110,7 @@ window.loginPatient = async function () {
const result = await response.json(); const result = await response.json();
console.log(result); console.log(result);
selectRole('loggedPatient'); selectRole('loggedPatient');
localStorage.setItem('token', result.token) localStorage.setItem('token', result.token);
window.location.href = '/pages/loggedPatientDashboard.html'; window.location.href = '/pages/loggedPatientDashboard.html';
} else { } else {
alert('❌ Invalid credentials!'); alert('❌ Invalid credentials!');
@@ -118,8 +118,8 @@ window.loginPatient = async function () {
} }
catch (error) { catch (error) {
alert("❌ Failed to Login : ", error); alert("❌ Failed to Login : ", error);
console.log("Error :: loginPatient :: ", error) console.log("Error :: loginPatient :: ", error);
} }
} };

View File

@@ -20,7 +20,7 @@ async function initializePage() {
// Filter by both patientId and doctorId // Filter by both patientId and doctorId
const filteredAppointments = appointmentData.filter(app => const filteredAppointments = appointmentData.filter(app =>
app.doctorId == doctorId); app.doctorId == doctorId);
console.log(filteredAppointments) console.log(filteredAppointments);
renderAppointments(filteredAppointments); renderAppointments(filteredAppointments);
} catch (error) { } catch (error) {
console.error("Error loading appointments:", error); console.error("Error loading appointments:", error);

View File

@@ -23,7 +23,7 @@ function selectRole(role) {
function renderContent() { function renderContent() {
const role = getRole(); const role = getRole();
if (!role) { if (!role) {
console.error("No role set!") console.error("No role set!");
window.location.href = "/"; // if no role, send to role selection page window.location.href = "/"; // if no role, send to role selection page
return; return;
} }

View File

@@ -15,7 +15,7 @@ async function initializePage() {
const appointmentDate = urlParams.get("appointmentDate"); const appointmentDate = urlParams.get("appointmentDate");
const appointmentTime = urlParams.get("appointmentTime"); const appointmentTime = urlParams.get("appointmentTime");
console.log(doctorId) console.log(doctorId);
if (!token || !patientId) { if (!token || !patientId) {
alert("Missing session data, redirecting to appointments page."); alert("Missing session data, redirecting to appointments page.");
window.location.href = "/pages/patientAppointments.html"; window.location.href = "/pages/patientAppointments.html";

View File

@@ -0,0 +1,11 @@
// eslint.config.js
import { defineConfig } from "eslint/config";
export default defineConfig([
{
rules: {
semi: "error",
"prefer-const": "error",
},
},
]);

View File

@@ -0,0 +1,10 @@
/** @type {import('stylelint').Config} */
export default {
extends: ["stylelint-config-standard"],
rules: {
"selector-class-pattern": null,
"keyframes-name-pattern": null,
"selector-id-pattern": null,
"no-descending-specificity": null
}
};