@if(canBeDisabledChars.includes(ch.id)){
}
diff --git a/src/app/shared/price-plan-drawer/price-plan-drawer.component.ts b/src/app/shared/price-plan-drawer/price-plan-drawer.component.ts
index dd56db30..d84290bd 100644
--- a/src/app/shared/price-plan-drawer/price-plan-drawer.component.ts
+++ b/src/app/shared/price-plan-drawer/price-plan-drawer.component.ts
@@ -230,14 +230,26 @@ export class PricePlanDrawerComponent implements OnInit, OnDestroy {
const defaultValue =
characteristic.productSpecCharacteristicValue?.find(val => val.isDefault)?.value ??
characteristic.productSpecCharacteristicValue?.find(val => val.isDefault)?.valueFrom;
-
+
characteristicsGroup.addControl(
characteristic.id,
this.fb.control(defaultValue ?? null, Validators.required)
);
if(!characteristic.name?.endsWith('- enabled') && this.filteredCharacteristics.some((char => char.name === characteristic.name+' - enabled'))){
this.canBeDisabledChars.push(characteristic.id)
- this.disabledCharacteristics.push(characteristic.id)
+
+ const enabledChar = this.filteredCharacteristics.find(char => char.name === characteristic.name+' - enabled');
+ const defaultEnabledValue = enabledChar?.productSpecCharacteristicValue?.find(val => val.isDefault);
+
+ if (!defaultEnabledValue) {
+ this.disabledCharacteristics.push(characteristic.id);
+ } else {
+ const valueStr = String(defaultEnabledValue.value).toLowerCase();
+ if (valueStr === 'false') {
+ this.disabledCharacteristics.push(characteristic.id);
+ }
+ }
+ // If the default value is true, start enabled
}
}
});
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index 8e6ae113..67389307 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -517,6 +517,10 @@
"_from": "From",
"_to": "To",
"_save_char": "Save characteristic",
+ "_make_optional": "Make this characteristic optional",
+ "_default_value": "Default value",
+ "_default_false": "Disabled by default",
+ "_default_true": "Enabled by default",
"_resource_specs": "Resource specifications",
"_service_specs": "Service specifications",
"_add_prod_img": "Add product image",
@@ -592,6 +596,10 @@
"_from": "From",
"_to": "To",
"_save_char": "Save characteristic",
+ "_make_optional": "Make this characteristic optional",
+ "_default_value": "Default value",
+ "_default_false": "Disabled by default",
+ "_default_true": "Enabled by default",
"_resource_specs": "Resource specifications",
"_service_specs": "Service specifications",
"_add_prod_img": "Add product image",
@@ -785,6 +793,7 @@
"_from": "From",
"_to": "To",
"_save_char": "Save characteristic",
+ "_make_optional": "Make this characteristic optional",
"_resource_specs": "Resource specifications",
"_service_specs": "Service specifications",
"_add_prod_img": "Add product image",
@@ -886,6 +895,7 @@
"_from": "From",
"_to": "To",
"_save_char": "Save characteristic",
+ "_make_optional": "Make this characteristic optional",
"_resource_specs": "Resource specifications",
"_service_specs": "Service specifications",
"_add_prod_img": "Add product image",
diff --git a/src/assets/i18n/es.json b/src/assets/i18n/es.json
index 8e6ae113..5782d397 100644
--- a/src/assets/i18n/es.json
+++ b/src/assets/i18n/es.json
@@ -517,6 +517,10 @@
"_from": "From",
"_to": "To",
"_save_char": "Save characteristic",
+ "_make_optional": "Make this characteristic optional",
+ "_default_value": "Default value",
+ "_default_false": "Disabled by default",
+ "_default_true": "Enabled by default",
"_resource_specs": "Resource specifications",
"_service_specs": "Service specifications",
"_add_prod_img": "Add product image",
@@ -592,6 +596,10 @@
"_from": "From",
"_to": "To",
"_save_char": "Save characteristic",
+ "_make_optional": "Make this characteristic optional",
+ "_default_value": "Default value",
+ "_default_false": "Disabled by default",
+ "_default_true": "Enabled by default",
"_resource_specs": "Resource specifications",
"_service_specs": "Service specifications",
"_add_prod_img": "Add product image",