Skip to content

Commit

Permalink
Fix basics behaviors.
Browse files Browse the repository at this point in the history
  • Loading branch information
obrymec committed Dec 22, 2023
1 parent de685e1 commit 30fa618
Show file tree
Hide file tree
Showing 3 changed files with 301 additions and 199 deletions.
90 changes: 64 additions & 26 deletions back_end/sources/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Obrymec - [email protected]
* @file controller.js
* @created 2022-02-03
* @updated 2023-12-16
* @updated 2023-12-22
* @supported DESKTOP
* @version 0.0.2
*/
Expand Down Expand Up @@ -50,7 +50,8 @@ module.exports.get_expired_contracts = (
result ({
status: 500,
message: `
Request failed.
Request failed. Unable to
get expired contracts.
Try Again !
`
});
Expand Down Expand Up @@ -87,7 +88,8 @@ module.exports.get_running_contracts = (
result ({
status: 500,
message: `
Request failed.
Request failed. Unable to
get running contracts.
Try Again !
`
});
Expand Down Expand Up @@ -176,8 +178,9 @@ module.exports.get_bad_employees = (
result ({
status: 500,
message: `
Request failed.
Try Again !"
Request failed. Unable to
get offending employees.
Try Again !
`
});
// Otherwise.
Expand Down Expand Up @@ -252,7 +255,8 @@ module.exports.get_employee_mistakes = (
result ({
status: 500,
message: `
Request failed.
Request failed. Unable to
get employee's misconducts
Try Again !
`
});
Expand Down Expand Up @@ -380,8 +384,8 @@ module.exports.stop_contract = (
result ({
status: 500,
message: `
Request failed.
Try Again !
No employee has
been chosen.
`
});
// Otherwise.
Expand All @@ -403,7 +407,8 @@ module.exports.stop_contract = (
result ({
status: 500,
message: `
Request failed.
Request failed. Unable
to stop this contract.
Try Again !
`
});
Expand All @@ -424,7 +429,8 @@ module.exports.stop_contract = (
result ({
status: 500,
message: `
Request failed.
Request failed. Unable
to stop this contract.
Try Again !
`
});
Expand All @@ -437,7 +443,7 @@ module.exports.stop_contract = (
message: `
The contract was
successfully
terminated.
stoped.
`
});
}
Expand Down Expand Up @@ -509,7 +515,8 @@ module.exports.save_mistake = (
result ({
status: 500,
message: `
Request failed.
Request failed. Unable
to save this mistake.
Try Again !
`
});
Expand All @@ -521,8 +528,7 @@ module.exports.save_mistake = (
status: 200,
message: `
Fault registration
completed
successfully !
completed successfully !
`
});
}
Expand Down Expand Up @@ -592,7 +598,7 @@ module.exports.sign_in = (
result ({
status: 500,
message: `
Request failed.
Something wrong.
Try Again !
`
});
Expand Down Expand Up @@ -660,7 +666,7 @@ module.exports.override_contract = (
status: 500,
message: `
Some field(s)
are empty."
are empty.
`
});
// Otherwise.
Expand Down Expand Up @@ -712,7 +718,8 @@ module.exports.override_contract = (
result ({
status: 500,
message: `
Request failed.
Request failed. Unable to
override this contract.
Try Again !
`
});
Expand Down Expand Up @@ -807,7 +814,7 @@ module.exports.save_contract = (
result ({
status: 500,
message: `
Request failed.
Something wrong.
Try Again !
`
});
Expand All @@ -822,7 +829,7 @@ module.exports.save_contract = (
status: 500,
message: `
This employee is
already under
already under a
contract.
`
});
Expand Down Expand Up @@ -857,7 +864,8 @@ module.exports.save_contract = (
result ({
status: 500,
message: `
Request failed.
Request failed. Unable
to save this contract.
Try Again !
`
});
Expand Down Expand Up @@ -909,7 +917,21 @@ module.exports.sign_up = (
status: 500,
message: `
Some field(s)
are empty."
are empty.
`
});
// Whether the given
// username is invalid.
} else if (
!/^[a-zA-Z0-9_ïèéêûÊÉÈÏÛÇçæÆŒœ\.\-]*$/
.test (data.username)
) {
// Sends an error message.
result ({
status: 500,
message: `
The given username
is invalid.
`
});
// Whether the passed email
Expand All @@ -928,8 +950,23 @@ module.exports.sign_up = (
is invalid.
`
});
// Whether the password is
// not valid.
// Whether the password
// length is less than
// height (08).
} else if (
data.password.length < 8
) {
// Sends an error
// message.
result ({
status: 500,
message: `
The password must have
least (08) characters.
`
});
// Whether the passwords
// aren't a match.
} else if (
data.password.length !==
data.confirm.length
Expand Down Expand Up @@ -968,7 +1005,7 @@ module.exports.sign_up = (
result ({
status: 500,
message: `
Request failed.
Something wrong.
Try Again !
`
});
Expand Down Expand Up @@ -1015,8 +1052,9 @@ module.exports.sign_up = (
result ({
status: 500,
message: `
Request failed.
Try Again !
Request failed. We have
some difficulties to
sign up you. Try Again !
`
});
// Otherwise.
Expand Down
21 changes: 16 additions & 5 deletions front_end/public/generic.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @fileoverview: The main stylesheet of application.
* @author: Obrymec - [email protected]
* @created: 2022-02-03
* @updated: 2023-12-17
* @updated: 2023-12-21
* @supported: DESKTOP
* @file: generic.css
* @version: 0.0.3
Expand All @@ -14,8 +14,13 @@ div.active {
background-color: var(--primary-color) !important;
}

/* Button hover and table header */
thead.table-header, button:hover {
/* Button hover */
button:hover {
background-color: var(--primary-color-300);
}

/* Table header */
thead.table-header {
background-color: var(--primary-color);
}

Expand All @@ -29,8 +34,8 @@ tbody.light-silver {
background-color: var(--light-white);
}

/* Inputs focus */
input:focus, select:focus {
/* Input focus */
input:focus {
border-color: var(--primary-color);
}

Expand Down Expand Up @@ -70,6 +75,12 @@ div.empty-section {
height: 100%;
}

/* Select hover */
select:hover {
border-color: var(--primary-color);
cursor: pointer;
}

/* Inputs placeholder */
textarea::placeholder,
input::placeholder {
Expand Down
Loading

0 comments on commit 30fa618

Please sign in to comment.