Merge pull request #4414 from MaximilianKrambach/smallFixes

marking and repairing translations
This commit is contained in:
Emanuel Schütze 2019-02-27 12:04:01 +01:00 committed by GitHub
commit f9ea181a93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 74 additions and 19 deletions

View File

@ -8,7 +8,7 @@
<mat-divider></mat-divider>
</div>
<mat-option *ngFor="let selectedItem of filteredItems | async" [value]="selectedItem.id">
{{ selectedItem.getTitle(translate) }}
{{ selectedItem.getTitle() | translate }}
</mat-option>
</mat-select>
</mat-form-field>

View File

@ -12,7 +12,7 @@ export class AssignmentSortListService extends BaseSortListService<ViewAssignmen
sortAscending: true,
options: [
{ property: 'assignment', label: 'Name' },
{ property: 'phase' },
{ property: 'phase', label: 'Phase' },
{ property: 'candidateAmount', label: 'Number of candidates' }
]
};

View File

@ -10,7 +10,17 @@ export class MediafilesSortListService extends BaseSortListService<ViewMediafile
public sortOptions: OsSortingDefinition<ViewMediafile> = {
sortProperty: 'title',
sortAscending: true,
options: [{ property: 'title' }, { property: 'type' }, { property: 'size' }]
options: [
{ property: 'title' },
{
property: 'type',
label: this.translate.instant('Type')
},
{
property: 'size',
label: this.translate.instant('Size')
}
]
};
protected name = 'Mediafile';
}

View File

@ -2,7 +2,7 @@
<!-- Title -->
<div class="title-slot">
<h2 *ngIf="workflow">
{{ workflow }}
{{ workflow.name | translate }}
</h2>
</div>
@ -19,7 +19,7 @@
<div class="title-line">
<strong>
<span translate>First state</span>:
<span>{{ workflow.firstState }}</span>
<span>{{ workflow.firstState.name | translate }}</span>
</strong>
</div>
@ -66,7 +66,7 @@
[disableRipple]="true"
[ngClass]="getStateCssColor(state[perm.selector])"
>
{{ state[perm.selector] }}
{{ state[perm.selector] | translate }}
</mat-basic-chip>
</div>
<div
@ -76,7 +76,19 @@
[matMenuTriggerData]="{ state: state }"
>
<div class="inner-table">
{{ state.next_states_id.length > 0 ? state.getNextStates(workflow.workflow) : '' }}
<div *ngIf="!state.next_states_id.length">
-
</div>
<div *ngIf="state.next_states_id.length">
<span
*ngFor="
let nextstate of state.getNextStates(workflow.workflow);
let last = last
"
>
{{ nextstate.name | translate }}<span *ngIf="!last">,&nbsp;</span>
</span>
</div>
</div>
</div>
<div

View File

@ -11,7 +11,7 @@
<span translate>Name</span>
</mat-header-cell>
<mat-cell *matCellDef="let workflow" (click)="onClickWorkflow(workflow)">
{{ workflow }}
{{ workflow.name | translate }}
</mat-cell>
</ng-container>

View File

@ -122,12 +122,19 @@ export class MotionImportService extends BaseImportService<ViewMotion> {
}
}
const updateModels = this.repo.getMotionDuplicates(newEntry);
return {
const entry: NewEntry<ViewMotion> = {
newEntry: newEntry,
duplicates: updateModels,
status: updateModels.length ? 'error' : 'new',
errors: updateModels.length ? ['Duplicates'] : []
};
if (!entry.newEntry.title) {
this.setError(entry, 'Title');
}
if (!entry.newEntry.text) {
this.setError(entry, 'Title');
}
return entry;
}
/**

View File

@ -53,7 +53,9 @@
<div class="groupsCell">
<span *ngIf="user.groups && user.groups.length">
<mat-icon>people</mat-icon>
{{ user.groups }}
<span *ngFor="let group of user.groups; let last = last"
>{{ group.getTitle() | translate }}<span *ngIf="!last">,&nbsp;</span>
</span>
</span>
<br *ngIf="user.groups && user.structureLevel" />
<span *ngIf="user.structureLevel">

View File

@ -6,6 +6,7 @@ import { User } from 'app/shared/models/users/user';
import { ViewUser } from '../models/view-user';
import { GroupRepositoryService } from 'app/core/repositories/users/group-repository.service';
import { UserRepositoryService } from 'app/core/repositories/users/user-repository.service';
import { TranslateService } from '@ngx-translate/core';
@Injectable({
providedIn: 'root'
@ -16,7 +17,7 @@ export class UserFilterListService extends BaseFilterListService<User, ViewUser>
private userGroupFilterOptions = {
isActive: false,
property: 'groups_id',
label: 'User Group',
label: 'Groups',
options: []
};
@ -29,21 +30,30 @@ export class UserFilterListService extends BaseFilterListService<User, ViewUser>
},
{
property: 'is_active',
label: 'Active',
label: this.translate.instant('Active'),
isActive: false,
options: [{ condition: true, label: 'Is active' }, { condition: false, label: 'Is not active' }]
options: [
{ condition: true, label: 'Is active' },
{ condition: false, label: this.translate.instant('Is not active') }
]
},
{
property: 'is_committee',
label: 'Committee',
label: this.translate.instant('Committee'),
isActive: false,
options: [{ condition: true, label: 'Is a committee' }, { condition: false, label: 'Is not a committee' }]
options: [
{ condition: true, label: 'Is a committee' },
{ condition: false, label: this.translate.instant('Is not a committee') }
]
},
{
property: 'is_last_email_send',
label: 'Last email send',
isActive: false,
options: [{ condition: true, label: 'Got an email' }, { condition: false, label: "Didn't get an email" }]
options: [
{ condition: true, label: this.translate.instant('Got an email') },
{ condition: false, label: this.translate.instant("Didn't get an email") }
]
}
];
@ -55,7 +65,21 @@ export class UserFilterListService extends BaseFilterListService<User, ViewUser>
return [this.userGroupFilterOptions].concat(this.staticFilterOptions);
}
public constructor(store: StorageService, private groupRepo: GroupRepositoryService, repo: UserRepositoryService) {
/**
* Contructor. Subscribes to incoming group definitions.
*
* @param store
* @param groupRepo
* @param repo
* @param translate marking some translations that are unique here
*
*/
public constructor(
store: StorageService,
private groupRepo: GroupRepositoryService,
repo: UserRepositoryService,
private translate: TranslateService
) {
super(store, repo);
this.subscribeGroups();
}

View File

@ -18,8 +18,8 @@ export class UserSortListService extends BaseSortListService<ViewUser> {
{ property: 'last_name', label: 'Surname' },
{ property: 'is_present', label: 'Presence' },
{ property: 'is_active', label: 'Is active' },
{ property: 'is_committee', label: 'Is Committee' },
{ property: 'number', label: 'Number' },
{ property: 'is_committee', label: 'Is committee' },
{ property: 'number', label: 'Participant number' },
{ property: 'structure_level', label: 'Structure level' },
{ property: 'comment' }
// TODO email send?