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
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
818
Issues
818
List
Boards
Labels
Service Desk
Milestones
Merge Requests
60
Merge Requests
60
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
1cda1598
Commit
1cda1598
authored
4 minutes ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): add comments limit to comments poster
parent
85c3f611
master
No related merge requests found
Pipeline
#65657454 (#485)
running with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
4 deletions
+43
-4
poster.component.html
src/app/modules/comments/poster/poster.component.html
+13
-3
poster.component.scss
src/app/modules/comments/poster/poster.component.scss
+22
-0
poster.component.ts
src/app/modules/comments/poster/poster.component.ts
+8
-1
No files found.
src/app/modules/comments/poster/poster.component.html
View file @
1cda1598
<div
class=
"m-comment m-comment--poster minds-block"
*
ngIf=
"!readonly"
>
<div
class=
"minds-avatar"
>
...
...
@@ -8,8 +7,8 @@
</div>
<div
class=
"minds-body"
>
<div
class=
"m-comments-composer"
>
<form
(
submit
)="
post
($
event
)"
>
<minds-textarea
#
message=
"Textarea"
...
...
@@ -27,6 +26,7 @@
<div
class=
"mdl-card__actions"
>
<!-- Attachements -->
<div
class=
"attachment-button"
[
ngClass
]="{
'
mdl-color-text--amber-500
'
:
attachment
.
hasFile
()
}"
>
<i
class=
"material-icons"
>
attachment
</i>
<input
type=
"file"
id=
"file"
#
file
name=
"attachment"
(
change
)="
uploadAttachment
(
file
,
$
event
)"
/>
...
...
@@ -47,6 +47,17 @@
>
<i
class=
"material-icons"
>
send
</i>
</a>
<div
[
class
.
hidden
]="
content
.
length =
==
0
"
class=
"m-commentPoster__limit"
[
class
.
m-commentPoster__limit--maxed
]="
content
.
length
>
1500"
>
<span
class=
"m-commentPosterLimit__inputed"
>
{{ content.length }}
</span>
<span>
/ 1500
</span>
</div>
</div>
<!-- Rich embed preview -->
...
...
@@ -79,7 +90,6 @@
</div>
</div>
</div>
</div>
</div>
This diff is collapsed.
Click to expand it.
src/app/modules/comments/poster/poster.component.scss
View file @
1cda1598
@import
"themes"
;
.m-commentPoster__limit
{
font-size
:
10px
;
color
:
$grey-600
;
padding
:
8px
0
;
cursor
:
default
;
}
.m-commentPoster__limit--maxed
{
@include
m-theme
()
{
color
:
themed
(
$m-red
);
}
}
.m-commentPosterLimit__inputed
{
font-weight
:
600
;
}
.m-comment--poster
{
padding
:
8px
12px
12px
12px
;
}
This diff is collapsed.
Click to expand it.
src/app/modules/comments/poster/poster.component.ts
View file @
1cda1598
...
...
@@ -46,6 +46,7 @@ export class CommentPosterComponent {
comments
:
Array
<
any
>
=
[];
// TODO: remove this
canPost
:
boolean
=
true
;
inProgress
:
boolean
=
false
;
maxLength
:
number
=
1500
;
constructor
(
public
session
:
Session
,
...
...
@@ -67,6 +68,10 @@ export class CommentPosterComponent {
async
post
(
e
)
{
e
.
preventDefault
();
if
(
this
.
content
.
length
>
this
.
maxLength
)
{
return
;
}
if
(
this
.
inProgress
)
return
;
...
...
@@ -107,7 +112,6 @@ export class CommentPosterComponent {
this
.
posted$
.
next
({
comment
,
index
:
this
.
currentIndex
});
console
.
error
(
'Error posting'
,
e
);
}
this
.
inProgress
=
false
;
this
.
detectChanges
();
}
...
...
@@ -176,6 +180,9 @@ export class CommentPosterComponent {
}
postEnabled
()
{
if
(
this
.
content
.
length
>
this
.
maxLength
)
{
return
false
;
}
return
true
;
// TODO: fix
}
...
...
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