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
887
Issues
887
List
Boards
Labels
Service Desk
Milestones
Merge Requests
51
Merge Requests
51
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
5992d6ae
Commit
5992d6ae
authored
9 minutes ago
by
Ben Hayward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force hashtag pipe to lowercase
#2088
parent
534f449e
feat/lowercase-tag-discovery-2088
1 merge request
!589
[Sprint/PinkPanther](feat): Force hashtag pipe to lowercase in discovery #2088
Pipeline
#88755467
running with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
src/app/common/pipes/tags.spec.ts
src/app/common/pipes/tags.spec.ts
+9
-0
src/app/common/pipes/tags.ts
src/app/common/pipes/tags.ts
+5
-1
No files found.
src/app/common/pipes/tags.spec.ts
View file @
5992d6ae
...
...
@@ -58,6 +58,15 @@ describe('TagPipe', () => {
);
});
it
(
'
should transform uppercase text following # to lower case
'
,
()
=>
{
const
pipe
=
new
TagsPipe
(
featuresServiceMock
);
const
string
=
'
textString #NaMe
'
;
const
transformedString
=
pipe
.
transform
(
<
any
>
string
);
expect
(
transformedString
).
toContain
(
'
<a href="/newsfeed/global/top;hashtag=name;period=24h
'
);
});
it
(
'
should correctly parse when duplicates substrings present
'
,
()
=>
{
const
pipe
=
new
TagsPipe
(
featuresServiceMock
);
const
string
=
'
#hash #hashlonger
'
;
...
...
This diff is collapsed.
Click to expand it.
src/app/common/pipes/tags.ts
View file @
5992d6ae
...
...
@@ -32,7 +32,11 @@ export class TagsPipe implements PipeTransform {
rule
:
/
(
^|
\s
||
)
#
(\w
+
)
/gim
,
replace
:
m
=>
{
if
(
this
.
featureService
.
has
(
'
top-feeds
'
))
{
return
`
${
m
.
match
[
1
]}
<a href="/newsfeed/global/top;hashtag=
${
m
.
match
[
2
]}
;period=24h">#
${
m
.
match
[
2
]}
</a>`
;
return
`
${
m
.
match
[
1
]
}
<a href="/newsfeed/global/top;hashtag=
${
m
.
match
[
2
].
toLowerCase
()}
;period=24h">#
${
m
.
match
[
2
]
}
</a>`
;
}
return
`
${
m
.
match
[
1
]}
<a href="/newsfeed/tag/
${
m
.
match
[
2
]}
;ref=hashtag">#
${
m
.
match
[
2
]}
</a>`
;
},
...
...
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