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

Import actions within the Import/Export collections modal need a loading state #4145

Closed
jamesgeorge007 opened this issue Jun 25, 2024 · 8 comments
Assignees
Labels
fosshack Relegated issue for FOSS Hack 2024 Partner Projects Programme

Comments

@jamesgeorge007
Copy link
Member

Note

This is intended for FOSSHACK participants.

Description

While importing a large collection in a team workspace, it'll be nice to have a loading state for the Import button while the network calls happen behind the scenes.

import-collections-modal-loading-state-requirement.mov

It should also stay disabled to prevent creating duplicate entries if clicking Import multiple times.

@jamesgeorge007 jamesgeorge007 added the fosshack Relegated issue for FOSS Hack 2024 Partner Projects Programme label Jun 25, 2024
@kyoichishido
Copy link

Hi, I wanna work on this, please assign me. I can't find the guide to set-up this repo locally

@jamesgeorge007
Copy link
Member Author

jamesgeorge007 commented Jul 4, 2024

Hi @kyoichishido, sorry for the delayed response. To reiterate, this is intended for FOSSHACK participants. Please make sure to register as a participant if you haven't already. You can find more information here.

Follow the below steps to set up the repo locally.

  • Please ensure the prerequisites are met by following the guide here.
  • Clone the repo locally and navigate to the path.
  • Create a .env file at the project root copying over the contents from .env.example. More information can be found here.
  • The codebase is a monorepo based on pnpm workspaces. Run pnpm i at the project root that will install the dependencies followed by running the postinstall script for the applicable packages.
  • Run pnpm dev from the same path that spins up the dev server.

You can get up and running quickly with the above steps. To enable any functionality behind login, you'll have to set up the backend container following the steps below.

Backend setup

  • Create relevant OAuth apps to enable third-party authentication referring to the guide here.
  • Build the backend container via docker compose build hoppscotch-backend.
  • Now run docker compose run --entrypoint sh hoppscotch-backend.
  • The above command opens a shell inside an instance of the backend container. Now run pnpm prisma migrate deploy to run the migrations. More information can be found here.
  • Spin up the backend container via docker compose up hoppscotch-backend.

Alternatively, you can use the AIO container which is a single container that provides all the services required to run Hoppscotch.

P.S: Any updates locally will require rebuilding the AIO container. For development, the above approach where the FE dev server is spun up locally along with the backend container would suffice.

# Build the container locally
docker compose build hoppscotch-aio

# Run migrations
docker compose run --entry-point hoppscotch-aio

# While at the launched shell with the above command
pnpm prisma migrate deploy

# Followed by
docker compose up hoppscotch-aio

Let us know if you have any questions.

@HelixY2J
Copy link
Contributor

I am participating in FOSS Hack where I have registered and joined a team. My initial approach for this is to set a flag that will disable the button and show a loading message while the async process is running. Once the process completes, the flag will be toggled back.Can this issue be assigned to me?

@jamesgeorge007
Copy link
Member Author

jamesgeorge007 commented Jul 11, 2024

Hi @HelixY2J, thanks for expressing interest. @kyoichishido, can you confirm if you've registered as a participant and like to pick this up? Else, this can be assigned to @HelixY2J.

@jamesgeorge007
Copy link
Member Author

Assigning this to @HelixY2J.

@HelixY2J
Copy link
Contributor

I created a reactive variable "isImporterInProgress "using Vue ref function and added it into the existing import logic in collections/importexport.vue. It will be set true when the import starts and reset to false after completion.Can I get some feedback on whether this approach is appropriate or there are any alternative methods that should be considered for handling the loading state

@jamesgeorge007
Copy link
Member Author

jamesgeorge007 commented Jul 28, 2024

Hi, a quick suggestion regarding the behaviour. It would be nice to have a loading spinner before the button label Import while the button stays disabled. Since it wasn't explicitly stated initially and the hacking period is about to end, we'll consider the existing implementation and bring in any changes as required during the evaluation period.

@jamesgeorge007 jamesgeorge007 changed the title Import collections modal needs a loading state Import actions within the Import/Export collections modal need a loading state Sep 11, 2024
@jamesgeorge007
Copy link
Member Author

Implemented in #4217 and released as part of v2024.9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fosshack Relegated issue for FOSS Hack 2024 Partner Projects Programme
Projects
None yet
Development

No branches or pull requests

3 participants