Commit graph

35 commits

Author SHA1 Message Date
Jakob Meier
7174a03cf2
cache itemss for items list and edit item screen
BUG: when deleting an item the item list won't update
2024-02-23 20:44:42 +01:00
Jakob Meier
9ff6d97c90
cache products for item and product list and product view screen
BUG: when deleting a product the product list won't update
2024-02-23 20:06:49 +01:00
Jakob Meier
6cdfcdf85c
add cache to categories list & add autoupdate after editing / creating a
category
2024-02-23 16:13:15 +01:00
Jakob Meier
b320d51fa1
Formatted files using dart format 2023-12-22 20:14:36 +01:00
Jakob Meier
eba0790f7c
More bug fixes (see description)
- Fixed bug where opening room would show null-error,
  for a couple of seconds.
  This was caused by the FAB not checking if widget.info!=null

- Added try&catch for item category,
  to prevent index-out-of-bounds when the item uses a category
  that no longer exists

- Renamed add/remove Articles to fit the new name: ShoppingListItem
2023-04-05 09:23:41 +02:00
Jakob Meier
5b398eb2ae
Bug fixes (see description)
- Fixed bug where switching room pages
  (list,products,categories,about),
  would result an unknown error,
  due to setState being called on a widget that isn't mounted.
  This was solved by surrounding the setState function,
  with a condition to check if the widget is mounted

- Fixed bug where room members weren't recognized as admins
  This was caused by a typedifference between the server and the app
  (The server now returns booleans,
  where as before a ==1 comparison was
  needed)
- Fixed bug where successfully closing the admin/kick member dialog,
  would crash the application.
  This was caused by popping the same context twice.
  We are now using two navigator (the outer and the inner one)
2023-04-05 08:54:48 +02:00
Jakob Meier
5cd21c8adf
Added Combined new/edit and view product screen
Similarily to categories and rooms,
the edit product screen is reused as a new-room screen,
which is especially easy, because the user is unable to select
the product id themselves.
NOTE: the dynamic value-unit input is still missing some "subunits"

The view product screen has links to the edit product page,
the view parent page (if available) and a not yet functional
view children screen.
NOTE: The parent product display should be restricted in width,
and the screen is missing value/unit information.
2023-04-04 20:28:26 +02:00
Jakob Meier
47387bb395
Added basic Shopping List and Product list
including the ability to
add item into the shopping cart and remove them.

The click events have been implemented,
however the routes do not exist yet.

NOTE: The shopping list item info sheet is still missing
the unit type and value
and some more advanced options, like deleting the item
2023-04-04 10:29:29 +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
916ea41159
Updated room permission names
- Articles are now called items,
  in fact Articles only existed in alpha1 and 2
  And considered to be the room content
2023-04-02 13:18:59 +02:00
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
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
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
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
09f7e4fdd1
Added asset wrapper.
FIXES: Image paths on web
2023-03-24 17:47:47 +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
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
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
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
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
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
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