Commit graph

51 commits

Author SHA1 Message Date
Jakob Meier
661cfe2f2c
Added more specific error messages
This commit was created in reaction to the new error messages:
606709ae58/src/api/acts/roomContent.ts
(outbag/server@3686c354c8)
2023-03-31 21:59:27 +02:00
Jakob Meier
a40e3af3e5
Fixed bug where public rooms weren't filtered correctly
This was caused by doNetworkRequest
introduced in Commit 5d333522a5 (Simplified network requests & snackbars, 2023-03-23),
as it ran asynchronously and thus the blacklist wasn't filled in time.
2023-03-31 21:54:45 +02:00
Jakob Meier
99f0ed3558
Basic Categories Page layout
Planned Flow (unimplemented):
- create new category on /edit-category page using bottom-right fab
- sort categories using the two-line hamburger-style menu on each item
- click on a category to modify/delete it
  NOTE: maybe on a different screen or MBS?
2023-03-31 21:52:14 +02:00
Jakob Meier
cb232cf271
Updated room permissions 2023-03-29 18:47:45 +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
90adcc6bb1
Fixed context bugs caused by moving to GoRouter
NOTE: Some bugs have not been fixed, and the member screen needs fixing,
but before that can happen, localstore has to be replaced,
because it causes loops on android and linux.
It also seems like it might lead to memory leaks
2023-03-28 17:21:35 +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
42b6da7461
Fixed password editor 2023-03-25 15:36:21 +01:00
Jakob Meier
67a5130ac0
Moved theme selector into dialog
FIXES: Bug where text would wrap
after a couple of characters on mobile,
because flutter keeps the SegmentedButton at full width
2023-03-25 15:24:12 +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
569dda01fd
Moved hash function into seperate file.
NOTE: useful for changePassword,
which requires the hash password functionality as well.
2023-03-25 14:27:47 +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
ecd87cf2cd
Made content scrollable
Added SingleChildScrollView to new-room, edit-room
and the about-room tab.
NOTE: Added a padding to the new and edit room pages,
to prevent widgets from touching the screen bottom
2023-03-24 18:21:23 +01:00
Jakob Meier
09f7e4fdd1
Added asset wrapper.
FIXES: Image paths on web
2023-03-24 17:47:47 +01:00
Jakob Meier
672892e21b
Removed Flexible widget.
FIXES: Bug where signup, signin,
edit room and new room screen would fail to open,
because the Flexible Widget cannot be nested in a
Centered Widget.

NOTE: Turns out the widget was not neccessary at all
2023-03-24 16:42:12 +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
eabb6b93ae
Moved room pages into seperate folder 2023-03-23 14:04:48 +01:00
Jakob Meier
8e02de97c1
Added missing routes
and added a padding around the visibility selector
2023-03-23 11:05:18 +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
5c8c108818
Added server-wide permissions
according to https://codeberg.org/outbag/server/src/branch/dev/src/server/permissions.ts
2023-03-23 10:19:36 +01:00
Jakob Meier
4ed46929f8
Moved main room screen into room folder 2023-03-23 10:19:14 +01:00
Jakob Meier
c466a19fc9
Added ability to delete or leave room.
NOTE: Only the room owner can delete a room,
but they are not able to leave the room.

BUG: Deleting or leaving the room deletes the room from disk,
but for an unknown reason, the homescreen does not update
and still shows the room.
Opening and closing the room seems to cause the homescreen to
update, removing the room.
2023-03-23 08:58:34 +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
f3ac4a502c
Added stub screens
Used as a placeholder,
whilst other screens are currently worked on.

NOTE: there is no finished specification for
Products and Shopping List Items
2023-03-22 21:16:00 +01:00
Jakob Meier
ea2791fac7
Removed unnecessary server attribut in request
Triggered by 9efffabe80
2023-03-22 21:15:05 +01:00
Jakob Meier
7b23b12125
Implemented room member and room info
In preperation for upcoming room screens.

RoomInfo is supposed to be used in conjunction with
the Room class.
They are not merged (Room as a attribut in RoomInfo),
because whilst Room can be stored on disk,
RoomInfo can not.
This is done to prevent tampering with the data
(when offline).

This also makes hiding elements easier when the user is offline,
as we can just pretend, that they do not have the required permission.
2023-03-22 21:12:04 +01:00
Jakob Meier
48c15b244a
Implemented room permission types
Done in preperations for rooms,
and the ability to edit rooms.

Will later be used to hide/show certain elements,
when the user does not meet the criteria
(permissions / admin / owner)
2023-03-22 21:07:29 +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
6347476b2f
Finished join-public-room screen
NOTE: If the user is already in a public room,
the room will not be shown in the list.

NOTE: The search funtionality
has not been implemented yet.

NOTE: The join invite-only room screen
will be part of a later commit.
But the endpoint has already been set to
/add-room/by-id
2023-03-21 20:24:48 +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
f2cbfaf924
Fixed bug where room list was not processed properly
This was caused by a wrong type.

To fix this I updated the type and implemented Room.fromJSON
which should make fetching rooms easier in the future
2023-03-20 20:45:49 +01:00
Jakob Meier
cfd54e3bb5
Added room creation screen
If the room was created successfully,
the wizard automatically saves the room data on disk.
This allows it to be cached,
even if the user loses internet connection
right before the wizard exists.
That way the room will be cached.
2023-03-18 20:28:30 +01:00
Jakob Meier
4bbdcaad4d
Basic home screen
NOTE: Might be a good idea to move the title down,
if no description is available.
If ListTile does not support such feature,
maybe using an alternative might be good idea
2023-03-18 20:27:20 +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
f2d77e066d
Initialized empty screens 2023-03-17 21:08:29 +01:00
Jakob Meier
4c06208e82
Basic auth screen 2023-03-17 21:07:05 +01:00
Jakob Meier
4c9f9b7627
Improved accessibility 2023-03-17 21:06:54 +01:00
Jakob Meier
6aab88bbfd
Basic request backend 2023-03-17 21:06:41 +01:00
Jakob Meier
fd1c104e6a
Ported error_as_text from https://codeberg.org/outbag/app/src/branch/develop/deps/outbag-core/src/tools.js 2023-03-17 21:06:23 +01:00
Jakob Meier
fd2e21c328
Ported resolve_url from https://codeberg.org/outbag/app/src/branch/develop/deps/outbag-core/src/resolve_url.js 2023-03-17 21:06:01 +01:00
Jakob Meier
955a01d368
Basic Userdata storage 2023-03-17 21:05:48 +01:00
Jakob Meier
39d7a14b4a
Added basic welcome screen 2023-03-17 09:41:28 +01:00