Skip to content

Commit f26db44

Browse files
sluFicodesSHENGXING LU
andauthored
new tags (#158)
Co-authored-by: SHENGXING LU <slu@SHENGXINGs-MacBook-Air.local>
1 parent f555782 commit f26db44

8 files changed

Lines changed: 50 additions & 50 deletions

File tree

src/app/pages/product-orders/sections/invoices-info/invoices-info.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ <h2 class="md:text-3xl lg:text-4xl font-bold text-primary-100 ml-4 dark:text-whi
164164
} @else {
165165
<div class="max-h-96 overflow-y-auto pr-2">
166166
@for (acbr of appliedCustomerBillingRates; track acbr.id) {
167-
<div class="mb-4 p-4 bg-gray-50 dark:bg-secondary-300 rounded-lg border border-gray-200 dark:border-gray-600">
167+
<div data-cy="acbr" class="mb-4 p-4 bg-gray-50 dark:bg-secondary-300 rounded-lg border border-gray-200 dark:border-gray-600">
168168
<div class="flex flex-col gap-2">
169169
<div class="flex flex-row gap-2">
170170
<p class="text-sm font-bold text-gray-700 dark:text-white">

src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html

Lines changed: 25 additions & 25 deletions
Large diffs are not rendered by default.

src/app/pages/usage-specs/usage-sections/usage-list/usage-list.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ <h2 class="text-2xl font-bold mb-4 dark:text-white">{{ 'USAGE_SPECS._list' | tra
77
</div>
88

99
<div class="flex flex-row w-full justify-end">
10-
<button type="button" (click)="goToCreate()" class="ml-2 mr-8 mb-4 text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center align-middle me-2">
10+
<button data-cy="createUsageSpec" type="button" (click)="goToCreate()" class="ml-2 mr-8 mb-4 text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center align-middle me-2">
1111
<p class="pl-2 pr-2">{{ 'USAGE_SPECS._add_new' | translate }}</p>
1212
<svg class="w-[18px] h-[18px] text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
1313
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14m-7 7V5"/>
1414
</svg>
15-
</button>
15+
</button>
1616
</div>
1717

1818
</div>
@@ -30,7 +30,7 @@ <h2 class="text-2xl font-bold mb-4 dark:text-white">{{ 'USAGE_SPECS._list' | tra
3030
} @else {
3131
<div class="bg-secondary-50 dark:bg-secondary-100 border dark:border-gray-800 mt-8 p-4 rounded-lg">
3232
<div class="relative overflow-x-auto shadow-md sm:rounded-lg w-full bg-white dark:bg-secondary-300">
33-
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-200">
33+
<table data-cy="usageSpecTable" class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-200">
3434
<thead class="text-xs text-gray-700 uppercase bg-gray-100 dark:bg-secondary-200 dark:text-white">
3535
<tr>
3636
<th scope="col" class="px-6 py-3">
@@ -46,18 +46,18 @@ <h2 class="text-2xl font-bold mb-4 dark:text-white">{{ 'USAGE_SPECS._list' | tra
4646
</thead>
4747
<tbody>
4848
@for (usage of usageSpecs; track usage.id) {
49-
<tr class="border-b hover:bg-gray-200 dark:bg-secondary-300 dark:border-gray-700 dark:hover:bg-secondary-200">
49+
<tr data-cy="usageSpecRow" class="border-b hover:bg-gray-200 dark:bg-secondary-300 dark:border-gray-700 dark:hover:bg-secondary-200">
5050
<td [ngClass]="{
5151
'break-all': hasLongWord(usage.name, 20),
5252
'break-words': !hasLongWord(usage.name, 20)
5353
}" class="px-6 py-4 text-wrap break-words">
5454
{{usage.name}}
5555
</td>
5656
<td class="hidden md:table-cell px-6 py-4">
57-
{{usage.description}}
57+
{{usage.description}}
5858
</td>
5959
<td class="px-6 py-4">
60-
<button type="button" (click)="goToUpdate(usage)" class="text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center me-2">
60+
<button data-cy="usageSpecEdit" type="button" (click)="goToUpdate(usage)" class="text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center me-2">
6161
<svg class="w-[18px] h-[18px] text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
6262
<path fill-rule="evenodd" d="M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z" clip-rule="evenodd"/>
6363
</svg>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
@if (nameControl) {
22
<label for="prod-name" class="font-bold text-lg dark:text-white">{{ 'USAGE_SPECS._name' | translate }}</label>
3-
<input id="prod-name" type="text" [formControl]="nameControl" maxLength="100"
3+
<input data-cy="usageSpecName" id="prod-name" type="text" [formControl]="nameControl" maxLength="100"
44
class="mb-2 bg-gray-50 dark:bg-secondary-300 border border-gray-300 dark:border-secondary-200 dark:text-white text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"/>
55
}
66
@if (descControl) {
77
<label class="font-bold text-lg col-span-2 dark:text-white">{{ 'USAGE_SPECS._description' | translate }}</label>
8-
<app-markdown-textarea [formControl]="descControl"></app-markdown-textarea>
8+
<app-markdown-textarea data-cy="usageSpecDescription" [formControl]="descControl"></app-markdown-textarea>
99
}
1010

src/app/shared/forms/usage-spec/usage-spec-metrics/usage-spec-metrics.component.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,33 +56,33 @@
5656
}
5757
@if(showCreateMetric==false){
5858
<div class="flex w-full justify-items-center justify-center">
59-
<button type="button" (click)="showCreateMetric=!showCreateMetric" class="flex text-white justify-center bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
59+
<button data-cy="btnNewMetric" type="button" (click)="showCreateMetric=!showCreateMetric" class="flex text-white justify-center bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
6060
{{ 'USAGE_SPECS._create_metric' | translate }}
6161
<svg class="rtl:rotate-180 w-3.5 h-3.5 ms-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
6262
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14m-7 7V5"/>
63-
</svg>
63+
</svg>
6464
</button>
6565
</div>
6666
} @else {
6767
<form class="m-4" [formGroup]="metricsForm">
6868
<div>
6969
<label for="prod-name" class="font-bold text-lg dark:text-white">{{ 'USAGE_SPECS._name' | translate }}</label>
70-
<input formControlName="name" type="text" id="prod-name" maxLength="100"
70+
<input data-cy="metricName" formControlName="name" type="text" id="prod-name" maxLength="100"
7171
class="mb-2 bg-gray-50 dark:bg-secondary-300 border border-gray-300 dark:border-secondary-200 dark:text-white text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5" />
72-
72+
7373
</div>
7474
<div>
7575
<label for="description" class="font-bold text-lg dark:text-white">{{ 'USAGE_SPECS._description' | translate }}</label>
76-
<textarea id="description" formControlName="description" rows="4"
76+
<textarea data-cy="metricDescription" id="description" formControlName="description" rows="4"
7777
class="mb-2 min-h-fit bg-gray-50 dark:bg-secondary-300 border border-gray-300 dark:border-secondary-200 dark:text-white text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"></textarea>
78-
</div>
78+
</div>
7979
</form>
8080
<div class="flex w-full justify-items-center justify-center mt-4">
81-
<button type="button" (click)="saveMetric()" [disabled]="!metricsForm.valid" [ngClass]="!metricsForm.valid ? 'opacity-50' : 'hover:bg-primary-50'" class="flex text-white justify-center bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
81+
<button data-cy="btnSaveMetric" type="button" (click)="saveMetric()" [disabled]="!metricsForm.valid" [ngClass]="!metricsForm.valid ? 'opacity-50' : 'hover:bg-primary-50'" class="flex text-white justify-center bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
8282
{{ 'USAGE_SPECS._save_metric' | translate }}
8383
<svg class="rtl:rotate-180 w-3.5 h-3.5 ms-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
8484
<path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M11 16h2m6.707-9.293-2.414-2.414A1 1 0 0 0 16.586 4H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V7.414a1 1 0 0 0-.293-.707ZM16 20v-6a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v6h8ZM9 4h6v3a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V4Z"/>
85-
</svg>
85+
</svg>
8686
</button>
8787
</div>
8888
}

src/app/shared/forms/usage-spec/usage-spec.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h3 class="block md:hidden mt-2 text-center text-2xl text-primary-100 dark:text-
6464

6565
<!-- Navigation Buttons -->
6666
<div class="flex justify-end mt-6 space-x-4">
67-
<button (click)="goToStep(currentStep - 1)"
67+
<button data-cy="usageSpecPrevious" (click)="goToStep(currentStep - 1)"
6868
[disabled]="currentStep === 0"
6969
[ngClass]="{
7070
'text-gray-500 dark:text-gray-400 hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-700 dark:hover:text-white': currentStep !== 0,
@@ -78,8 +78,8 @@ <h3 class="block md:hidden mt-2 text-center text-2xl text-primary-100 dark:text-
7878
</svg>
7979
{{ 'USAGE_SPECS._previous' | translate }}
8080
</button>
81-
82-
<button (click)="goToStep(currentStep + 1)"
81+
82+
<button data-cy="usageSpecNext" (click)="goToStep(currentStep + 1)"
8383
[disabled]="currentStep === steps.length - 1 || (formType === 'create' && !validateCurrentStep()) || !canNavigate(currentStep)"
8484
[ngClass]="{
8585
'hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-700 dark:hover:text-white': currentStep !== steps.length - 1 && (formType !== 'create' || validateCurrentStep() || canNavigate(currentStep)),
@@ -94,10 +94,10 @@ <h3 class="block md:hidden mt-2 text-center text-2xl text-primary-100 dark:text-
9494
</svg>
9595
</button>
9696
@if(formType === 'create' && currentStep === 2 || formType === 'update'){
97-
<button (click)="submitForm()"
97+
<button data-cy="btnCreateUsageSpec" (click)="submitForm()"
9898
[disabled]="!usageSpecForm.controls['generalInfo'].valid"
9999
[ngClass]="formType === 'update' && !usageSpecForm.controls['generalInfo'].valid ? 'opacity-50' : 'hover:bg-primary-50'"
100-
100+
101101
class="px-4 py-2 text-base font-medium text-white rounded-lg bg-primary-100">
102102
{{ formType === 'create' ? 'Create Usage Spec' : 'Update Usage Spec' }}
103103
</button>

src/app/shared/header/header.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
</a>
196196
</li>
197197
<li>
198-
<button id="usageSpecs" (click)="goTo('/usage-spec')" class="flex w-full justify-left px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"><fa-icon [icon]="faRuler" class="mr-2"></fa-icon>Usage Spec</button>
198+
<button data-cy="usageSpecs" id="usageSpecs" (click)="goTo('/usage-spec')" class="flex w-full justify-left px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"><fa-icon [icon]="faRuler" class="mr-2"></fa-icon>Usage Spec</button>
199199
</li>
200200
<li>
201201
<button id="myInventory" (click)="goTo('/product-inventory')"class="flex w-full justify-left px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"><fa-icon [icon]="faBoxesStacked" class="mr-2"></fa-icon>{{ 'HEADER._inventory' | translate }}</button>

src/app/shared/price-plan-drawer/price-plan-drawer.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<div class="rounded-lg border border-dashed border-primary-100 bg-white p-2 m-2 dark:bg-gray-800 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2 mb-4">
7575
@for (ch of filteredCharacteristics ; track ch.id; let i = $index) {
7676
@if(!ch.name?.endsWith('- enabled')){
77-
<div class="flex flex-row w-full items-start">
77+
<div data-cy="offerChar" class="flex flex-row w-full items-start">
7878
@if(canBeDisabledChars.includes(ch.id)){
7979
<label class="inline-flex items-center cursor-pointer w-fit justify-start items-start my-4 mr-2">
8080
<input type="checkbox" (change)="onToggleChange($event, ch.name)" class="sr-only peer">
@@ -101,7 +101,7 @@
101101
<p class="mt-4 text-sm text-gray-500 dark:text-gray-400">You can change the metric values to simulate final prices</p>
102102
<div class="grid grid-cols-4 gap-2 mb-4">
103103
@for (metric of metrics || []; track metric.unitOfMeasure) {
104-
<div class="flex flex-col">
104+
<div data-cy="offerMetric" class="flex flex-col">
105105
<h5 [ngClass]="{
106106
'break-all': hasLongWord(metric.unitOfMeasure, 20),
107107
'break-words': !hasLongWord(metric.unitOfMeasure, 20)

0 commit comments

Comments
 (0)