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

feat: put toggle + disclaimer #237

Merged
merged 5 commits into from
Oct 3, 2023
Merged

feat: put toggle + disclaimer #237

merged 5 commits into from
Oct 3, 2023

Conversation

roshaans
Copy link
Contributor

@roshaans roshaans commented Sep 26, 2023

Adds a toggle to update which graphql endpoint the logs and state are pulled from.

gipp

@roshaans roshaans marked this pull request as ready for review October 2, 2023 22:34
@roshaans roshaans requested a review from a team as a code owner October 2, 2023 22:34
frontend/widgets/src/QueryApi.IndexerStatus.jsx Outdated Show resolved Hide resolved
frontend/replacement.dev.json Show resolved Hide resolved
@@ -105,11 +109,15 @@ State.init({
indexer_resPage: 0,
logsPage: 0,
statePage: 0,
v2Toggle: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we pull the v2Toggle from storage to retain the user's previous selection, and default to false if none? If someone has to refresh their page to view logs for example, and it switches to off each time, that could be frustrating.

Also, does the v2Toggle remain when switching indexers or is it switched back to off when you switch indexers?

Copy link
Contributor Author

@roshaans roshaans Oct 3, 2023

Choose a reason for hiding this comment

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

Good point. I tried to implement it but it was a little finicky.

Gonna leave this for another time. I do not think it is worth the extra effort for now. Later we will transition everyone to v2 anyways.

className="shadow-none"
id={`toggle-${key}`}
onCheckedChange={disabled ? null : onSwitch}
title={disabled ? `Permanently ${active ? "enabled" : "disabled"}` : null}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this line do? What is supposed to be "permanently enabled/disabled"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite sure actually. I copied this component from devgogs.near

@roshaans roshaans merged commit 2fc4e96 into main Oct 3, 2023
@roshaans roshaans deleted the feat/v2-toggle branch October 3, 2023 19:23
@roshaans roshaans linked an issue Oct 3, 2023 that may be closed by this pull request
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.

Create a V2/V1 toggle in QueryAPI.App
2 participants