Skip to content

Commit

Permalink
Release v0.11 (#678)
Browse files Browse the repository at this point in the history
Release v0.11
  • Loading branch information
PawZar authored Jun 12, 2019
2 parents 2fae5fa + e5342b9 commit 6b00d3f
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 18 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.11.0] - 2019-06-12
### Fixed
- Minor display issues

## [0.10.0] - 2019-06-04
### Added
- Referrer link handling
Expand Down Expand Up @@ -111,7 +115,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Advertiser features (Campaigns & Ads)
- Publisher features (Sites & AdUnits)

[Unreleased]: https://github.com/adshares/adpanel/compare/v0.10.0...develop
[Unreleased]: https://github.com/adshares/adpanel/compare/v0.11.0...develop
[0.11.0]: https://github.com/adshares/adpanel/compare/v0.10.0...v0.11.0
[0.10.0]: https://github.com/adshares/adpanel/compare/v0.9.0...v0.10.0
[0.9.0]: https://github.com/adshares/adpanel/compare/v0.8.0...v0.9.0
[0.8.0]: https://github.com/adshares/adpanel/compare/v0.7.3...v0.8.0
Expand Down
3 changes: 2 additions & 1 deletion src/app/admin/admin.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
MatCheckboxModule,
MatDividerModule,
MatPaginatorModule,
MatExpansionModule
MatExpansionModule, MatDatepickerModule
} from '@angular/material';
import { AppCommonModule } from 'common/common.module';
import { AdminRoutingModule } from './admin-routing.module';
Expand Down Expand Up @@ -52,6 +52,7 @@ import { ImpersonationService } from "../impersonation/impersonation.service";
MatPaginatorModule,
MatExpansionModule,
MatCheckboxModule,
MatDatepickerModule
],
providers: [
AdminGuard,
Expand Down
53 changes: 49 additions & 4 deletions src/app/admin/user-reports/user-reports.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,55 @@ <h1 class="user-reports__title">
</h1>

<div class="user-reports__container">
<app-chart-filter
(filter)="load($event)"
></app-chart-filter>

<div class="row align-center">
<label class="user-reports__label">
From
<input
(click)="dateFromPicker.open()"
class="user-reports__input"
[matDatepicker]="dateFromPicker"
[formControl]="from"
required
[max]="to.value || today"
data-test="chart-filter-custom-date-from"
>
<img
src="assets/images/calendar.svg"
alt="Add new icon"
class="user-reports__icon"
(click)="dateFromPicker.open()"
>
<mat-datepicker-toggle
matSuffix
[for]="dateFromPicker"
></mat-datepicker-toggle>
<mat-datepicker #dateFromPicker></mat-datepicker>
</label>
<label class="user-reports__label">
To
<input
class="user-reports__input"
(click)="dateToPicker.open()"
[matDatepicker]="dateToPicker"
[formControl]="to"
required
[min]="from.value"
[max]="today"
data-test="chart-filter-custom-date-to"
>
<img
src="assets/images/calendar.svg"
alt="Add new icon"
class="user-reports__icon user-reports__icon--last"
(click)="dateToPicker.open()"
>
</label>
<mat-datepicker-toggle
matSuffix
[for]="dateToPicker"
></mat-datepicker-toggle>
<mat-datepicker #dateToPicker></mat-datepicker>
</div>
<div class="user-reports__btns-wrapper">
<a class="user-reports__btn"
data-test="download-report-advertisers-button"
Expand Down
26 changes: 25 additions & 1 deletion src/app/admin/user-reports/user-reports.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@
}

&__btns-wrapper {
margin-top: -20px;
margin-top: 8px;
}

&__input {
@include input(130px);
margin-left: 8px;
padding: 8px;
height: 50px;
}

&__icon {
position: absolute;
top: 30%;
right: 17%;

&--last{
right: 29%;
}
}

&__label {
@include copy($font-size: 16);
position: relative;
width: 205px;
height: 52px;
}
}
26 changes: 16 additions & 10 deletions src/app/admin/user-reports/user-reports.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,47 @@ import { HandleSubscription } from 'common/handle-subscription';
import * as moment from 'moment';
import { AdminService } from 'admin/admin.service';
import { downloadCSVFile } from 'common/utilities/helpers';
import { FormControl } from "@angular/forms";

@Component({
selector: 'app-user-reports',
templateUrl: './user-reports.component.html',
styleUrls: ['./user-reports.component.scss'],
})
export class UserReportsComponent extends HandleSubscription implements OnInit {
from: string;
to: string;
from: FormControl = new FormControl();
to: FormControl = new FormControl();
today = new Date();

constructor(private adminService: AdminService) {
super();
}

ngOnInit() {
this.from = moment().subtract(30, 'days').startOf('day').format();
this.to = moment().endOf('day').format();
this.from.setValue(moment().subtract(30, 'days').startOf('day').format());
this.to.setValue(moment().endOf('day').format());
}

load(timespan) {
this.from = moment(timespan.from).startOf('day').format();
this.to = moment(timespan.to).endOf('day').format();
}



getReportAdvertisers() {
this.adminService.getReportAdvertisers(this.from, this.to)
const from = moment(this.from.value).format();
const to = moment(this.to.value).format();
this.adminService.getReportAdvertisers(from, to)
.subscribe((data) => {
downloadCSVFile(data, this.from, this.to);
downloadCSVFile(data, from, to);
});
}

getReportPublishers() {
this.adminService.getReportPublishers(this.from, this.to)
const from = moment(this.from.value).format();
const to = moment(this.to.value).format();
this.adminService.getReportPublishers(from, to)
.subscribe((data) => {
downloadCSVFile(data, this.from, this.to);
downloadCSVFile(data, from, to);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

@include media(xxxl-up) {
max-width: 200px;
max-width: 2000px;
}
}

Expand Down

0 comments on commit 6b00d3f

Please sign in to comment.