Settings page translations complete
This commit is contained in:
parent
65ed1c8d08
commit
5ce10e2839
@ -114,8 +114,7 @@ class Boards extends BaseController {
|
||||
|
||||
$update = R::load('board', (int)$args['id']);
|
||||
$update->id = BeanLoader::LoadBoard($update, $request->getBody())
|
||||
? $board->id
|
||||
: 0;
|
||||
? $board->id : 0;
|
||||
|
||||
if ($update->id === 0 || ($board->id !== $update->id)) {
|
||||
$this->logger->addError('Update Board: ', [$board, $update]);
|
||||
|
@ -1,8 +1,8 @@
|
||||
<section>
|
||||
<h2>{{ strings['automaticActions'] }}</h2>
|
||||
<h2>{{ strings['settings_automaticActions'] }}</h2>
|
||||
|
||||
<div class="row">
|
||||
<h3>Current Actions</h3>
|
||||
<h3>{{ strings['settings_currentAction'] }}</h3>
|
||||
|
||||
<table class="alternating no-bottom-margin">
|
||||
<thead>
|
||||
@ -46,14 +46,14 @@
|
||||
</div>
|
||||
|
||||
<div class="row" *ngIf="activeUser && activeUser.security_level < 3">
|
||||
<h3>Add Action</h3>
|
||||
<h3>{{ strings['settings_addAction'] }}</h3>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="borderless">
|
||||
<th>Select Board:</th>
|
||||
<th>Select Trigger:</th>
|
||||
<th>Select Action:</th>
|
||||
<th>{{ strings['settings_selectBoard'] }}:</th>
|
||||
<th>{{ strings['settings_selectTrigger'] }}:</th>
|
||||
<th>{{ strings['settings_selectAction'] }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -61,7 +61,9 @@
|
||||
<td>
|
||||
<select [(ngModel)]="newAction.board_id"
|
||||
(change)="updateTriggerSources()">
|
||||
<option [ngValue]="null">Select Board...</option>
|
||||
<option [ngValue]="null">
|
||||
{{ strings['settings_selectBoard'] }}...
|
||||
</option>
|
||||
<option *ngFor="let board of boards"
|
||||
[ngValue]="board.id">
|
||||
{{ board.name }}
|
||||
@ -119,7 +121,7 @@
|
||||
[disabled]="isAddDisabled"
|
||||
(click)="addNewAction()">
|
||||
<i class="icon icon-plus"></i>
|
||||
Add Action
|
||||
{{ strings['settings_addAction'] }}
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -58,23 +58,7 @@ export class AutoActions {
|
||||
this.boards = [];
|
||||
this.autoActions = [];
|
||||
this.MODAL_CONFIRM_ID = 'action-remove-confirm';
|
||||
|
||||
this.triggers = [
|
||||
[ ActionTrigger.MovedToColumn, 'Item moved to column' ],
|
||||
[ ActionTrigger.AssignedToUser, 'Item assigned to user' ],
|
||||
[ ActionTrigger.AddedToCategory, 'Item added to category' ],
|
||||
[ ActionTrigger.PointsChanged, 'Item points change' ]
|
||||
];
|
||||
this.updateTriggerSources();
|
||||
this.typesList = [
|
||||
[ ActionType.SetColor, 'Set item color'],
|
||||
[ ActionType.SetCategory, 'Set item category' ],
|
||||
[ ActionType.AddCategory, 'Add item category' ],
|
||||
[ ActionType.SetAssignee, 'Set item assignee' ],
|
||||
[ ActionType.AddAssignee, 'Add item assignee' ],
|
||||
[ ActionType.ClearDueDate, 'Clear item due date' ]
|
||||
];
|
||||
this.types = this.typesList;
|
||||
this.strings = {};
|
||||
|
||||
auth.userChanged
|
||||
.subscribe(activeUser => {
|
||||
@ -114,6 +98,54 @@ export class AutoActions {
|
||||
|
||||
stringsService.stringsChanged.subscribe(newStrings => {
|
||||
this.strings = newStrings;
|
||||
|
||||
this.triggers = [
|
||||
[
|
||||
ActionTrigger.MovedToColumn,
|
||||
this.strings.settings_triggerMoveToColumn
|
||||
],
|
||||
[
|
||||
ActionTrigger.AssignedToUser,
|
||||
this.strings.settings_triggerAssignedToUser
|
||||
],
|
||||
[
|
||||
ActionTrigger.AddedToCategory,
|
||||
this.strings.settings_triggerAddedToCategory
|
||||
],
|
||||
[
|
||||
ActionTrigger.PointsChanged,
|
||||
this.strings.settings_triggerPointsChanged
|
||||
]
|
||||
];
|
||||
this.typesList = [
|
||||
[
|
||||
ActionType.SetColor,
|
||||
this.strings.settings_actionSetColor
|
||||
],
|
||||
[
|
||||
ActionType.SetCategory,
|
||||
this.strings.settings_actionSetCategory
|
||||
],
|
||||
[
|
||||
ActionType.AddCategory,
|
||||
this.strings.settings_actionAddCategory
|
||||
],
|
||||
[
|
||||
ActionType.SetAssignee,
|
||||
this.strings.settings_actionSetAssignee
|
||||
],
|
||||
[
|
||||
ActionType.AddAssignee,
|
||||
this.strings.settings_actionAddAssignee
|
||||
],
|
||||
[
|
||||
ActionType.ClearDueDate,
|
||||
this.strings.settings_actionClearDueDate
|
||||
]
|
||||
];
|
||||
this.types = this.typesList;
|
||||
this.updateTriggerSources();
|
||||
this.updateActionSources();
|
||||
});
|
||||
}
|
||||
|
||||
@ -148,9 +180,10 @@ export class AutoActions {
|
||||
break;
|
||||
case ActionTrigger.PointsChanged:
|
||||
// Leave triggerSources empty
|
||||
this.types = [
|
||||
[ ActionType.AlterColorByPoints, 'Alter color by points' ]
|
||||
];
|
||||
this.types = [ [
|
||||
ActionType.AlterColorByPoints,
|
||||
this.strings.settings_alterByPoints
|
||||
] ];
|
||||
break;
|
||||
}
|
||||
|
||||
@ -304,7 +337,8 @@ export class AutoActions {
|
||||
name: string,
|
||||
arrayName: string,
|
||||
prop: string = 'name'): void {
|
||||
this[sourceArray] = [ [ null, 'Select ' + name ] ];
|
||||
this[sourceArray] =
|
||||
[ [ null, this.strings['settings_select' + name ] ] ]; // tslint:disable-line
|
||||
|
||||
for (let i = 0; i < this.boards.length; ++i) {
|
||||
if (this.boards[i].id !== this.newAction.board_id) {
|
||||
|
@ -92,6 +92,7 @@
|
||||
"settings_saveBoard": "Save Board",
|
||||
|
||||
"settings_automaticActions": "Automatic Actions",
|
||||
"settings_currentAction": "Current Actions",
|
||||
"settings_board": "Board",
|
||||
"settings_trigger": "Trigger",
|
||||
"settings_action": "Action",
|
||||
@ -108,6 +109,15 @@
|
||||
"settings_actionSetAssignee": "Set task assignee:",
|
||||
"settings_actionAddAssignee": "Add task assignee:",
|
||||
"settings_actionClearDueDate": "Clear task due date.",
|
||||
"settings_actionAlterColor": "Alter task color by points."
|
||||
"settings_actionAlterColor": "Alter task color by points.",
|
||||
"settings_addAction": "Add Action",
|
||||
"settings_selectBoard": "Select Board",
|
||||
"settings_selectTrigger": "Select Trigger",
|
||||
"settings_selectAction": "Select Action",
|
||||
"settings_selectColumn": "Select Column",
|
||||
"settings_selectUser": "Select User",
|
||||
"settings_selectCategory": "Select Category",
|
||||
"settings_selectAssignee": "Select Assignee",
|
||||
"settings_alterByPoints": "Alter color by points",
|
||||
}
|
||||
|
||||
|
@ -92,6 +92,7 @@
|
||||
"settings_saveBoard": "Guardar Tablero",
|
||||
|
||||
"settings_automaticActions": "Acciones Automáticas",
|
||||
"settings_currentAction": "Acción Actual",
|
||||
"settings_board": "Tablero",
|
||||
"settings_trigger": "Disparador",
|
||||
"settings_action": "Acción",
|
||||
@ -108,6 +109,15 @@
|
||||
"settings_actionSetAssignee": "Establecer asignador de tareas:",
|
||||
"settings_actionAddAssignee": "Agregar asignador de tareas:",
|
||||
"settings_actionClearDueDate": "Borra la fecha de vencimiento de la tarea.",
|
||||
"settings_actionAlterColor": "Cambiar el color de la tarea por puntos."
|
||||
"settings_actionAlterColor": "Cambiar el color de la tarea por puntos.",
|
||||
"settings_addAction": "Agregar Acción",
|
||||
"settings_selectBoard": "Seleccionar el Tablero",
|
||||
"settings_selectTrigger": "Seleccionar Disparador",
|
||||
"settings_selectAction": "Seleccionar la Acción",
|
||||
"settings_selectColumn": "Seleccionar Columna",
|
||||
"settings_selectUser": "Seleccionar Usuario",
|
||||
"settings_selectCategory": "Seleccionar Categoría",
|
||||
"settings_selectAssignee": "Seleccionar Cesionario",
|
||||
"settings_alterByPoints": "Alterar color por puntos"
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* global expect AuthServiceMock SettingsServiceMock ModalServiceMock
|
||||
NotificationsServiceMock AutoActionsServiceMock SanitizerMock */
|
||||
NotificationsServiceMock AutoActionsServiceMock StringsServiceMock SanitizerMock */
|
||||
var dirs = '../../../../',
|
||||
path = dirs + 'build/settings/auto-actions/',
|
||||
AutoActions = require(path + 'auto-actions.component.js').AutoActions;
|
||||
@ -13,7 +13,7 @@ describe('AutoActions', () => {
|
||||
|
||||
autoActions = new AutoActions(AuthServiceMock, modalService,
|
||||
new SettingsServiceMock(), new AutoActionsServiceMock(),
|
||||
new NotificationsServiceMock(), SanitizerMock);
|
||||
new NotificationsServiceMock(), StringsServiceMock, SanitizerMock);
|
||||
});
|
||||
|
||||
it('has a function to add an action', done => {
|
||||
@ -88,24 +88,24 @@ describe('AutoActions', () => {
|
||||
};
|
||||
|
||||
var desc = autoActions.getTriggerDescription(action);
|
||||
expect(desc).to.equal('Item moves to column: Column 1');
|
||||
expect(desc).to.equal('undefined Column 1');
|
||||
|
||||
action.trigger = 2;
|
||||
action.source_id = 2;
|
||||
|
||||
desc = autoActions.getTriggerDescription(action);
|
||||
expect(desc).to.equal('Item assigned to user: test');
|
||||
expect(desc).to.equal('undefined test');
|
||||
|
||||
action.trigger = 3;
|
||||
action.source_id = 1;
|
||||
|
||||
desc = autoActions.getTriggerDescription(action);
|
||||
expect(desc).to.equal('Item added to category: Category 1');
|
||||
expect(desc).to.equal('undefined Category 1');
|
||||
|
||||
action.trigger = 4;
|
||||
|
||||
desc = autoActions.getTriggerDescription(action);
|
||||
expect(desc).to.equal('Item points changed.');
|
||||
expect(desc + '').to.equal('undefined');
|
||||
});
|
||||
|
||||
it('provides a description for an action type', () => {
|
||||
@ -119,41 +119,41 @@ describe('AutoActions', () => {
|
||||
};
|
||||
|
||||
var desc = autoActions.getTypeDescription(action);
|
||||
expect(desc).to.equal('Set item color: <span style="color: #fff;">#fff</span>');
|
||||
expect(desc).to.equal('undefined <span style="background-color: #fff;">#fff</span>');
|
||||
|
||||
action.type = 2;
|
||||
action.change_to = 1;
|
||||
desc = autoActions.getTypeDescription(action);
|
||||
|
||||
expect(desc).to.equal('Set item category: Category 1');
|
||||
expect(desc).to.equal('undefined Category 1');
|
||||
|
||||
action.type = 3;
|
||||
action.change_to = 1;
|
||||
desc = autoActions.getTypeDescription(action);
|
||||
|
||||
expect(desc).to.equal('Add item category: Category 1');
|
||||
expect(desc).to.equal('undefined Category 1');
|
||||
|
||||
action.type = 4;
|
||||
action.change_to = 2;
|
||||
desc = autoActions.getTypeDescription(action);
|
||||
|
||||
expect(desc).to.equal('Set item assignee: test');
|
||||
expect(desc).to.equal('undefined test');
|
||||
|
||||
action.type = 5;
|
||||
action.change_to = 2;
|
||||
desc = autoActions.getTypeDescription(action);
|
||||
|
||||
expect(desc).to.equal('Add item assignee: test');
|
||||
expect(desc).to.equal('undefined test');
|
||||
|
||||
action.type = 6;
|
||||
desc = autoActions.getTypeDescription(action);
|
||||
|
||||
expect(desc).to.equal('Clear item due date.');
|
||||
expect(desc + '').to.equal('undefined');
|
||||
|
||||
action.type = 7;
|
||||
desc = autoActions.getTypeDescription(action);
|
||||
|
||||
expect(desc).to.equal('Alter item color by points.');
|
||||
expect(desc + '').to.equal('undefined');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": false,
|
||||
|
Reference in New Issue
Block a user