Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (2)
(fix): send hashtag to endpoint
· a0700d65
Marcelo Rivera
authored
Aug 07, 2019
a0700d65
(fix): categories styling
· 42344414
Marcelo Rivera
authored
Aug 07, 2019
42344414
Hide whitespace changes
Inline
Side-by-side
src/app/modules/pro/channel/channel.component.scss
View file @
42344414
...
...
@@ -112,12 +112,12 @@ m-pro--channel {
display
:
flex
;
align-items
:
center
;
flex-wrap
:
wrap
;
justify-content
:
space-arou
nd
;
justify-content
:
flex-e
nd
;
.m-proChannel__category
{
cursor
:
pointer
;
color
:
var
(
--
text-color
);
padding
:
0
8
px
;
padding
:
0
16
px
;
&
.m-proChannel__selectedCategory
{
color
:
var
(
--
primary-color
);
...
...
src/app/modules/pro/channel/channel.component.ts
View file @
42344414
...
...
@@ -189,7 +189,7 @@ export class ProChannelComponent implements OnInit, OnDestroy {
search
()
{
if
(
!
this
.
currentURL
)
{
this
.
currentURL
=
`/pro/
${
this
.
channel
.
username
}
/articles`
;
//TODO ADD /TOP when algorithm is enable
this
.
currentURL
=
`/pro/
${
this
.
channel
.
username
}
/articles`
;
//TODO ADD /TOP when algorithm is enable
d
}
else
{
if
(
this
.
currentURL
.
includes
(
'
query
'
))
{
this
.
currentURL
=
this
.
currentURL
.
split
(
'
;
'
)[
0
];
...
...
src/app/modules/pro/channel/list-modal/list-modal.component.ts
View file @
42344414
...
...
@@ -4,6 +4,7 @@ import { FeedsService } from '../../../../common/services/feeds.service';
import
{
ProContentModalComponent
}
from
'
../content-modal/modal.component
'
;
import
{
OverlayModalService
}
from
'
../../../../services/ux/overlay-modal
'
;
import
{
OverlayModalComponent
}
from
'
../../../../common/components/overlay-modal/overlay-modal.component
'
;
import
{
Tag
}
from
"
../../../../interfaces/entities
"
;
@
Component
({
selector
:
'
m-pro--channel-list-modal
'
,
...
...
@@ -19,13 +20,16 @@ export class ProChannelListModal {
query
:
string
;
hashtag
:
Tag
;
parent
:
HTMLDivElement
;
@
ViewChild
(
'
overlayModal
'
,
{
static
:
true
})
protected
overlayModal
:
OverlayModalComponent
;
set
data
({
type
,
query
})
{
set
data
({
type
,
query
,
hashtag
})
{
this
.
type
=
type
;
this
.
query
=
query
;
this
.
hashtag
=
hashtag
;
}
constructor
(
...
...
@@ -50,9 +54,26 @@ export class ProChannelListModal {
this
.
detectChanges
();
let
url
=
`api/v2/feeds/channel/
${
this
.
channelService
.
currentChannel
.
guid
}
/
${
this
.
type
}
/
${
this
.
algorithm
}
`
;
let
params
=
[];
if
(
this
.
query
&&
this
.
query
!==
''
)
{
params
.
push
(
`query=
${
this
.
query
}
`
);
}
if
(
this
.
hashtag
)
{
params
.
push
(
`hashtags=
${
this
.
hashtag
.
tag
}
`
);
}
if
(
params
.
length
>
0
)
{
url
+=
'
?
'
+
params
.
join
(
'
&
'
);
}
try
{
this
.
feedsService
.
setEndpoint
(
`api/v2/feeds/channel/
${
this
.
channelService
.
currentChannel
.
guid
}
/
${
this
.
type
}
/
${
this
.
algorithm
}
`
)
.
setEndpoint
(
url
)
.
setLimit
(
12
)
.
fetch
();
...
...
src/app/modules/pro/channel/list/list.component.ts
View file @
42344414
...
...
@@ -123,20 +123,20 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
this
.
detectChanges
();
let
search
=
[];
let
params
=
[];
if
(
this
.
selectedHashtag
)
{
search
.
push
(
`hashtags=
${
this
.
selectedHashtag
.
tag
}
`
);
params
.
push
(
`hashtags=
${
this
.
selectedHashtag
.
tag
}
`
);
}
if
(
this
.
query
&&
(
this
.
query
!==
''
))
{
search
.
push
(
`&period=
${
this
.
period
}
&all=1&query=
${
this
.
query
}
&nsfw=&sync=1&limit=150&as_activities=1&from_timestamp=`
);
params
.
push
(
`&period=
${
this
.
period
}
&all=1&query=
${
this
.
query
}
&nsfw=&sync=1&limit=150&as_activities=1&from_timestamp=`
);
}
let
url
=
`api/v2/feeds/channel/
${
this
.
channelService
.
currentChannel
.
guid
}
/
${
this
.
type
}
/
${
this
.
algorithm
}
`
;
if
(
search
.
length
>
0
)
{
url
+=
'
?
'
+
search
.
join
(
'
&
'
);
if
(
params
.
length
>
0
)
{
url
+=
'
?
'
+
params
.
join
(
'
&
'
);
}
try
{
...
...
@@ -165,6 +165,7 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
type
:
this
.
type
,
algorithm
:
'
latest
'
,
query
:
this
.
query
,
hashtag
:
this
.
selectedHashtag
},
{
class
:
'
m-overlayModal--seeMore
'
...
...