Skip to content

Commit 6d8ded9

Browse files
sluFicodesSHENGXING LU
andauthored
tier price button disabled if config profile is there (#218)
Co-authored-by: SHENGXING LU <slu@SHENGXINGs-MacBook-Air.local>
1 parent 860722c commit 6d8ded9

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/app/shared/forms/offer/price-plans/price-plan-drawer/price-plan-drawer.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ <h3 class="font-bold text-lg dark:text-white">
216216
data-cy="newTierPricing"
217217
type="button"
218218
(click)="openTierPricingDrawer()"
219-
[disabled]="!hasRangeCharacteristics()"
220-
[ngClass]="hasRangeCharacteristics() ? 'bg-green-500 hover:bg-green-600 cursor-pointer' : 'bg-gray-400 cursor-not-allowed opacity-50'"
219+
[disabled]="!hasRangeCharacteristics() || hasProfilePricePlan()"
220+
[ngClass]="hasRangeCharacteristics() && !hasProfilePricePlan() ? 'bg-green-500 hover:bg-green-600 cursor-pointer' : 'bg-gray-400 cursor-not-allowed opacity-50'"
221221
class="mt-2 px-4 py-2 text-white rounded flex items-center"
222-
[title]="!hasRangeCharacteristics() ? 'No range characteristics available in product specification' : 'Create tier pricing based on range characteristics'"
222+
[title]="hasProfilePricePlan() ? 'Tier pricing is not available when a configuration profile is set' : (!hasRangeCharacteristics() ? 'No range characteristics available in product specification' : 'Create tier pricing based on range characteristics')"
223223
>
224224
<svg class="min-w-4 w-4 h-4 mr-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
225225
<path fill="currentColor"

src/app/shared/forms/offer/price-plans/price-plan-drawer/price-plan-drawer.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,4 +423,9 @@ export class PricePlanDrawerComponent implements OnInit, OnDestroy {
423423
});
424424
}
425425

426+
hasProfilePricePlan(): boolean {
427+
const profileData = this.formGroup?.get('prodSpecCharValueUse')?.value;
428+
return profileData && profileData.length > 0;
429+
}
430+
426431
}

0 commit comments

Comments
 (0)