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

Adding registration applications queue. #1339

Merged
merged 23 commits into from
Feb 12, 2024
Merged

Adding registration applications queue. #1339

merged 23 commits into from
Feb 12, 2024

Conversation

dessalines
Copy link
Member

@dessalines dessalines commented Jan 30, 2024

This adds an interface to handle registration applications for admins. Most of this is copied visually from lemmy-ui, but I'm open to improvements / suggestions.

One minor quirk (that also exists for lemmy-ui), is that the button on the bottom app bar only shows up after the site is fetched.

The only way around that would be to persist admin and mod status in the DB, which seems a bit fragile since those can be updated non-locally.

Demo:

Screenrecorder-2024-02-07-11-39-06-665_0_COMPRESSED.mp4

#1182

dessalines and others added 9 commits January 30, 2024 10:37
* Starting to work on admin_view_votes, needs API added yet.

* Finished up adding admin view votes.

* Fix package name.

* Upping lemmy-api version.

* Adding a moderation subfield to post and comment action dropdowns.

* Adding feature flag check.

* Addressing PR comments.

- Moving padding up to Box.
- Using alternate feature flag method.
* SwipeToAction composable

* Swipe to downvote/upvote feature implemented with preset-based customization

* Fix kotlin format

* fix string resource

* Do not use SwipeToAction when it is disabled

* Improve scrolling experience

* Increase color shift animation speed

* Improve ranges

* new preset: only votes

* fix deltas & rename resources

* SwipeToAction implemented correctly, SwipeToDismiss replaced with SwipeToDismissBox, fixed swipe ranges

* Kotlin format

* use ordinal of enum in AppDB instead of int

* Fixed behaviour when downvotes disables/when not logged in

* Fix formatting

* Remove default param for enableDownVotes in SwipeToAction

* Fix colors for swipe actions

* Fixed lambda caching in rememberSwipeActionState

* Format kotlin

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
@dessalines dessalines marked this pull request as ready for review February 7, 2024 16:57
@dessalines dessalines changed the title Starting to work on registration applications. Adding registration applications queue. Feb 7, 2024
- Adds a last_version_code_viewed, that gets updated in the DB,
  and compared against the current version to show the changelog.
  This means we never have to manually update that column again.
- Add a generate_changelog.sh script that uses git-cliff. It copies
  the changelog into code assets, which can be done before the release.
- Fixes #1272
Copy link
Collaborator

@MV-GH MV-GH left a comment

Choose a reason for hiding this comment

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

The only way around that would be to persist admin and mod status in the DB, which seems a bit fragile since those can be updated non-locally.

Yes but we do that already for defaultSortType and defaultListingType. We can add admin and mod status to account too. And they are much less likely to change than those two.

app/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
@dessalines dessalines marked this pull request as draft February 9, 2024 18:11
@dessalines dessalines marked this pull request as ready for review February 9, 2024 22:10
@@ -180,11 +197,13 @@ fun BottomNavActivity(
Scaffold(
snackbarHost = { JerboaSnackbarHost(snackbarHostState) },
bottomBar = {
if (appSettings.showBottomNav) {
if (appSettings.showBottomNav && account.isReady()) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately, this means an anon account will not show the bottom bar.

I couldn't find a way around this, because even tho I'm persisting is_admin to the DB, I still need to wait for it to read the database, otherwise the registration button will pop up in the list.

IE, even if I do if (appSettings.showBottomNav && (account.isAnon() || account.isReady()), it means that the bottom bar will show 5 tabs, then suddenly the 6th tab will pop up only after the DB isAdmin status is loaded.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I putting this on hold rn, until I have some time to look into this. Because this should definitely be possible in a way.

Because this has bigger consequences. It would make those navigation actions things completely inaccessible. Rn its either bottomnav or in the side panel. I'll probably have tomorrow time for this

Copy link
Member Author

Choose a reason for hiding this comment

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

No probs. As a simple fix I could also remove that account.isReady() check. Its mainly just a visual annoyance that these extra bottom bar icons suddenly pop up, but that could be tackled at a later time.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Anon accounts are never ready thus isReady check fails for them. (Made it that way because this allowed anon Accounts go to through the checks and display "Not logged in" toasts )

@dessalines dessalines mentioned this pull request Feb 9, 2024
@dessalines dessalines requested a review from MV-GH February 9, 2024 22:40
Copy link
Collaborator

@MV-GH MV-GH left a comment

Choose a reason for hiding this comment

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

What do you think of the change?

@dessalines
Copy link
Member Author

Just tested, and that still hides the bottom bar for anon accounts.

@MV-GH
Copy link
Collaborator

MV-GH commented Feb 12, 2024

Yes you were right, I fixed that.

I also found and fixed a different bug, one that has been present for a while, that invalidates the jwt when u swap to anon account. Weird that we never got a bug for this

@dessalines
Copy link
Member Author

Thx!

I also found a different bug, one that has been present for a while, that invalidates the jwt when u swap to anon account.

I've been getting that too, but for some reason only on voyager.lemmy.ml . I tested switching back and forth from Anon to my lemmy.ml account, and it doesn't seem to be an issue... not sure what's going on with voyager.lemmy.ml

@dessalines dessalines enabled auto-merge (squash) February 12, 2024 22:13
@MV-GH
Copy link
Collaborator

MV-GH commented Feb 12, 2024

Weird, your lemmy account jwt token should also have been invalidated.

(Let me be clear this was a issue in Jerboa, that I fixed in the previous commit)

@dessalines dessalines merged commit 818f008 into main Feb 12, 2024
2 checks passed
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.

None yet

3 participants