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

Add button to delete sessions #211

Open
Eldemarkki opened this issue Feb 17, 2023 · 18 comments
Open

Add button to delete sessions #211

Eldemarkki opened this issue Feb 17, 2023 · 18 comments
Assignees
Labels
enhancement New feature or request priority-low

Comments

@Eldemarkki
Copy link
Member

API: /activity/delete

@Eldemarkki Eldemarkki added enhancement New feature or request priority-low labels Feb 17, 2023
@Aspireve
Copy link

Aspireve commented Feb 20, 2023

Hey Hi!! @Eldemarkki
Could I try working on this issue?
All I need to do is to create a button that fires a function that POSTs /activity/delete right?
Or is there something even more deeper that I would have to consider?

@DrVilepis
Copy link
Member

Not really, you can feel free to try implemeting it.

@Eldemarkki
Copy link
Member Author

Yes, you can!

I was thinking that when you click on a project name in the dashboard it opens a modal that shows a list of all sessions of that project. Then on each row you have same data about the session, and a button that deletes it.

Writing this comment I realized the scope grew a lot… would you like to try doing all of that? There are examples in the cadebase already for opening modals and creating lists with buttons.

@Aspireve
Copy link

Ill try my best doing this!!

@Aspireve
Copy link

Hmm I have been trying to run the application it always shoots this error
image
I guess its an error with this command in the package.json file
image
On deleting that line I was able to run the aaplication but then was met with another error
image

  • this was while using the register part

@Chicken
Copy link
Member

Chicken commented Feb 21, 2023

The first error is most likely an issue because of windows. This way of setting environmental variables only works on unix platforms. A solution such as cross-env might be preferable. Or simply setting the variable in an .env file.

@Aspireve
Copy link

Hmm I didn't quite understand, could you explain

@Chicken
Copy link
Member

Chicken commented Feb 21, 2023

Simply move the VITE_API_URL=https://api.testaustime.fi to an .env file and remove it from the package script.

@Aspireve
Copy link

Ohh I actually tried using cross-env as you said before and it surprisingly worked!! Thanks a lot!!
Now ill get to trying to solve this issue!!

@Aspireve
Copy link

And also after that I was able to register properly without any issues!!

@Aspireve
Copy link

Hey Hi could you explain how could I do it?
Cause I tried doing some stuff and it kinda doesnt seem to work
What I did

  1. Locate the place where the edit project button resides
  2. Add another element to the same title to open a modal to delete the project session
    image
  3. Opened Modal
    image

But after this for some reason I am not able to send a response back to delete the project.
If you could provide the method you use to send APIs I could try finding my way from there

@Chicken
Copy link
Member

Chicken commented Feb 22, 2023

The project calls the API with some fancy custom hooks with react-query mutations. See the src/hooks/useActivities.tsx
Also, GitHub issues are a bit clunky. May I interest you in joining our Discord Server where we could communicate faster in, for example, the #koodaus channel. It's a finnish server but we will talk in English if asked.

@Eldemarkki
Copy link
Member Author

@Aspireve I meant that the user should be able to delete individual sessions, but currently by your screenshots it looks like you are deleting a whole project. I think we should show the session list in the same dialog as the project editing (EditProjectModal). There, each session would have a delete button.

Here's a very rough sketch of what I was thinking:
image

@Aspireve
Copy link

Ohh Something like that!!
I thought by sessions you meant the programs that the user has worked upon

@Eldemarkki
Copy link
Member Author

@Aspireve Are you still doing this? If not, I can de-assign you from this task so someone else can do this.

@Aspireve
Copy link

Hey Hi!! Thanks for reminding about this, I actually started learning about TypeScript to solve this issue and during that completely forgot about this issue.
I try solving it right away!!

@Aspireve
Copy link

Hey Hi!!
So again while running it I got the error of invalid credentials while registering aswell
So is there any solution to that

@Eldemarkki
Copy link
Member Author

Looks like we have some misconfiguration in the rate limiting, because it appears that only 1 person can register per day. The "Invalid credentials" message is completely wrong, and I've created issue #294 for it. Could @DrVilepis, @lajp or @Chicken figure out a way for @Aspireve to create an account?

If you want to, you can also join our Discord server at https://discord.gg/GRD9G74D so we can give more real-time help. We are mostly Finnish speakers there, but we all know English too so that's no problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-low
Projects
None yet
Development

No branches or pull requests

4 participants