NoroffFEU / agency.noroff.dev

Frontend web application for the Noroff Agency API
7 stars 16 forks source link

Job listings: Disable search bar until page has completed loading #1041

Closed Tanific closed 6 months ago

Tanific commented 8 months ago

UX: Users shouldn't be able to interact with the search bar until all content has loaded in.

JohanLossius commented 7 months ago

Working to fix this. Currently trying to wrap my head around how the project itself works, and then will complete this task properly.

JohanLossius commented 7 months ago

I have added the following code:

document.addEventListener("DOMContentLoaded", function() { displaySearchBarAfterLoad(); });

export function displaySearchBarAfterLoad() { const searchListingContId = document.getElementById('searchListingContId'); searchListingContId.classList.remove('d-none'); };

I don't know how to make sure the search bar displays only after the api request has been completed.

JohanLossius commented 7 months ago

Sorted it out now, eventually. Trying to commit my branch, but getting: "/usr/bin/env: ‘sh\r’: No such file or directory"

after i git add and commit the relevant files. No clue how to sort that out.

MariuszRozycki commented 7 months ago

@JohanLossius @Tanific @NoroffFEU/phoenix, @sulenchy

First try: git add . && git commit -m “name of your commit” git add . - saves all changes made in all files, U don’t need to write whole path. Git finds the path automatically.

Second option: For me @JohanLossius, @Tanific @NoroffFEU/phoenix, @sulenchy It looks like problem with end-of-line character style. U can try to solve it in VSC this way:

  1. Open the file in Visual Studio Code.
  2. Click on the part of the status bar where it says CRLF.
  3. Select LF from the list to change the line break style.

Image

@sulenchy Could U look at this message or @Tanific can U contact with @sulenchy and ask is my way of thinkig correctly?

Tanific commented 7 months ago

@MariuszRozycki I have forwarded the message to PO!

sulenchy commented 7 months ago

@JohanLossius If you are still experiencing this issue, please check out the solution provided in this thread: https://stackoverflow.com/questions/18172405/getting-error-usr-bin-env-sh-no-such-file-or-directory-when-running-command-p.

@MariuszRozycki was correct in identifying the issue. It appears to be related to line endings, which could arise from switching between different operating systems while working on the same task. Therefore, the solution provided by him may resolve the problem.

JohanLossius commented 7 months ago

Thank you. I installed dos2unix, and tried unix-converting the relevant files to commit / upload.

Still getting the same feedback: image

Ill test out a few more options, such as converting all the files / scrips etc., and not only the files I have changed.

JohanLossius commented 7 months ago

Hello. @MariuszRozycki @Tanific @sulenchy I managed to solve the task itself, and fix the line endings. Now struggling with the following when trying to commit: "Git: .husky/pre-commit: line 6: npx: command not found"

Have tried the fixes suggested by ChatGPT, and working with Mariusz currently to figure out how to solve it.

Currently unable to commit my changes based on the above.

Have also sent my changes to the work files to Mariusz, so in worst case, he can create the PR for me/us, so we can get the task completed before the time runs out.

JohanLossius commented 7 months ago

Wonderful @MariuszRozycki, thanks a lot! :)

MariuszRozycki commented 7 months ago

@JohanLossius @Tanific @sulenchy, @NoroffFEU/phoenix No problem. Ticket is now moved to DONE :)

github-actions[bot] commented 6 months ago

This issue is being closed because it has been inactive for 30 days. Please open a new issue if you are still encountering this problem.