...
 
......@@ -249,4 +249,8 @@ export class CampaignsService {
},
];
}
async rate(): Promise<number> {
return ((await this.client.get(`api/v2/boost/campaigns/rate`)) as any).rate;
}
}
......@@ -49,5 +49,8 @@ export type CampaignPayment = {
};
export type CampaignPreview = {
cannot_fulfill_daily?: boolean;
canBeDelivered: boolean;
durationDays: number;
globalViewsPerDay: number;
viewsPerDayRequested: number;
};
......@@ -109,7 +109,7 @@
></m-boost-campaigns-creator--content-selector>
</div>
<div class="m-form--field">
<!--<div class="m-form--field">
<label class="m-form--field-label">
<span i18n>Targeting</span>
<m-tooltip icon="help" i18n>TBD</m-tooltip>
......@@ -138,7 +138,7 @@
<i class="material-icons">check</i>
</m-hashtags-selector>
</div>
</div>
</div>-->
<div class="m-form--fieldset">
<div class="m-form--field">
......
......@@ -35,7 +35,12 @@ export class BoostCampaignsCreatorComponent implements OnInit, OnDestroy {
currentError: string = '';
preview: CampaignPreview = {};
preview: CampaignPreview = {
canBeDelivered: true,
durationDays: 0,
globalViewsPerDay: 0,
viewsPerDayRequested: 0,
};
protected route$: Subscription;
......@@ -68,7 +73,7 @@ export class BoostCampaignsCreatorComponent implements OnInit, OnDestroy {
this.preview$ = this.previewSubject
.pipe(debounceTime(600))
.subscribe(async (campaign: Campaign) => {
this.preview = (await this.service.preview(campaign)) || {};
this.preview = (await this.service.preview(campaign)) || this.preview;
this.detectChanges();
});
}
......
......@@ -24,4 +24,8 @@
color: themed($m-grey-400);
}
}
.m-boost-campaigns-creator--content-selector {
max-width: 860px;
}
}