Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
899
Issues
899
List
Boards
Labels
Service Desk
Milestones
Merge Requests
45
Merge Requests
45
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
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
61be1415
Commit
61be1415
authored
8 minutes ago
by
Ben Hayward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lint
parent
c46eb2a6
fix/hashtag-limit-edit-867
1 merge request
!436
[Sprint/InterestingIguana](feat) Show error on hashtag limit when editing post #867
Pipeline
#81397449
running with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
15 deletions
+19
-15
topbar.service.spec.ts
src/app/modules/hashtags/service/topbar.service.spec.ts
+16
-11
topbar.service.ts
src/app/modules/hashtags/service/topbar.service.ts
+2
-3
preview.ts
src/app/modules/legacy/components/cards/activity/preview.ts
+1
-1
No files found.
src/app/modules/hashtags/service/topbar.service.spec.ts
View file @
61be1415
...
...
@@ -2,25 +2,30 @@ import { TopbarHashtagsService } from './topbar.service';
import
{
async
,
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
describe
(
'
TopbarHashtagsService
'
,
()
=>
{
let
client
=
null
;
let
hashtagsService
=
new
TopbarHashtagsService
(
client
);
it
(
'
should split hashtags from a message correctly
'
,
function
(
done
)
{
const
input
=
'
#begin foobar #Has #Hell123 #hello and #what, #ending
'
;
const
expectedResult
=
[
'
begin
'
,
'
Has
'
,
'
Hell123
'
,
'
hello
'
,
'
what
'
,
'
ending
'
];
const
input
=
'
#begin foobar #Has #Hell123 #hello and #what, #ending
'
;
const
expectedResult
=
[
'
begin
'
,
'
Has
'
,
'
Hell123
'
,
'
hello
'
,
'
what
'
,
'
ending
'
,
];
const
result
=
hashtagsService
.
sliceHashTags
(
input
);
expect
(
result
).
toEqual
(
expectedResult
);
done
();
const
result
=
hashtagsService
.
sliceHashTags
(
input
);
expect
(
result
).
toEqual
(
expectedResult
);
done
();
});
it
(
'
should return an empty array if the message has no hashtags
'
,
function
(
done
)
{
const
input
=
'
foo bar.
'
;
const
result
=
hashtagsService
.
sliceHashTags
(
input
);
const
input
=
'
foo bar.
'
;
const
result
=
hashtagsService
.
sliceHashTags
(
input
);
expect
(
result
).
toEqual
([]);
done
();
expect
(
result
).
toEqual
([]);
done
();
});
});
This diff is collapsed.
Click to expand it.
src/app/modules/hashtags/service/topbar.service.ts
View file @
61be1415
...
...
@@ -99,14 +99,13 @@ export class TopbarHashtagsService {
* Credit to Arnaud Valensi - http://geekcoder.org/js-extract-hashtags-from-text/
*/
sliceHashTags
(
inputText
:
any
)
{
sliceHashTags
(
inputText
:
any
)
{
const
regex
=
/
(?:
^|
\s)(?:
#
)([
a-zA-Z
\d]
+
)
/gm
;
let
matches
=
[];
let
match
;
while
((
match
=
regex
.
exec
(
inputText
)))
{
matches
.
push
(
match
[
1
]);
matches
.
push
(
match
[
1
]);
}
return
matches
;
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/legacy/components/cards/activity/preview.ts
View file @
61be1415
...
...
@@ -24,7 +24,7 @@ export class ActivityPreview {
minds
=
window
.
Minds
;
activity
:
any
;
hideTabs
:
boolean
;
editing
:
boolean
=
false
;
errorString
:
string
=
null
;
commentsToggle
:
boolean
=
false
;
...
...
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