Skip to content

Commit

Permalink
feat(i18n): add translation evaluation sheet #33
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Jul 17, 2019
1 parent 6b80062 commit da7b62c
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 33 deletions.
@@ -1,14 +1,10 @@
<div class="wrapper mat-elevation-z2">
<help-section>
<p>Time for a little self evaluation! Your answers here are saved and provide you with a little bit of statistics on
how you work in the <a routerLink="/metrics">metrics section</a>. Furthermore the suggestions for tomorrow will
appear above your task list the next day.</p>
<p>{{T.F.METRIC.EVAL_FORM.HELP_P1|translate}}</p>
<p><a routerLink="/metrics">{{T.F.METRIC.EVAL_FORM.HELP_LINK_TXT|translate}}</a></p>

<h3 class="mat-h3">Why should I care?</h3>
<p>This is intended to be less about calculating exact metrics or becoming machine like efficient in all you do than
it is about improving how you feel about your work. It can be helpful to evaluate pain points in your daily
routine, as well as it is to find factors that help you out. Being just a little bit systematic about it hopefully
helps to get a better grip on these and to improve what you can.</p>
<h3 class="mat-h3">{{T.F.METRIC.EVAL_FORM.HELP_H1|translate}}</h3>
<p>{{T.F.METRIC.EVAL_FORM.HELP_P2|translate}}</p>
</help-section>

<form #f="ngForm"
Expand All @@ -23,12 +19,12 @@ <h3 class="mat-h3">Why should I care?</h3>
maxLength="2"
min="1"
name="mood"
placeholder="How do you feel?"
[placeholder]="T.F.METRIC.EVAL_FORM.MOOD|translate"
required
type="number">
<mat-hint>1: Awful – 10: Splendid</mat-hint>
<mat-hint>{{T.F.METRIC.EVAL_FORM.MOOD_HINT|translate}}</mat-hint>
<mat-error *ngIf="mood.invalid && (mood.dirty || mood.touched)">
Please enter a value between 1 and 10
{{T.V.E_1TO10|translate}}
</mat-error>
</mat-form-field>

Expand All @@ -40,12 +36,12 @@ <h3 class="mat-h3">Why should I care?</h3>
maxLength="2"
min="1"
name="productivity"
placeholder="How efficient did you work?"
[placeholder]="T.F.METRIC.EVAL_FORM.PRODUCTIVITY|translate"
required
type="number">
<mat-hint>1: Haven't even started – 10: Enormously efficient</mat-hint>
<mat-hint>{{T.F.METRIC.EVAL_FORM.PRODUCTIVITY_HINT|translate}}</mat-hint>
<mat-error *ngIf="productivity.invalid && (productivity.dirty || productivity.touched)">
Please enter a value between 1 and 10
{{T.V.E_1TO10|translate}}
</mat-error>
</mat-form-field>

Expand All @@ -54,28 +50,27 @@ <h3 class="mat-h3">Why should I care?</h3>
(removeItem)="removeObstruction($event)"
[model]="metricForDay.obstructions"
[suggestions]="(obstructionService.obstructions$|async)"
label="What hindered your productivity?"></chip-list-input>
[label]="T.F.METRIC.EVAL_FORM.OBSTRUCTIONS|translate"></chip-list-input>

<chip-list-input (addItem)="addImprovement($event)"
(addNewItem)="addNewImprovement($event)"
(removeItem)="removeImprovement($event)"
[model]="metricForDay.improvements"
[suggestions]="(improvementService.improvements$|async)"
label="What improved your productivity?"></chip-list-input>
[label]="T.F.METRIC.EVAL_FORM.IMPROVEMENTS|translate"></chip-list-input>


<chip-list-input (addItem)="addImprovementTomorrow($event)"
(addNewItem)="addNewImprovementTomorrow($event)"
(removeItem)="removeImprovementTomorrow($event)"
[model]="metricForDay.improvementsTomorrow"
[suggestions]="(improvementService.improvements$|async)"
label="What could you do to improve tomorrow?"></chip-list-input>
[label]="T.F.METRIC.EVAL_FORM.IMPROVEMENTS_TOMORROW|translate"></chip-list-input>
<mat-form-field>
<textarea #notes="ngModel"
[(ngModel)]="tomorrowsNote"
<textarea [(ngModel)]="tomorrowsNote"
matInput
name="notes"
placeholder="Notes for tomorrow"></textarea>
[placeholder]="T.F.METRIC.EVAL_FORM.NOTES|translate"></textarea>
</mat-form-field>

<div style="text-align: right;">
Expand All @@ -84,7 +79,7 @@ <h3 class="mat-h3">Why should I care?</h3>
mat-stroked-button
type="submit">
<mat-icon>save</mat-icon>
Save
{{T.G.SAVE|translate}}
</button>
</div>
</form>
Expand Down
Expand Up @@ -18,6 +18,7 @@ import {NoteService} from '../../note/note.service';
import {getWorklogStr} from '../../../util/get-work-log-str';
import {filter, map, switchMap, withLatestFrom} from 'rxjs/operators';
import {ProjectService} from '../../project/project.service';
import {T} from '../../../t.const';

@Component({
selector: 'evaluation-sheet',
Expand All @@ -32,6 +33,7 @@ export class EvaluationSheetComponent implements OnDestroy, OnInit {

@Output() save = new EventEmitter<any>();

T = T;
tomorrowsNote: string;
metricForDay: MetricCopy;

Expand Down
Expand Up @@ -9,8 +9,6 @@ import {ImprovementService} from '../improvement/improvement.service';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ImprovementBannerComponent {


constructor(
public improvementService: ImprovementService,
) {
Expand Down
21 changes: 12 additions & 9 deletions src/app/features/metric/metric.component.ts
Expand Up @@ -5,6 +5,7 @@ import {Color} from 'ng2-charts';
import {Observable} from 'rxjs';
import {LineChartData} from './metric.model';
import {fadeAnimation} from '../../ui/animations/fade.ani';
import {T} from '../../t.const';

@Component({
selector: 'metric',
Expand All @@ -14,24 +15,26 @@ import {fadeAnimation} from '../../ui/animations/fade.ani';
animations: [fadeAnimation],
})
export class MetricComponent {
public productivityHappiness$: Observable<LineChartData> = this.metricService.getProductivityHappinessChartData$();
T = T;

public pieChartOptions: ChartOptions = {
productivityHappiness$: Observable<LineChartData> = this.metricService.getProductivityHappinessChartData$();

pieChartOptions: ChartOptions = {
responsive: true,
legend: {
position: 'top',
},
};
public pieChartType: ChartType = 'pie';
public pieChartPlugins = [];
pieChartType: ChartType = 'pie';
pieChartPlugins = [];

public lineChartOptions: ChartOptions = {
lineChartOptions: ChartOptions = {
responsive: true,
};
public lineChartColors: Color[] = [];
public lineChartLegend = true;
public lineChartType: ChartType = 'line';
public lineChartPlugins = [];
lineChartColors: Color[] = [];
lineChartLegend = true;
lineChartType: ChartType = 'line';
lineChartPlugins = [];

constructor(
public metricService: MetricService,
Expand Down
3 changes: 2 additions & 1 deletion src/app/features/metric/store/metric.effects.ts
Expand Up @@ -7,6 +7,7 @@ import {selectCurrentProjectId} from '../../project/store/project.reducer';
import {PersistenceService} from '../../../core/persistence/persistence.service';
import {selectMetricFeatureState} from './metric.selectors';
import {SnackOpen} from '../../../core/snack/store/snack.actions';
import {T} from '../../../t.const';

@Injectable()
export class MetricEffects {
Expand Down Expand Up @@ -35,7 +36,7 @@ export class MetricEffects {
),
mapTo(new SnackOpen({
type: 'SUCCESS',
msg: 'Metric successfully saved'
msg: T.F.METRIC.SNACK.SAVE_METRIC
})),
);

Expand Down
22 changes: 22 additions & 0 deletions src/app/t.const.ts
Expand Up @@ -7,6 +7,25 @@ export const T = {
'TITLE': 'BL.TITLE'
},
'F': {
'METRIC': {
'EVAL_FORM': {
'HELP_P1': 'F.METRIC.EVAL_FORM.HELP_P1',
'HELP_LINK_TXT': 'F.METRIC.EVAL_FORM.HELP_LINK_TXT',
'HELP_H1': 'F.METRIC.EVAL_FORM.HELP_H1',
'HELP_P2': 'F.METRIC.EVAL_FORM.HELP_P2',
'MOOD': 'F.METRIC.EVAL_FORM.MOOD',
'MOOD_HINT': 'F.METRIC.EVAL_FORM.MOOD_HINT',
'PRODUCTIVITY': 'F.METRIC.EVAL_FORM.PRODUCTIVITY',
'PRODUCTIVITY_HINT': 'F.METRIC.EVAL_FORM.PRODUCTIVITY_HINT',
'OBSTRUCTIONS': 'F.METRIC.EVAL_FORM.OBSTRUCTIONS',
'IMPROVEMENTS': 'F.METRIC.EVAL_FORM.IMPROVEMENTS',
'IMPROVEMENTS_TOMORROW': 'F.METRIC.EVAL_FORM.IMPROVEMENTS_TOMORROW',
'NOTES': 'F.METRIC.EVAL_FORM.NOTES'
},
'SNACK': {
'SAVE_METRIC': 'F.METRIC.SNACK.SAVE_METRIC'
}
},
'ATTACHMENT': {
'DIALOG_EDIT': {
'ADD_ATTACHMENT': 'F.ATTACHMENT.DIALOG_EDIT.ADD_ATTACHMENT',
Expand Down Expand Up @@ -479,6 +498,9 @@ export const T = {
'SUCCESS': 'S.SYNC.SUCCESS'
}
},
'V': {
'E_1TO10': 'V.E_1TO10'
},
'WW': {
'ADD_MORE': 'WW.ADD_MORE',
'ADD_SOME_TASKS': 'WW.ADD_SOME_TASKS',
Expand Down
22 changes: 22 additions & 0 deletions src/assets/i18n/en.json
Expand Up @@ -7,6 +7,25 @@
"TITLE": "Backlog"
},
"F": {
"METRIC": {
"EVAL_FORM": {
"HELP_P1": "Time for a little self evaluation! Your answers here are saved and provide you with a little bit of statistics on how you work in the metrics section. Furthermore the suggestions for tomorrow will appear above your task list the next day.",
"HELP_LINK_TXT": "Go to metrics section",
"HELP_H1": "Why should I care?",
"HELP_P2": "This is intended to be less about calculating exact metrics or becoming machine like efficient in all you do than it is about improving how you feel about your work. It can be helpful to evaluate pain points in your daily routine, as well as it is to find factors that help you out. Being just a little bit systematic about it hopefully helps to get a better grip on these and to improve what you can.",
"MOOD": "How do you feel?",
"MOOD_HINT": "1: Awful – 10: Splendid",
"PRODUCTIVITY": "How efficient did you work?",
"PRODUCTIVITY_HINT": "1: Haven't even started – 10: Enormously efficient",
"OBSTRUCTIONS": "What hindered your productivity?",
"IMPROVEMENTS": "What improved your productivity?",
"IMPROVEMENTS_TOMORROW": "What could you do to improve tomorrow?",
"NOTES": "Notes for tomorrow"
},
"SNACK": {
"SAVE_METRIC": "Metric successfully saved"
}
},
"ATTACHMENT": {
"DIALOG_EDIT": {
"ADD_ATTACHMENT": "Add Attachment",
Expand Down Expand Up @@ -480,6 +499,9 @@
"SUCCESS": "Data imported"
}
},
"V": {
"E_1TO10": "Please enter a value between 1 and 10"
},
"WW": {
"ADD_MORE": "Add more",
"ADD_SOME_TASKS": "Add some tasks to plan your day!",
Expand Down

0 comments on commit da7b62c

Please sign in to comment.