Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
867
Issues
867
List
Boards
Labels
Service Desk
Milestones
Merge Requests
46
Merge Requests
46
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Compare Revisions
02d78072cacc3fb5748b2e00df79fc3ba4baddb2...d0fe65cd1a30189e3af959a78b96e83796e9569b
Source
d0fe65cd1a30189e3af959a78b96e83796e9569b
Select Git revision
...
Target
02d78072cacc3fb5748b2e00df79fc3ba4baddb2
Select Git revision
Compare
Commits (2)
(fix): subscribers/subscriptions/requests view
· adbef94b
Marcelo Rivera
authored
2 hours ago
adbef94b
(feat): enforce APPROVE_SUBSCRIBER permission flag
· d0fe65cd
Marcelo Rivera
authored
2 hours ago
d0fe65cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
43 deletions
+48
-43
src/app/modules/channels/channel.component.html
src/app/modules/channels/channel.component.html
+13
-40
src/app/modules/channels/requests/request.component.html
src/app/modules/channels/requests/request.component.html
+7
-2
src/app/modules/channels/requests/request.component.ts
src/app/modules/channels/requests/request.component.ts
+28
-1
No files found.
src/app/modules/channels/channel.component.html
View file @
d0fe65cd
...
...
@@ -126,7 +126,14 @@
</section>
<!-- Subscriptions list -->
<section
class=
"mdl-cell mdl-cell--8-col"
*ngIf=
"filter == 'subscriptions'"
>
<section
class=
"mdl-cell mdl-cell--8-col"
*ngIf=
"
filter == 'subscriptions' ||
filter == 'subscribers' ||
filter == 'requests'
"
>
<div
class=
"mdl-card m-channel--subscribers-tabs"
>
<div
class=
"mdl-tabs__tab-bar"
>
<a
...
...
@@ -160,52 +167,18 @@
<m-channel--subscriptions
[channel]=
"user"
class=
"mdl-grid"
*ngIf=
"filter === 'subscriptions'"
></m-channel--subscriptions>
</section>
<!-- Subscriptions list -->
<section
class=
"mdl-cell mdl-cell--8-col"
*ngIf=
"filter == 'subscribers' || filter == 'requests'"
>
<div
class=
"mdl-card m-channel--subscribers-tabs"
>
<div
class=
"mdl-tabs__tab-bar"
>
<a
[routerLink]=
"['/', user.username, 'subscribers']"
class=
"mdl-tabs__tab"
[ngClass]=
"{ 'is-active': filter === 'subscribers' }"
i18n=
"@@MINDS__CHANNELS__SUBSCRIBERS_WITH_COUNT"
>
Subscribers ({{ user.subscribers_count }})
</a>
<a
[routerLink]=
"['/', user.username, 'subscriptions']"
class=
"mdl-tabs__tab"
[ngClass]=
"{ 'is-active': filter === 'subscriptions' }"
i18n=
"@@MINDS__CHANNELS__SUBSCRIPTIONS_WITH_COUNT"
>
Subscriptions ({{ user.subscriptions_count }})
</a>
<a
[routerLink]=
"['/', user.username, 'requests']"
*ngIf=
"user.mode === 2 && user.guid == session.getLoggedInUser().guid"
class=
"mdl-tabs__tab"
[ngClass]=
"{ 'is-active': filter === 'requests' }"
>
Requests
</a>
</div>
</div>
<m-channel--subscribers
[channel]=
"user"
class=
"mdl-grid"
*ngIf=
"filter === 'subscribers'"
></m-channel--subscribers>
</section>
<section
class=
"mdl-cell mdl-cell--8-col"
*ngIf=
"filter == 'requests'"
>
<m-subscriptionsRequests
__list
></m-subscriptionsRequests
__list
>
<m-subscriptionsRequests
__list
*ngIf=
"filter == 'requests'"
></m-subscriptionsRequests
__list
>
</section>
</div>
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/channels/requests/request.component.html
View file @
d0fe65cd
...
...
@@ -12,12 +12,17 @@
</div>
<div
class=
"m-layout__spacer"
></div>
<ng-container
*ngIf=
"!request.completed; else completed"
>
<button
class=
"m-btn m-btn--action m-btn--slim"
(click)=
"accept($event)"
>
<button
class=
"m-btn m-btn--action m-btn--slim"
(click)=
"accept()"
[disabled]=
"!canApprove"
>
Accept
</button>
<button
class=
"m-btn m-btn--destructive m-btn--slim"
(click)=
"decline($event)"
(click)=
"decline()"
[disabled]=
"!canDecline"
>
Decline
</button>
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/channels/requests/request.component.ts
View file @
d0fe65cd
import
{
Component
,
Input
}
from
'
@angular/core
'
;
import
{
Client
}
from
'
../../../services/api
'
;
import
{
FeaturesService
}
from
'
../../../services/features.service
'
;
import
{
PermissionsService
}
from
'
../../../common/services/permissions/permissions.service
'
;
import
{
Session
}
from
'
../../../services/session
'
;
import
{
Flags
}
from
'
../../../common/services/permissions/flags
'
;
@
Component
({
selector
:
'
m-subscriptionsRequests__request
'
,
...
...
@@ -9,7 +13,30 @@ export class SubscriptionsRequestsRequestComponent {
minds
=
window
.
Minds
;
@
Input
()
request
;
constructor
(
private
client
:
Client
)
{}
get
canApprove
()
{
if
(
this
.
featuresService
.
has
(
'
permissions
'
))
{
return
this
.
permissionsService
.
canInteract
(
this
.
session
.
getLoggedInUser
(),
Flags
.
APPROVE_SUBSCRIBER
);
}
}
get
canDecline
()
{
if
(
this
.
featuresService
.
has
(
'
permissions
'
))
{
return
this
.
permissionsService
.
canInteract
(
this
.
session
.
getLoggedInUser
(),
Flags
.
APPROVE_SUBSCRIBER
);
}
}
constructor
(
private
client
:
Client
,
private
session
:
Session
,
private
featuresService
:
FeaturesService
,
private
permissionsService
:
PermissionsService
)
{}
async
accept
()
{
this
.
request
.
declined
=
false
;
...
...
This diff is collapsed.
Click to expand it.