Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFT-187 Adding notes api for payroll #624

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

DenisDDBT
Copy link
Contributor

  • JIRA ticket referenced in title
  • Title is clear and concise
  • Description gives any relevant detail
  • Tests are up to date
  • Documentation is up to date

@DenisDDBT DenisDDBT requested a review from a team as a code owner February 18, 2025 11:49
adding service function

fixing sort order

adding error handleing

fixing error handler

adding basic tests
@DenisDDBT DenisDDBT force-pushed the FFT-187/notes-api branch 2 times, most recently from c9cf14b to d441dab Compare February 25, 2025 14:00
@@ -83,32 +83,64 @@ export async function getData(url) {
*/
export async function postData(url = "", data = {}, headers = {}) {
const csrftoken = window.CSRF_TOKEN;
try {
Copy link
Contributor

Choose a reason for hiding this comment

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

i feel uneasy about some of the changes made here. i need to spend more time here.

max-width: 100%;
width: 200px;
display: inline-block;
transform: translateY(6px);
Copy link
Contributor

Choose a reason for hiding this comment

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

this feels a bit magic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is, Paul has asked for ellipsis which is not active if your element is inline, and if I convert it to inline-block, line heights etc are getting different to the next link element. I could use flex or grid but they also come with different caveats.

Copy link
Contributor

Choose a reason for hiding this comment

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

idea: could we handle it in javascript and truncate the string there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As a rule of thumb, I try to avoid css task to be outsourced to js. Having said that, if you are keen to do it in js, sure, I can add some function to truncate the text and add ... if content is more thatn 20 chars

payroll/api.py Outdated
return JsonResponse({}, status=204)
except json.JSONDecodeError:
return JsonResponse({"error": "Invalid JSON format"}, status=400)
except ValidationError:
Copy link
Contributor

Choose a reason for hiding this comment

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

i can't see anything that would return a validation error?

the service function raises value error, did you mean that?

@@ -19,6 +19,16 @@
EditPayrollApiView.as_view(),
name="api",
),
path(
"api/<str:cost_centre_code>/<int:financial_year>/vacancies/notes",
Copy link
Contributor

Choose a reason for hiding this comment

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

we need to implement this for vacancies as well

do you want to do this as part of this ticket or a separate one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was my point I raised yesterday, is there any need to add it if logic and params are the same?

Copy link
Contributor

Choose a reason for hiding this comment

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

your API endpoint will need to handle both vacancies and employees which it currently doesn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants