Commit graph

24 commits

Author SHA1 Message Date
Jakob Meier
8706122590
Merged EditRoom and NewRoom page
and moved ChangeRoomIcon-Dialog into seperate file.

This was done in an attempt to remove redundancy
2023-04-02 13:19:24 +02:00
Jakob Meier
1ba36ff9f0
Added option to delete, edit and reorder categories.
NOTE: The click action is removed, if the user doesn't
have the required permission and the drag-handle is not shown.

BUG: Editing the list (in any way, other than reordering it),
wont reload the list - hopefully this will be addressed later,
by caching the categories (or removing them from the cache)
and auto-rebuilding on cache-change
2023-04-02 13:19:23 +02:00
Jakob Meier
e02d45d77e
Reordered imports 2023-04-01 09:49:30 +02:00
Jakob Meier
3c5211bb5b
Moved about subscreens into about folder
This was done in an attempt to keep the folder structure
sorted and clean
2023-04-01 09:36:59 +02:00
Jakob Meier
ecccec7950
Fixed bug where homescreen would load twice
Moved AccountMeta provider into <User> context
and migrated to using a FutureProvider to perform the network request

NOTE: Bug was caused by AccountMeta? being loaded late,
causing the root provider to be reloaded.
2023-03-29 18:27:05 +02:00
Jakob Meier
1af8d6f068
Migrated from localstore to shared preferences
(only for user, server and theme)

This was done, because localstore is somewhat inconsistent
in terms of events on different platforms.
Also storing user, server and theme using shared-preferences
should fit into flutters ecosystem a little better
2023-03-29 18:27:05 +02:00
Jakob Meier
8fffafde47
Added translations using l10n
Translations are provided in *.arb* format.
Some keys have descriptions
(indicated by leading @-symbol).
Descriptions should not be copied into the translation itself.

Currently only English is supported (app_en.arb),
but German is planned.

Apparently weblate merged .arb support at some time,
so it would be nice to enable community translations at some point.
2023-03-29 15:14:27 +02:00
Jakob Meier
b0c1f782bd
Removed room provider
because I was unable to combine all routes
under one provider.
2023-03-28 16:14:38 +02:00
Jakob Meier
5b9b48cd24
Migrated to GoRouter
Reasons for migration:
- buggy behaviour from old router
- GoRouter is a recommended flutter plugin
- ShellRoutes allow exposing Providers
  to a limited scope of routes
- GoRoutes provides named routes,
  and the navigator allows us to provide parameters directly.
2023-03-28 14:54:39 +02:00
Jakob Meier
bb9a8621a0
Moved User into application wide conntext.
Every page (after login) has access
to the User object via context.read/watch<User>().

This reduces localstore and asnyc operations,
as the screens do not have to load the user every time.
Additionally this prevents anyone from
using the without a user object.
2023-03-25 17:18:46 +01:00
Jakob Meier
30a19fcc1e
Started working on settings screen
Added:
- changePassword to change the password
NOTE: this requires the old password,
just to prevent account hijacking.
- some basic user limit information
- theme selector
NOTE: the system theme is meant to function like auto-theme,
and is directly translated into a flutter ThemeMode,
however, this does not appear to be working on the web.

This commit also adds the logout and delete account buttons,
but they do not yet delete all rooms,
nor do they properly logout the user.
BUG: User is not logged out correctly,
reloading the page fixes this.
Maybe localstore.listen does not detect deletion?
2023-03-25 14:29:28 +01:00
Jakob Meier
e3ca4fafa6
Added room default permission editor screen
The screen allows the user to change the default permission set,
that applies to every member (but not the owner nor the admins).

This screen is only accessible by the owner,
admins or members with the changeAdmin permission.
2023-03-25 10:31:28 +01:00
Jakob Meier
6b98c696ea
Finishied room member screen
The screen allows every room member,
to view a list of other room members,
and their role (Owner, Admin or Member).

If the user is allowed
(Owner, Admin, changeAdmin/manageMembers),
to either kick or promote members to the admin role,
the list tile will have a tap event.
NOTE: This is why some members do not have a hover animation.
For example the owner cannot be kicked.
2023-03-25 10:31:14 +01:00
Jakob Meier
fa734eca15
Moved network requests into seperate method,
called from initState using
WidgetsBinding.instance.addPostFrameCallback

FIXES: bug where edit room would reset
the input field content
2023-03-24 16:33:37 +01:00
Jakob Meier
4775d6923e
Added edit room screen
Data-fetch routine:
fetch room information from server
-> if unsuccessfull load room from disk

The room will automatically be closed,
if either of the following conditions apply:
- the user is offline and no data was found on disk
- the network request returned a server error
2023-03-24 13:25:42 +01:00
Jakob Meier
5d333522a5
Simplified network requests & snackbars
and rewrote the component's network requests.

showSimpleSnackbar, allows displaying a simple snackbar,
with text and one action button, that can be clicked.

doNetworkRequest is supposed to be a wrapper for the
already existing post* functions.
It aims to make network requests and error handling easier,
by containing all the try&catch blocks
and being able to show snackbars.
2023-03-24 13:25:34 +01:00
Jakob Meier
aee9c9f82e
Added server dashboard button to menu
The button is only shown if the user has
any of the management permissions.
2023-03-23 10:53:10 +01:00
Jakob Meier
4ed46929f8
Moved main room screen into room folder 2023-03-23 10:19:14 +01:00
Jakob Meier
c54e4f519f
Added about room screen.
NOTE: Some of the route redirect options are still missing.
There should also be a delete Room option
2023-03-22 21:17:03 +01:00
Jakob Meier
69d1892fc8
Renamed /new-room endpoint to /add-room/new
This has been done in an effort
to move all endpoints used to join a room
under one umbrella (/add-room)

A list of planned or completed endpoints:
- /add-room
- /add-room/new
- /add-room/by-id
2023-03-21 20:26:24 +01:00
Jakob Meier
596c8cc4eb
Started working on Join Room Screen
Work already done:
- moving the New Room screen to a different endpoint
- fetching public rooms using the post API
- displaying public rooms

Suggestion for user interaction:
1. click on room
2. open bottomSheet with information and join button
3. click "join" to join room
2023-03-20 21:19:25 +01:00
Jakob Meier
31a84b5ec7
Rewrote autologin to default to authorized
This is prevents the current route from being reset,
when reloading the tab
and also prevents the welcome screen from showing
(when running on slow connections)

NOTE: This also means that the home screen will be loaded
even if the client has never been logged in.
This means that some functions might return null
2023-03-18 20:24:48 +01:00
Jakob Meier
63155fc6bb
Added basic user authentification & auto-login 2023-03-17 21:08:45 +01:00
Jakob Meier
2cbb8fb701
Initial commit 2023-03-17 09:41:08 +01:00