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
383
Merge Requests
65
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
ad2261e2
Commit
ad2261e2
authored
1 hour ago
by
Mark Harding
Browse files
Options
Download
(fix): comments overflowing when fixed height
parent
3e7a1f9b
feat/2511-activity-v2
1 merge request
!764
New activity posts with fixed heights
Pipeline
#115570849
passed with stages
in 89 minutes and 13 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
5 deletions
+35
-5
src/app/modules/comments/entity-outlet/entity-outlet.component.ts
View file @
ad2261e2
...
...
@@ -47,7 +47,8 @@ export class CommentsEntityOutletComponent implements OnInit, OnDestroy {
@
Input
()
limit
:
number
=
12
;
@
Input
()
canEdit
:
boolean
=
false
;
@
Input
()
canDelete
:
boolean
=
false
;
showOnlyPoster
:
boolean
=
true
;
@
Input
()
fixedHeight
=
false
;
@
Input
()
showOnlyPoster
=
true
;
optimisticList
:
Array
<
any
>
=
[];
// private shouldReuseRouteFn;
...
...
@@ -57,7 +58,7 @@ export class CommentsEntityOutletComponent implements OnInit, OnDestroy {
public
client
:
Client
,
public
attachment
:
AttachmentService
,
public
sockets
:
SocketsService
,
private
r
enderer
:
Render
er
,
private
r
outer
:
Rout
er
,
private
cd
:
ChangeDetectorRef
,
public
legacyActivityService
:
ActivityServiceCommentsLegacySupport
)
{}
...
...
@@ -90,19 +91,35 @@ export class CommentsEntityOutletComponent implements OnInit, OnDestroy {
}
onPosted
({
comment
,
index
}):
void
{
if
(
this
.
fixedHeight
)
{
this
.
redirectToSinglePage
();
}
this
.
optimisticList
[
index
]
=
comment
;
this
.
detectChanges
();
}
onOptimisticPost
(
comment
):
void
{
if
(
this
.
fixedHeight
)
return
;
this
.
optimisticList
.
push
(
comment
);
}
openFullComments
():
void
{
if
(
this
.
fixedHeight
)
{
// redirect to full view newsfeed post
this
.
redirectToSinglePage
();
}
this
.
showOnlyPoster
=
false
;
this
.
detectChanges
();
}
redirectToSinglePage
():
void
{
this
.
router
.
navigate
([
`/newsfeed/
${
this
.
entity
.
guid
}
`
],
{
queryParams
:
{
fixedHeight
:
0
,
},
});
}
detectChanges
():
void
{
this
.
cd
.
markForCheck
();
this
.
cd
.
detectChanges
();
...
...
This diff is collapsed.
src/app/modules/newsfeed/activity/activity.component.html
View file @
ad2261e2
...
...
@@ -20,6 +20,8 @@
<m-comments
__entityOutlet
[entity]=
"service.entity$ | async"
[canDelete]=
"service.canDelete$ | async"
[showOnlyPoster]=
"service.displayOptions.showOnlyCommentsInput"
[fixedHeight]=
"service.displayOptions.fixedHeight"
>
</m-comments
__entityOutlet
>
</ng-container>
This diff is collapsed.
src/app/modules/newsfeed/activity/content/content.component.ts
View file @
ad2261e2
...
...
@@ -111,7 +111,15 @@ export class ActivityContentComponent {
const
messageHeight
=
this
.
messageEl
?
this
.
messageEl
.
nativeElement
.
clientHeight
:
0
;
this
.
remindHeight
=
this
.
maxFixedHeightContent
-
messageHeight
;
let
maxFixedHeightContent
=
this
.
maxFixedHeightContent
;
// Need to allow extra space for comments entry
if
(
this
.
entity
[
'
comments:count
'
]
>
0
)
{
maxFixedHeightContent
=
maxFixedHeightContent
-
42
;
}
this
.
remindHeight
=
maxFixedHeightContent
-
messageHeight
;
this
.
remindWidth
=
this
.
remindHeight
*
this
.
fixedHeightRatio
;
}
...
...
This diff is collapsed.
src/app/modules/newsfeed/single/single.component.html
View file @
ad2261e2
...
...
@@ -48,7 +48,10 @@
<div
class=
"minds-list"
*ngIf=
"activity && !showLegacyActivity"
>
<m-activity
[entity]=
"activity"
[displayOptions]=
"{ fixedHeight: fixedHeight }"
[displayOptions]=
"{
fixedHeight: fixedHeight,
showOnlyCommentsInput: fixedHeight
}"
></m-activity>
</div>
</div>
...
...
This diff is collapsed.
src/app/modules/newsfeed/single/single.component.ts
View file @
ad2261e2
...
...
@@ -73,7 +73,7 @@ export class NewsfeedSingleComponent {
this
.
editing
=
!!
params
.
get
(
'
editing
'
);
}
if
(
params
.
has
(
'
fixedHeight
'
))
{
this
.
fixedHeight
=
!!
params
.
get
(
'
fixedHeight
'
)
;
this
.
fixedHeight
=
params
.
get
(
'
fixedHeight
'
)
===
'
1
'
;
}
}
);
...
...
This diff is collapsed.
Please
register
or
sign in
to comment