Skip to content
Commits on Source (2)
......@@ -112,12 +112,12 @@ m-pro--channel {
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: space-around;
justify-content: flex-end;
.m-proChannel__category {
cursor: pointer;
color: var(--text-color);
padding: 0 8px;
padding: 0 16px;
&.m-proChannel__selectedCategory {
color: var(--primary-color);
......
......@@ -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 enabled
} else {
if (this.currentURL.includes('query')) {
this.currentURL = this.currentURL.split(';')[0];
......
......@@ -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();
......
......@@ -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'
......