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
864
Issues
864
List
Boards
Labels
Service Desk
Milestones
Merge Requests
45
Merge Requests
45
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
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
Compare Revisions
38bbcd3310d5937632b8394b4e53594da80f1da9...03f9518289bfe1e524d25bcbce84c1364fa7f3bb
Source
03f9518289bfe1e524d25bcbce84c1364fa7f3bb
Select Git revision
...
Target
38bbcd3310d5937632b8394b4e53594da80f1da9
Select Git revision
Compare
Commits (2)
(refactor): moved selectedHashtag to ProChannelService
· aa261cfe
Marcelo Rivera
authored
29 minutes ago
(feat): send selectedHashtag to backend
aa261cfe
(fix): added scheme to typings
· 03f95182
Marcelo Rivera
authored
26 minutes ago
03f95182
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
10 deletions
+41
-10
entities.ts
src/app/interfaces/entities.ts
+1
-1
channel.component.ts
src/app/modules/pro/channel/channel.component.ts
+1
-3
channel.service.ts
src/app/modules/pro/channel/channel.service.ts
+10
-2
list.component.ts
src/app/modules/pro/channel/list/list.component.ts
+29
-4
No files found.
src/app/interfaces/entities.ts
View file @
03f95182
...
...
@@ -82,7 +82,7 @@ export interface MindsUser {
headline
:
string
,
footer_text
:
string
,
footer_links
:
{
href
:
string
,
title
:
string
}[],
scheme
:
string
,
styles
?:
{
[
key
:
string
]:
string
},
};
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/channel.component.ts
View file @
03f95182
...
...
@@ -46,8 +46,6 @@ export class ProChannelComponent implements OnInit, OnDestroy {
query
:
string
;
selectedTag
:
Tag
=
null
;
constructor
(
protected
element
:
ElementRef
,
protected
session
:
Session
,
...
...
@@ -212,7 +210,7 @@ export class ProChannelComponent implements OnInit, OnDestroy {
}
selectTag
(
clickedTag
:
any
)
{
this
.
selectedTag
=
clickedTag
;
this
.
channelService
.
setSelectedHashtag
(
clickedTag
)
;
for
(
let
tag
of
this
.
channel
.
pro_settings
.
tag_list
)
{
tag
.
selected
=
tag
.
tag
==
clickedTag
.
tag
;
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/channel.service.ts
View file @
03f95182
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
EventEmitter
,
Injectable
}
from
'
@angular/core
'
;
import
{
MindsChannelResponse
}
from
'
../../../interfaces/responses
'
;
import
{
MindsUser
}
from
'
../../../interfaces/entities
'
;
import
{
MindsUser
,
Tag
}
from
'
../../../interfaces/entities
'
;
import
{
Client
}
from
'
../../../services/api/client
'
;
@
Injectable
()
export
class
ProChannelService
{
currentChannel
:
MindsUser
;
selectedHashtag
:
Tag
;
selectedHashtagChange
:
EventEmitter
<
Tag
>
=
new
EventEmitter
<
Tag
>
();
setSelectedHashtag
(
value
:
Tag
)
{
this
.
selectedHashtag
=
value
;
this
.
selectedHashtagChange
.
emit
(
this
.
selectedHashtag
);
}
constructor
(
protected
client
:
Client
,
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/list/list.component.ts
View file @
03f95182
...
...
@@ -7,6 +7,7 @@ import { first } from "rxjs/operators";
import
{
OverlayModalService
}
from
"
../../../../services/ux/overlay-modal
"
;
import
{
ProContentModalComponent
}
from
"
../content-modal/modal.component
"
;
import
{
ProChannelListModal
}
from
'
../list-modal/list-modal.component
'
;
import
{
Tag
}
from
"
../../../../interfaces/entities
"
;
@
Component
({
selector
:
'
m-pro--channel-list
'
,
...
...
@@ -30,6 +31,10 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
displaySeeMoreTile
:
boolean
=
false
;
selectedHashtag
:
Tag
;
selectedHashtag$
:
Subscription
;
constructor
(
public
feedsService
:
FeedsService
,
protected
modalService
:
OverlayModalService
,
...
...
@@ -43,6 +48,12 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
ngOnInit
()
{
this
.
listen
();
this
.
selectedHashtag$
=
this
.
channelService
.
selectedHashtagChange
.
subscribe
((
tag
)
=>
{
this
.
selectedHashtag
=
tag
;
this
.
load
(
true
);
})
}
private
listen
()
{
...
...
@@ -98,6 +109,9 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
if
(
this
.
params$
)
{
this
.
params$
.
unsubscribe
();
}
if
(
this
.
selectedHashtag$
)
{
this
.
selectedHashtag$
.
unsubscribe
();
}
}
async
load
(
refresh
:
boolean
=
false
)
{
...
...
@@ -109,14 +123,25 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
this
.
detectChanges
();
let
search
=
''
;
let
search
=
[];
if
(
this
.
selectedHashtag
)
{
search
.
push
(
`hashtags=
${
this
.
selectedHashtag
.
tag
}
`
);
}
if
(
this
.
query
&&
(
this
.
query
!==
''
))
{
search
=
`?hashtags=null&period=
${
this
.
period
}
&all=1&query=
${
this
.
query
}
&nsfw=&sync=1&limit=150&as_activities=1&from_timestamp=`
;
search
.
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
(
'
&
'
);
}
try
{
this
.
feedsService
.
setEndpoint
(
`api/v2/feeds/channel/
${
this
.
channelService
.
currentChannel
.
guid
}
/
${
this
.
type
}
/
${
this
.
algorithm
}${
search
}
`
)
.
setEndpoint
(
url
)
.
setLimit
(
10
)
.
fetch
();
...
...
@@ -141,7 +166,7 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
algorithm
:
'
latest
'
,
query
:
this
.
query
,
},
{
{
class
:
'
m-overlayModal--seeMore
'
},
this
.
injector
)
.
present
();
...
...
This diff is collapsed.
Click to expand it.