Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Frontend
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
403
Merge Requests
68
CI / CD
Security & Compliance
Packages
Analytics
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
e384309c
Commit
e384309c
authored
17 hours ago
by
Ben Hayward
Browse files
Options
Download
Disabled reminding and boosting from closed groups
#2586
parent
225dc6f3
fix/closed-group-remind-boost-2586
1 merge request
!784
Removed Remind and Boost buttons in closed groups #2586
Pipeline
#118085694
passed with stages
in 90 minutes
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
4 deletions
+89
-4
src/app/modules/groups/profile/feed/sorted.component.html
View file @
e384309c
...
...
@@ -63,6 +63,8 @@
(delete)=
"delete(entity)"
[slot]=
"i + 1"
[attr.data-minds-activity-guid]=
"entity.guid"
[disableBoosting]=
"group['membership'] === 0"
[disableReminding]=
"group['membership'] === 0"
>
<!-- Menu Actions -->
...
...
This diff is collapsed.
src/app/modules/legacy/components/cards/activity/activity.component.spec.ts
View file @
e384309c
///<reference path="../../../../../../../node_modules/@types/jasmine/index.d.ts"/>
import
{
async
,
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
async
,
ComponentFixture
,
TestBed
,
fakeAsync
,
tick
,
}
from
'
@angular/core/testing
'
;
import
{
Component
,
DebugElement
,
...
...
@@ -569,5 +575,56 @@ describe('Activity', () => {
expect
(
views
.
nativeElement
.
textContent
).
toContain
(
100
);
});
it
(
'
should default disableReminding to FALSE
'
,
()
=>
{
expect
(
comp
.
disableReminding
).
toBeFalsy
();
});
it
(
'
should not show remind button if disableReminding set to true
'
,
()
=>
{
spyOn
(
comp
,
'
isScheduled
'
).
and
.
callFake
(
function
()
{
return
false
;
});
comp
.
disableReminding
=
true
;
comp
.
activity
.
time_created
=
999999999999999999999
;
expect
(
comp
.
showRemindButton
()).
toBeFalsy
();
});
it
(
'
should show remind button if disableReminding set to false
'
,
()
=>
{
spyOn
(
comp
,
'
isScheduled
'
).
and
.
callFake
(
function
()
{
return
false
;
});
comp
.
disableReminding
=
false
;
comp
.
activity
.
time_created
=
999999999999999999999
;
expect
(
comp
.
showRemindButton
()).
toBeTruthy
();
});
it
(
'
should default disableBoosting to FALSE
'
,
()
=>
{
expect
(
comp
.
disableBoosting
).
toBeFalsy
();
});
it
(
'
should not show boost button if disableReminding set to true
'
,
()
=>
{
spyOn
(
comp
,
'
isScheduled
'
).
and
.
callFake
(
function
()
{
return
false
;
});
spyOn
(
comp
.
session
,
'
getLoggedInUser
'
).
and
.
callFake
(
function
()
{
return
{
guid
:
'
123
'
};
});
comp
.
disableBoosting
=
true
;
comp
.
activity
.
time_created
=
999999999999999999999
;
comp
.
activity
.
owner_guid
=
'
123
'
;
expect
(
comp
.
showBoostButton
()).
toBeFalsy
();
});
it
(
'
should show boost button if disableReminding set to false
'
,
()
=>
{
spyOn
(
comp
,
'
isScheduled
'
).
and
.
callFake
(
function
()
{
return
false
;
});
spyOn
(
comp
.
session
,
'
getLoggedInUser
'
).
and
.
callFake
(
function
()
{
return
{
guid
:
'
123
'
};
});
comp
.
disableBoosting
=
false
;
comp
.
activity
.
time_created
=
999999999999999999999
;
comp
.
activity
.
owner_guid
=
'
123
'
;
expect
(
comp
.
showBoostButton
()).
toBeTruthy
();
});
// TODO test the rest of the features
});
This diff is collapsed.
src/app/modules/legacy/components/cards/activity/activity.html
View file @
e384309c
...
...
@@ -400,8 +400,7 @@
></m-wire-button>
<button
class=
"m-btn m-btn--action m-btn--slim minds-boost-button"
*ngIf=
"session.getLoggedInUser().guid == activity.owner_guid
&& !isScheduled(activity.time_created)"
*ngIf=
"showBoostButton()"
id=
"boost-actions"
(click)=
"showBoost()"
>
...
...
@@ -411,7 +410,10 @@
[object]=
"activity"
(click)=
"openComments()"
></minds-button-comment>
<minds-button-remind
[object]=
"activity"
></minds-button-remind>
<minds-button-remind
*ngIf=
"showRemindButton()"
[object]=
"activity"
></minds-button-remind>
</div>
<!-- Activity metrics -->
...
...
This diff is collapsed.
src/app/modules/legacy/components/cards/activity/activity.ts
View file @
e384309c
...
...
@@ -70,6 +70,8 @@ export class Activity implements OnInit {
showBoostOptions
:
boolean
=
false
;
allowComments
=
true
;
@
Input
()
boost
:
boolean
=
false
;
@
Input
()
disableBoosting
:
boolean
=
false
;
@
Input
()
disableReminding
:
boolean
=
false
;
@
Input
(
'
boost-toggle
'
)
@
Input
()
showBoostMenuOptions
:
boolean
=
false
;
...
...
@@ -613,4 +615,26 @@ export class Activity implements OnInit {
?
true
:
false
;
}
/**
* Determined whether boost button should be shown.
* @returns { boolean } true if boost button should be shown.
*/
showBoostButton
():
boolean
{
return
(
this
.
session
.
getLoggedInUser
().
guid
==
this
.
activity
.
owner_guid
&&
!
this
.
isScheduled
(
this
.
activity
.
time_created
)
&&
!
this
.
disableBoosting
);
}
/**
* Determined whether remind button should be shown.
* @returns { boolean } true if remind button should be shown.
*/
showRemindButton
():
boolean
{
return
(
!
this
.
isScheduled
(
this
.
activity
.
time_created
)
&&
!
this
.
disableReminding
);
}
}
This diff is collapsed.
Please
register
or
sign in
to comment