Conversation
|
Code is kinda doo-doo, but works |
| var canCreateEvent = AuthorizationService.CanCreateEvent(_page); | ||
| var canCreatePost = AuthorizationService.CanCreatePost(_page); | ||
| // TODO what role should be required to accept collaboration requests ASK ALBI | ||
| var canAcceptCollaborationRequests = canCreatePost && canCreateEvent; |
There was a problem hiding this comment.
What role should be used to allow collaborations?
There was a problem hiding this comment.
add a AuthorizationService.CanAcceptCollaborationRequests identical to AuthorizationService.CanCreatePost/AuthorizationService.CanCreateEvent
| var canCreateEvent = AuthorizationService.CanCreateEvent(_page); | ||
| var canCreatePost = AuthorizationService.CanCreatePost(_page); | ||
| // TODO what role should be required to accept collaboration requests ASK ALBI | ||
| var canAcceptCollaborationRequests = canCreatePost && canCreateEvent; |
There was a problem hiding this comment.
add a AuthorizationService.CanAcceptCollaborationRequests identical to AuthorizationService.CanCreatePost/AuthorizationService.CanCreateEvent
| Elfogadás | ||
| </button> | ||
| <button type="button" @onclick="() => Deny(request)" | ||
| class="small text round error standard">Elutasítás |
There was a problem hiding this comment.
|
|
||
| protected override async Task OnInitializedAsync() | ||
| { | ||
| await InterestService.LoadIndex; |
There was a problem hiding this comment.
this does not work as InterestService.LoadIndex attaches the entities to the scoped DbContext. You already load Categories below, so you can just remove this line
| if (_page == null) | ||
| return; | ||
|
|
||
| _items.AddRange(await db.EventCollaborationRequests |
There was a problem hiding this comment.
these 2 queries can be replaced by a single db.CollaborationRequests query
| { | ||
| await using var db = await DbFactory.CreateDbContextAsync(); | ||
|
|
||
| if (request is EventCollaborationRequest evInfo) |
There was a problem hiding this comment.
no need to type-check, just do the query on db.CollaborationRequests
i'd also add a check here for whether the user has permission to do this
| @@ -0,0 +1,178 @@ | |||
| @attribute [Authorize] | |||
| @page "/collaborations/{PageId:int}" | |||
There was a problem hiding this comment.
@page "/collaboration-requests/{CollaborationRequestId:int}"
instead of having a per-Page list for collaboration requests, show all of them under AdminDashboardPage with a link to this page, where the user can accept or deny the request
| <div | ||
| style="display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #ccc; border-radius: 12px;"> | ||
| <span>@(category.Name ?? category.Page.Name ?? category.Page.PekName)</span> | ||
| <button type="button" @onclick="() => RemoveCollaborationCategory(category)">× |
There was a problem hiding this comment.
you can use Material input chips instead: https://material-web.dev/components/chip/
| <div style="display: flex; gap: 16px; margin-top: 16px;"> | ||
| <div style="flex: 1;"> | ||
| <div class="small filled round"> | ||
| Kiválasztott kollaboráló körök |
There was a problem hiding this comment.
- instead of 2 columns show both together and mark pages that require a collaboration request with a
pendingicon - for adding new pages, add a button that opens a dialog with a list of all pages. add a note below pages that require a collaboration request
- show the Page selected using the
categoriesquery parameter as selected here
| int eventId, | ||
| int? parentId, | ||
| HashSet<int> categoryIds, | ||
| HashSet<int> possibleCollaborationRequestPageIds, |
There was a problem hiding this comment.
merge categoryIds and possibleCollaborationRequestPageIds and compute possibleCollaborationRequestPageIds dynamically
| int postId, | ||
| int? eventId, | ||
| HashSet<int> categoryIds, | ||
| HashSet<int> possibleCollaborationRequestPageIds, |
… possibleCollaborationRequestPageIds dynamically in EventService and PostServic
Uh oh!
There was an error while loading. Please reload this page.