Skip to content

Commit

Permalink
Merge pull request #725 from adshares/develop
Browse files Browse the repository at this point in the history
v1.4.2
  • Loading branch information
m-pilarczyk authored Dec 5, 2019
2 parents f0ef492 + ea0ce0a commit 284d234
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 44 deletions.
8 changes: 7 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]

## [1.4.3] - 2019-12-05
### Removed
- Conversion definition budget

## [1.4.2] - 2019-11-26
### Fixed
- Banner size in internal classifier
Expand Down Expand Up @@ -153,7 +157,9 @@ 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/v1.4.2...develop

[Unreleased]: https://github.com/adshares/adpanel/compare/v1.4.3...develop
[1.4.3]: https://github.com/adshares/adpanel/compare/v1.4.2...v1.4.3
[1.4.2]: https://github.com/adshares/adpanel/compare/v1.4.1...v1.4.2
[1.4.1]: https://github.com/adshares/adpanel/compare/v1.4.0...v1.4.1
[1.4.0]: https://github.com/adshares/adpanel/compare/v1.2.5...v1.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
<app-label
class="col-xs-2 row justify-start align-center"
label="Value ({{ currencyCode }})"
tooltip="Enter the amount you are willing to spend on a single conversion"
tooltip="Enter the amount you are willing to spend on a single conversion.
Activate this option if you want to use various values provided dynamically - e.g. a percentage of the amount spent in an online store"
forId="value"
></app-label>
<div class="col-xs-1 row justify-start"></div>
Expand Down Expand Up @@ -159,12 +160,23 @@
row
align-center"
>
<input
id="value"
class="dwmth-form-input"
formControlName="value"
data-test="advertiser-conversion-item-value"
>
<div class="row no-wrap cell">
<mat-slide-toggle
class="row align-self-center"
id="isMutable"
formControlName="isValueMutable"
data-test="advertiser-conversion-item-is-value-mutable"
>
</mat-slide-toggle>
<input
id="value"
type="number"
step="0.01"
class="dwmth-form-input campaign-edit-conversion__value-input"
formControlName="value"
data-test="advertiser-conversion-item-value"
>
</div>
<span
class="error-msg"
*ngIf="validateForm && 'INVALID' === conversionItemForm.get('value').status && !conversionItemForm.get('isAdvanced').value"
Expand Down Expand Up @@ -283,7 +295,7 @@
dwmth-copy"
>
<app-label
class="col-xs-1 row justify-start"
class="col-xs-2 row justify-start"
forId="name"
label="Name"
tooltipPosition="after"
Expand All @@ -302,12 +314,6 @@
Activate this option if you want to use various values provided dynamically - e.g. a percentage of the amount spent in an online store"
forId="valueAdv"
></app-label>
<app-label
class="col-xs-1 row justify-start align-center"
label="Budget"
tooltip="Enter the total amount you are willing to spend on all conversions of this type."
forId="limit"
></app-label>
<app-label
class="col-xs-2 row justify-center cell align-center"
label="Within the&nbsp;budget"
Expand Down Expand Up @@ -342,7 +348,7 @@
>
<div
class="
col-xs-1
col-xs-2
row
align-center"
>
Expand Down Expand Up @@ -395,7 +401,7 @@
<div class="row no-wrap cell">
<mat-slide-toggle
class="row align-self-center"
id="isMutable"
id="isMutableAdv"
formControlName="isValueMutable"
data-test="advertiser-conversion-item-is-value-mutable"
>
Expand All @@ -416,21 +422,6 @@
Value is required.
</span>
</div>
<div
class="
col-xs-1
row
align-center"
>
<input
id="limit"
class="dwmth-form-input"
type="number"
step="0.01"
formControlName="limit"
data-test="advertiser-conversion-item-limit"
>
</div>
<div
class="
col-xs-2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class EditCampaignConversionComponent extends HandleSubscription implemen
readonly TYPE_ADVANCED: string = 'advanced';
readonly TYPE_BASIC: string = 'basic';

private readonly CONVERSION_COUNT_MAXIMAL: number = 5;
private readonly CONVERSION_COUNT_MAXIMAL: number = 100;
private readonly BUDGET_TYPE_IN: string = 'in_budget';
private readonly BUDGET_TYPE_OUT: string = 'out_of_budget';

Expand Down Expand Up @@ -185,21 +185,16 @@ export class EditCampaignConversionComponent extends HandleSubscription implemen
type: new FormControl({value: item.eventType, disabled: isItemFromBackend}, Validators.required),
isAdvanced: new FormControl({value: itemIsAdvanced, disabled: isItemFromBackend}),
isInBudget: new FormControl({value: item.isInBudget, disabled: isItemFromBackend || !itemIsAdvanced}),
isValueMutable: new FormControl({
value: item.isValueMutable || 0,
disabled: isItemFromBackend || !itemIsAdvanced
}),
isValueMutable: new FormControl({value: item.isValueMutable || 0, disabled: isItemFromBackend}),
isRepeatable: new FormControl({value: item.isRepeatable || 0, disabled: isItemFromBackend || !itemIsAdvanced}),
value: new FormControl({value: item.value, disabled: isItemFromBackend}, valueValidators),
limit: new FormControl({value: item.limit, disabled: isItemFromBackend}, Validators.min(0)),
link: new FormControl(item.link),
});
}

get conversionsToSave(): CampaignConversion[] {
return this.conversionItemForms.map((form) => {
const value = form.get('value').value;
const limit = form.get('limit').value;

return <CampaignConversion>{
uuid: form.get('uuid').value,
Expand All @@ -208,7 +203,6 @@ export class EditCampaignConversionComponent extends HandleSubscription implemen
eventType: form.get('type').value,
type: form.get('isAdvanced').value ? this.TYPE_ADVANCED : this.TYPE_BASIC,
value: value !== null ? adsToClicks(parseFloat(value)) : null,
limit: limit !== null ? adsToClicks(parseFloat(limit)) : null,
isValueMutable: form.get('isValueMutable').value,
isRepeatable: form.get('isRepeatable').value,
};
Expand All @@ -226,7 +220,6 @@ export class EditCampaignConversionComponent extends HandleSubscription implemen
isValueMutable: conversion.isValueMutable,
isRepeatable: conversion.isRepeatable,
value: conversion.value !== null ? formatMoney(conversion.value) : null,
limit: conversion.limit !== null ? formatMoney(conversion.limit) : null,
link: conversion.link,
};
this.addConversion(item);
Expand Down
2 changes: 0 additions & 2 deletions src/app/models/campaign.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ interface CampaignConversion {
eventType: string;
type: string;
value?: number;
limit?: number;
link?: string;
isValueMutable?: number;
isRepeatable?: number;
Expand All @@ -68,7 +67,6 @@ interface CampaignConversionItem {
isAdvanced: boolean;
isInBudget: boolean;
value?: string;
limit?: string;
link?: string;
isValueMutable?: boolean;
isRepeatable?: boolean;
Expand Down
1 change: 0 additions & 1 deletion src/app/models/initial-state/campaign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ export const campaignConversionItemInitialState: CampaignConversionItem = {
isAdvanced: false,
isInBudget: true,
value: null,
limit: null,
};

0 comments on commit 284d234

Please sign in to comment.