Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (3)
(chore): Tweak Pro marketing error message container
· a1c5f1a3
Emiliano Balbuena
authored
Sep 13, 2019
a1c5f1a3
(chore): Hide "Become Pro" buttons
· d0dc3825
Emiliano Balbuena
authored
Sep 13, 2019
d0dc3825
(chore): Allow admins to toggle Pro for channels
· b543a03e
Emiliano Balbuena
authored
Sep 13, 2019
b543a03e
Hide whitespace changes
Inline
Side-by-side
src/app/modules/channels/sidebar/sidebar.html
View file @
b543a03e
...
...
@@ -264,7 +264,7 @@
</div>
<a
*ngIf=
"showBecomeProButton"
*ngIf=
"
false &&
showBecomeProButton"
class=
"m-btn m-link-btn m-btn--with-icon m-btn--slim m-btn--action"
routerLink=
"/pro"
>
...
...
@@ -285,7 +285,18 @@
*ngIf=
"session.getLoggedInUser().guid == user.guid"
[object]=
"user"
></minds-button-boost>
<m-channel--badges
[user]=
"user"
></m-channel--badges>
<a
*ngIf=
"session.getLoggedInUser()?.is_admin"
(click)=
"proAdminToggle()"
>
<m-tooltip
icon=
"business_center"
[iconClass]=
"user.pro ? 'selected' : ''"
i18n
>
Pro
</m-tooltip>
</a>
</div>
</div>
...
...
src/app/modules/channels/sidebar/sidebar.ts
View file @
b543a03e
...
...
@@ -160,6 +160,26 @@ export class ChannelSidebar {
.
present
();
}
async
proAdminToggle
()
{
const
value
=
!
this
.
user
.
pro
;
const
method
=
value
?
'
put
'
:
'
delete
'
;
this
.
user
.
pro
=
value
;
try
{
const
response
=
(
await
this
.
client
[
method
](
`api/v2/admin/pro/
${
this
.
user
.
guid
}
`
))
as
any
;
if
(
!
response
||
response
.
status
!==
'
success
'
)
{
throw
new
Error
(
'
Invalid server response
'
);
}
}
catch
(
e
)
{
console
.
error
(
e
);
this
.
user
.
pro
=
!
value
;
}
}
get
showBecomeProButton
()
{
const
isOwner
=
this
.
session
.
isLoggedIn
()
&&
...
...
src/app/modules/newsfeed/newsfeed.component.html
View file @
b543a03e
...
...
@@ -129,7 +129,9 @@
<a
class=
"m-page--sidebar--navigation--item"
routerLink=
"/pro"
*ngIf=
"session.isLoggedIn() && !session.getLoggedInUser().pro"
*ngIf=
"
false && (session.isLoggedIn() && !session.getLoggedInUser().pro)
"
>
<i
class=
"material-icons"
>
business_center
</i>
<span>
Become Pro
</span>
...
...
src/app/modules/pro/channel/subscription/subscription.component.html
View file @
b543a03e
<div
*ngIf=
"isLoggedIn"
>
<ng-container
*ngIf=
"!inProgress; else inProgressSpinner"
>
<button
[hidden]=
"true"
*ngIf=
"!active"
class=
"mdl-button mdl-button--colored mdl-color--green"
[disabled]=
"inProgress || criticalError"
...
...
src/app/modules/pro/channel/subscription/subscription.components.scss
View file @
b543a03e
m-pro--subscription
{
.m-pro-subscription--error
{
display
:
block
;
font-weight
:
bold
;
color
:
#fff
;
margin
:
8px
0
0
5px
;
}
}