Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
803
Issues
803
List
Boards
Labels
Service Desk
Milestones
Merge Requests
59
Merge Requests
59
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
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
Commits
95ca222a
Commit
95ca222a
authored
56 minutes ago
by
Brian Hatchet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding 'allow-comments-toggle' feature. Setting featuresservice assumption to false
parent
4b51976e
feat/disable-comments-526
1 merge request
!426
(Feat) disable comments 526
Pipeline
#70361159
passed with stages
in 31 minutes and 24 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
6 deletions
+12
-6
post-menu.component.html
src/app/common/components/post-menu/post-menu.component.html
+1
-1
post-menu.component.spec.ts
...p/common/components/post-menu/post-menu.component.spec.ts
+6
-1
post-menu.component.ts
src/app/common/components/post-menu/post-menu.component.ts
+3
-2
features.service.ts
src/app/services/features.service.ts
+2
-2
No files found.
src/app/common/components/post-menu/post-menu.component.html
View file @
95ca222a
...
...
@@ -39,7 +39,7 @@
<li
class=
"mdl-menu__item"
*
ngIf=
"!asyncBlockInProgress && asyncBlock"
(
click
)="
unBlock
()"
i18n=
"@@COMMON__POST_MENU__UNBLOCK"
>
Unblock user
</li>
</ng-container>
<!-- ALLOW COMMENTS -->
<ng-container
*
ngIf=
"options.indexOf('allow-comments') !== -1 && entity.ownerObj.guid == session.getLoggedInUser().guid "
>
<ng-container
*
ngIf=
"
featuresService.has('allow-comments-toggle') &&
options.indexOf('allow-comments') !== -1 && entity.ownerObj.guid == session.getLoggedInUser().guid "
>
<li
class=
"mdl-menu__item"
*
ngIf=
"!entity.allow_comments"
(
click
)="
allowComments
(
true
)"
i18n=
"@@COMMON__POST_MENU__ALLOW_COMMENTS"
>
Allow Comments
</li>
<li
class=
"mdl-menu__item"
*
ngIf=
"entity.allow_comments"
(
click
)="
allowComments
(
false
)"
i18n=
"@@COMMON__POST_MENU__DISABLE_COMMENTS"
>
Disable Comments
</li>
</ng-container>
...
...
This diff is collapsed.
Click to expand it.
src/app/common/components/post-menu/post-menu.component.spec.ts
View file @
95ca222a
...
...
@@ -16,7 +16,9 @@ import { FormsModule } from '@angular/forms';
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
BlockListService
}
from
'
../../services/block-list.service
'
;
import
{
ActivityService
}
from
'
../../services/activity.service
'
;
import
{
FeaturesService
}
from
'
../../../services/features.service
'
;
import
{
activityServiceMock
}
from
'
../../../../tests/activity-service-mock.spec
'
;
import
{
featuresServiceMock
}
from
'
../../../../tests/features-service-mock.spec
'
;
/* tslint:disable */
/* Mock section */
...
...
@@ -97,6 +99,7 @@ describe('PostMenuComponent', () => {
{
provide
:
Session
,
useValue
:
sessionMock
},
{
provide
:
OverlayModalService
,
useValue
:
overlayModalServiceMock
},
{
provide
:
ActivityService
,
useValue
:
activityServiceMock
},
{
provide
:
FeaturesService
,
useValue
:
featuresServiceMock
},
BlockListService
,
],
schemas
:
[
...
...
@@ -108,6 +111,7 @@ describe('PostMenuComponent', () => {
// synchronous beforeEach
beforeEach
(()
=>
{
featuresServiceMock
.
mock
(
'
allow-comments-toggle
'
,
true
);
fixture
=
TestBed
.
createComponent
(
PostMenuComponent
);
comp
=
fixture
.
componentInstance
;
...
...
@@ -115,8 +119,9 @@ describe('PostMenuComponent', () => {
comp
.
entity
=
{};
// comp.opened = true;
comp
.
entity
.
ownerObj
=
{
guid
:
'
1
'
};
comp
.
cardMenuHandler
();
comp
.
cardMenuHandler
();
fixture
.
detectChanges
();
});
it
(
'
should have dropdown
'
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/app/common/components/post-menu/post-menu.component.ts
View file @
95ca222a
...
...
@@ -7,7 +7,7 @@ import { MindsUser } from '../../../interfaces/entities';
import
{
SignupModalService
}
from
'
../../../modules/modals/signup/service
'
;
import
{
BlockListService
}
from
'
../../services/block-list.service
'
;
import
{
ActivityService
}
from
'
../../../common/services/activity.service
'
;
import
{
FeaturesService
}
from
'
../../../services/features.service
'
;
type
Option
=
'
edit
'
...
...
@@ -70,7 +70,7 @@ export class PostMenuComponent implements OnInit {
public
signupModal
:
SignupModalService
,
protected
blockListService
:
BlockListService
,
protected
activityService
:
ActivityService
,
)
{
public
featuresService
:
FeaturesService
)
{
this
.
initCategories
();
}
...
...
@@ -83,6 +83,7 @@ export class PostMenuComponent implements OnInit {
label
:
window
.
Minds
.
categories
[
category
],
});
}
console
.
log
(
"
Working!
"
);
}
cardMenuHandler
()
{
...
...
This diff is collapsed.
Click to expand it.
src/app/services/features.service.ts
View file @
95ca222a
...
...
@@ -22,11 +22,11 @@ export class FeaturesService {
if
(
typeof
this
.
_features
[
feature
]
===
'
undefined
'
)
{
if
(
isDevMode
()
&&
!
this
.
_hasWarned
(
feature
))
{
console
.
warn
(
`[FeaturedService] Feature '
${
feature
}
' is not declared. Assuming
tru
e.`
);
console
.
warn
(
`[FeaturedService] Feature '
${
feature
}
' is not declared. Assuming
fals
e.`
);
this
.
_warnedCache
[
feature
]
=
Date
.
now
();
}
return
tru
e
;
return
fals
e
;
}
if
(
this
.
_features
[
feature
]
===
'
admin
'
&&
this
.
session
.
isAdmin
())
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment