Commit Graph

119 Commits

Author SHA1 Message Date
Pascal Precht 1c910deca9 fix(Communities): make kicking members work again
There's a regression in the application where kicking members from communities
doesn't work anymore. This was due to UI logic being moved to a different model
without updating the corresponding view action.

Fixes #2274
2021-04-20 13:16:28 -04:00
Pascal Precht e63db9a21c uiux(Communities): use proper icon for "leave community" menu item 2021-04-20 12:30:10 -04:00
Pascal Precht 5016091df7 fix(Communities): allow everyone to activate community profile popup
Prior to this commit, only admins of a community could open up the community
profile popup from inside the community. However, normal members should be able
to do so too.
2021-04-20 12:29:56 -04:00
Eric Mastro 9e6bd7a2da fix: create community and channel name validation
Fixes #2050.

This PR contains changes to fix the name validation for new communities and new channels in communities. In the process of updating this, better validation was also added to both popups (create community and create channel), including the prevention of the "Create" button from being enabled until all form fields were valid.

During this process, it was noticed that the community image cropper was not actually cropping the image *in the preview*. Once the community was created, status-go was successfully cropping the image as the user intended. However, the preview thumbnail prior to creation was not accurately showing the cropped image preview and showing the entire image centred instead. *This is still yet to be fixed.* One solution is to upgrade Qt to `5.15` to take advantage of Image QML's `sourceClipRect`.
2021-04-19 20:19:43 +10:00
Jonathan Rainville 048642b7df fix: order joined communities from newest to oldest
Fixes #2154
2021-04-13 18:02:02 -04:00
Pascal Precht 5ca9d66212 fix(Communities): ensure newly created community is opened 2021-04-13 15:21:00 -04:00
Pascal Precht 6e63f65dae fix(Communities): use fallback color for community icon if model doesn't have one 2021-04-13 15:07:14 -04:00
Pascal Precht b76468e675 uiux(Communities): fine-tune header button component to align with designs 2021-04-13 15:07:07 -04:00
Jonathan Rainville b45cbe83b7 fix: fix channel list spacing during a search
Fixes #2191
2021-04-13 14:47:35 -04:00
Jonathan Rainville c42bd1ea78 feat: add input to search and use ENS for community invite
fixes #2138
2021-03-31 16:25:24 -04:00
--replace-all b3791cb39f fix: typo in community popup
fixes #2156
2021-03-31 15:34:44 -04:00
Jonathan Rainville a337b293da feat: show community context menu on Community button 2021-03-30 15:53:32 -04:00
Jonathan Rainville e33266aa2f fix: fix emoji popup and create community popop text color 2021-03-30 15:38:15 -04:00
Jonathan Rainville aeded149db fix: show community button tooltip on the right
Fixes #2069
2021-03-25 16:57:47 -04:00
Jonathan Rainville 686cbc7f54 fix: fix communities not showing the letter identicon correctly 2021-03-24 14:20:47 -04:00
Jonathan Rainville 98ef76d3c8 chore: hide edit community button until the feature is implemented 2021-03-18 14:52:28 -04:00
Pascal Precht 010a7e0d8e feat(Communities): open member profile on memberlist click 2021-03-18 14:47:36 -04:00
Pascal Precht 6b6a318a8c
refactor(Communities): make member list look as intended
This change aligns the member list's look & feel of the community profile popup
with the designs by implementing the proper member list items styles, hover effects
and fine-tuning the context menu.

This commit also comments some of the actions provided by the context menu,
which aren't implemented yet. There's no point in having UI components that don't or
can't function.

Those will be re-introduced once they are actually implemented.

Closes #1959
2021-03-18 10:03:24 +01:00
Jonathan Rainville 23a8de0449 fix: fix community not being passed correctly to the invite bubble 2021-03-17 16:09:23 -04:00
Jonathan Rainville f3b452188a chore: extract join.status link prefixes to Constants 2021-03-17 16:09:23 -04:00
Jonathan Rainville 5581fca41d feat: show default unfurling for community links 2021-03-17 16:09:23 -04:00
Pascal Precht 362ad02ffc
refactor(Communities): make membershipt request button looks as designed
The designs for the membership request button look different now, so this
commit makes use of the `StatusSettingsLineButton` to implement that new
look & feel.
2021-03-17 10:30:19 +01:00
Pascal Precht 38bd5f1422
fix(Communities): remove type error in item width
There's no `parent` in that componen, which results in a QML type error
at runtime.
2021-03-17 10:30:18 +01:00
Pascal Precht 638892f21d
refactor(Communities): use StackView inside profile popup for memberlist
Prior to this commit, the community memberlist was represented in a nested modal
which doesn't adhere to the designs. Rather, the section should render inside the
existing modal, requiring it to be refactored using a `StackView`.

This commit refactors the community profile popup so that the different content
sections ("Overview" and "MemberList") are rendered inside of the popup and can
be pushed onto and popped off a stack view.

The content components (newly introduced in this commit) `CommunityProfilePopupMembersList`
and `CommunityProfilePopupOverview` need to define a `headerTitle`, `headerDescription` and
if needed `imageSource` so they can alter the modal's header.

The same pattern might be used in other places of the modal if required.

Partially fixes #1959
2021-03-17 10:29:31 +01:00
Pascal Precht 8ad9e52abf fix(Communities): render community image in profile popup 2021-03-16 14:57:45 -04:00
Pascal Precht e725e7982d fix(Communities): properly pass `admin` state to profile popup
This was hardcoded into `isAdmin` for some reason. It also seems that the
property isn't actually used anywhere in the profile popup, so we might
as well get rid off it.
2021-03-16 12:43:01 -04:00
Pascal Precht eefd56dd28 fix(Communities): ensure app remembers hidden community intro banners
Fixes #1960
2021-03-15 14:35:31 -04:00
Pascal Precht 2e710715bc fix(Communities): ensure profile popup is hydrated with correct data
The `communityProfilePopup` relies on the currently `activeCommunity` to
get its data. Unfortunately, once read, even when `chatsModel.setActiveCommunity()`
is called which triggers `activeCommunityChanged`, the data in the popup
won't be updated. The next time one would open a community profile page,
it'd have the data that was previously received from the model.

This commit ensures that the popup is hydrated with the most recent data
by explicitly updating its properties right before it's opened.
2021-03-11 10:41:19 -05:00
Pascal Precht 51c8d86ccc fix(Communities): don't crash on rejoin attempt
Prior to this commit there was a scenario where the application would
crash due a memory bug when attempting to (re)join a community.

The scenario is as follows:

1. User creates or has been invited to community with `ON_REQUEST` permissions
2. User leaves community
3. User decides to rejoin, so she selects the community she's been part
of and hits the "Join" button

At this point Status Desktop would send a new `RequestToJoin` request, as the
community has a corresponding permissions setting.

This would then result in an `already a member` error in status-go, because
status-go checks whether the requestee is already part of the members list of
the community. The error isn't handled inside Status Desktop which causes
a crash because we're trying to access data in memory that doesn't exist.

Why is this happening?

While this might be unexpected, when leaving a community (as done on step 2 of
the mentioned scenario), users don't actually lose membership but simply
"unsubscribe" from all channels in the community in question and their `joined`
flag is set to `false`.

From that point on, re-joininng a community is done by sending a `JoinCommunity`
request (instead of `RequestToJoin`), which will then set the `joined` flag to
`true` and doesn't actually check the membership in the database.

This commit ensures we're calling the right API by checking whether not only
whether the community is needs `ON _REQUEST` permissions, but also whether the
user isn't already a member of it.

Fixes #2017
2021-03-11 10:41:19 -05:00
Pascal Precht 49b5e6c097 fix(Communities): make validation on community import work again
In https://github.com/status-im/status-desktop/commit/a90a30af1 we've introduced the functionality to import
communities through the UI via a community private key.
That private key is being validated before it gets imported.
For some reason, validation has been removed in another refactor
later on in https://github.com/status-im/status-desktop/commit/534cb23e1, rendering the import
functionality broken.

This commit re-introduces the `validate()` method to make importing
communities work again.
2021-03-11 10:00:05 -05:00
Pascal Precht 01d3369c64 fix(Communities): fallback to letter identicon if no image available
Prior to this commit, communities without an image would render invisible
in the navigation bar of the application. To avoid this, we're now falling
back to our StatusLetterIdenticon component, which renders the first letter
of the community name with the color of the community.
2021-03-11 10:00:05 -05:00
Jonathan Rainville d361853d0d fix: disable ENS only setting if user has no ENS name
Fixes #1984
2021-03-05 14:01:42 -05:00
Jonathan Rainville 44c9f480c2 feat: set profile and community image cropper to 1:1 ratio 2021-03-05 14:01:30 -05:00
Pascal Precht 86ea7014f6 fix(Communities): make rejoining communities work
When the communities code was moved into its own view in https://github.com/status-im/status-desktop/commit/b38d1df59
it broke the functionality to join communities again.

Qt complains that the Nim API in use `chatsModel.communities.joinCommunity`
expects two parameters, when it's call with just one.
This is unexpected because the API in question set a default value
for its second parameter.

To make this work again, we have to make sure the `setActive`
parameter is supplied every time we call the API from
within QML.

Also, worth noting that this is not the first time we're running into
a scenario like this.
2021-03-05 13:59:44 -05:00
Jonathan Rainville 131685ecf5 fix: fix member popup layout and member not showing
Fixes #1949
2021-03-05 13:57:49 -05:00
Jonathan Rainville 4a1c497a08 fix: fix users being able to see admin popup
Fixes #1976
2021-03-04 17:21:17 -05:00
Jonathan Rainville a09dd25506 fix: fix description is required for communities 2021-03-03 16:45:23 -05:00
Jonathan Rainville e52f6daec9 feat: update to latest status go and add color to the community 2021-03-03 16:45:23 -05:00
Jonathan Rainville c86f67b9f1 fix: fix community header button in dark mode 2021-03-03 16:45:23 -05:00
Jonathan Rainville f8704d7b64 feat: show unviewed count on the community button 2021-03-03 16:45:23 -05:00
Jonathan Rainville da77487746 fix: fix invite to use new API and remove the double msg send 2021-03-03 16:45:23 -05:00
Jonathan Rainville 63e2c21b33 feat: show tooltip on top of community button with name 2021-03-03 16:45:23 -05:00
Jonathan Rainville 75a0818d41 fix: fix community image display in the header 2021-03-03 16:45:23 -05:00
Jonathan Rainville 64d38b6049 feat: implement redesign of communities on the left tab 2021-03-03 16:45:23 -05:00
Jonathan Rainville 534cb23e18 feat: add new import community popup 2021-03-03 16:45:23 -05:00
Jonathan Rainville a47847b40f fix: fix community profile looks and style 2021-03-03 16:45:23 -05:00
Jonathan Rainville 6213e020a0 feat: new design for export popup 2021-03-03 16:45:23 -05:00
Jonathan Rainville b38d1df591 refactor: move communities functions to communities view in chat 2021-03-03 16:45:23 -05:00
Jonathan Rainville 3cc62d65aa feat: show membership requests in the admin popup 2021-03-03 16:45:23 -05:00
Jonathan Rainville f9817d4f52 feat: add community requests, permissions, ENS and more 2021-03-03 16:45:23 -05:00
Jonathan Rainville 46412204c5 feat: implement new colors for dark mode 2021-02-18 15:24:12 -05:00
Jonathan Rainville 0e699cac65 chore: run translation scripts 2021-02-18 15:23:58 -05:00
Iuri Matias 7b5a1660f8 make compact mode the default 2021-02-10 15:48:57 -05:00
Pascal Precht 7102596b3f fix(Timeline): make reactions works
This commit makes reactions in the status timeline work.
There are two things prior to this commit that are broken:

1. The logic that opens the reaction context menu always expects
   and instance of `chatsView` because it tries to calculate a users
   nickname. Such an instance isn't always available in that context, so
   the nickname logic has been moved to `appMain` for now, removing that
   dependency and therefore making it work in both, the chat view as well
   as the status view.
2. While 1) makes the context menu work, it turns out that adding and
   removing reactions inside the status timeline is still not working.
   The reason for that is, that the reactions component maintains its own
   `messageList`, which isn't aware of the fact that reactions for messages
   coming from chats of `ChatType.Profile`, need to go into a dedicated
   message list for `ChatType.Timeline`.

In other words, reactions are sent and removed from message in messagelists
that don't actually exist.

This commit fixes both of these things by ensuring the message lists
maintained by reactions are timeline aware. Also ensuring updates are
done correctly.
2021-01-14 15:33:46 -05:00
Jonathan Rainville e459d4dbd4 fix: fix PopupModal to not show a footer at all if there is no children 2021-01-13 14:32:35 -05:00
Jonathan Rainville ab1a03c3b2 fix isedit missing from import form 2021-01-11 13:57:35 -05:00
Jonathan Rainville 4aeeee6d9c feat: hide community stuff by default and add a setting to show it 2021-01-11 13:57:35 -05:00
Jonathan Rainville 7b03da2967 feat: enable removing member and fix invites 2021-01-11 13:57:35 -05:00
Jonathan Rainville d48043ee22 chore: cleanup community code 2021-01-11 13:57:35 -05:00
Jonathan Rainville a90a30af11 add import for a community 2021-01-11 13:57:35 -05:00
Jonathan Rainville 82405cc425 add export function and button 2021-01-11 13:57:35 -05:00
Jonathan Rainville 93376f0047 fix: fix createCommunityPopup being in edit mode all the time 2021-01-11 13:57:35 -05:00
Jonathan Rainville 29a9ca4ef5 refactor: use getNickname function for nicknames fetches 2021-01-11 13:57:35 -05:00
Richard Ramos 78e7fa380c feat: display a community's member list 2021-01-11 13:57:35 -05:00
Richard Ramos 019f558308 ui: edit community 2021-01-11 13:57:35 -05:00
Richard Ramos 6be81c4575 ui: community popup 2021-01-11 13:57:35 -05:00
Richard Ramos 04845e3a8e fix: channel/communities list height depending on search string 2021-01-11 13:57:35 -05:00
Richard Ramos 2ed3261170 Minor UI changes for communities 2021-01-11 13:57:35 -05:00
Jonathan Rainville 2d3a870f60 wip community invitatations and more 2021-01-11 13:57:35 -05:00