Commit 8aa592f5 authored by Juan Manuel Solaro's avatar Juan Manuel Solaro

(feat) filter activities by time_created to get scheduled

1 merge request!494WIP: epic/post-scheduler
Pipeline #77399519 running with stages
......@@ -7,8 +7,8 @@
<div class="minds-list">
<div>
<div class="mindsList__tools m-border">
<div class="mindsListTools__scheduled">
<i class="material-icons">date_range</i>
<div class="mindsListTools__scheduled" (click)="toggleScheduled()" [class.selected]="seeScheduled">
<m-tooltip icon="date_range"> See Scheduled Activities </m-tooltip>
<span>scheduled: 10</span>
</div>
<m-sort-selector
......
......@@ -10,6 +10,8 @@
align-items: center;
.mindsListTools__scheduled {
cursor: pointer;
i {
vertical-align: middle;
font-size: 18px;
......
......@@ -64,6 +64,8 @@ export class ChannelSortedComponent implements OnInit {
initialized: boolean = false;
seeScheduled: boolean = false;
@ViewChild('poster', { static: false }) protected poster: PosterComponent;
constructor(
......@@ -96,10 +98,15 @@ export class ChannelSortedComponent implements OnInit {
this.detectChanges();
let endpoint = 'api/v2/feeds/container';
if (this.seeScheduled) {
endpoint = 'api/v2/channel/scheduled';
}
try {
this.feedsService
.setEndpoint(`api/v2/feeds/container/${this.channel.guid}/${this.type}`)
.setEndpoint(`${endpoint}/${this.channel.guid}/${this.type}`)
.setLimit(12)
.fetch();
......@@ -173,4 +180,9 @@ export class ChannelSortedComponent implements OnInit {
this.cd.markForCheck();
this.cd.detectChanges();
}
toggleScheduled() {
this.seeScheduled = !this.seeScheduled;
this.load(true);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment