) {
- if (unit.target === '' && unit.state !== 'initial') {
- unit.state = 'initial';
- } else if (unit.target !== '' && unit.state === 'initial') {
+ if (unit.target !== '' && unit.state === 'initial') {
unit.state = 'translated';
}
diff --git a/src/app/target/translate/translate-datasource.ts b/src/app/target/translate/translate-datasource.ts
index d4b8b74..ac7e49e 100644
--- a/src/app/target/translate/translate-datasource.ts
+++ b/src/app/target/translate/translate-datasource.ts
@@ -43,7 +43,7 @@ export class TranslateDataSource extends TranslationDataSource<
const unit: FormTargetUnit = {
...u,
target: new UntypedFormControl(u.target),
- state: new UntypedFormControl({ value: u.state, disabled: !u.target }),
+ state: new UntypedFormControl(u.state),
};
this._translationTargetService.updateUnitOnChange(u, unit, this._destroy);
unit.target.markAsTouched();
diff --git a/src/app/target/translate/translate.component.html b/src/app/target/translate/translate.component.html
index 5db637c..dc908bb 100644
--- a/src/app/target/translate/translate.component.html
+++ b/src/app/target/translate/translate.component.html
@@ -42,9 +42,7 @@
- Initial
+ Initial
Translated
Reviewed
Final
@@ -132,7 +130,7 @@
'source-filter',
'target-filter',
'state-filter',
- 'action'
+ 'action',
];
sticky: true
"
diff --git a/src/app/target/translate/translate.component.ts b/src/app/target/translate/translate.component.ts
index dc465ca..f81e300 100644
--- a/src/app/target/translate/translate.component.ts
+++ b/src/app/target/translate/translate.component.ts
@@ -1,5 +1,5 @@
import { TextFieldModule } from '@angular/cdk/text-field';
-import { NgIf, AsyncPipe } from '@angular/common';
+import { AsyncPipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { UntypedFormBuilder, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
@@ -33,7 +33,6 @@ import { TranslateDataSource } from './translate-datasource';
TextFieldModule,
ReactiveFormsModule,
MatSelectModule,
- NgIf,
MatOptionModule,
MatButtonModule,
RouterLink,
diff --git a/src/app/target/unit/unit.component.html b/src/app/target/unit/unit.component.html
index 86312ce..14f5a4d 100644
--- a/src/app/target/unit/unit.component.html
+++ b/src/app/target/unit/unit.component.html
@@ -35,9 +35,7 @@ {{ (unit | async)?.id }}
State
- Initial
+ Initial
Translated
Reviewed
Final
diff --git a/src/app/target/unit/unit.component.ts b/src/app/target/unit/unit.component.ts
index 8aa3d82..3caf9ed 100644
--- a/src/app/target/unit/unit.component.ts
+++ b/src/app/target/unit/unit.component.ts
@@ -71,7 +71,7 @@ export class UnitComponent implements OnDestroy {
meaning: [{ value: unit.meaning || '-', disabled: true }],
source: [{ value: unit.source, disabled: true }],
target: unit.target,
- state: [{ value: unit.state, disabled: !unit.target }],
+ state: unit.state,
});
this._translationTargetService.updateUnitOnChange(
unit,
|