Commit 672a4003 authored by Florian Azizian's avatar Florian Azizian

Merge branch 'develop' into 'master'

Develop

See merge request maarch/MaarchCourrier!172
parents 92e0afde 74c3357b
......@@ -448,11 +448,11 @@
<id>admin_custom_fields</id>
<name>_ADMIN_CUSTOM_FIELDS</name>
<comment>_ADMIN_CUSTOM_FIELDS</comment>
<servicepage>/administration/custom_fields</servicepage>
<servicepage>/administration/customFields</servicepage>
<servicetype>admin</servicetype>
<category>organisation</category>
<system_service>false</system_service>
<style>fa fa-user</style>
<style>fas fa-code</style>
<enabled>true</enabled>
<angular>true</angular>
</SERVICE>
......
......@@ -37,7 +37,7 @@
"devDependencies": {
"@angular-devkit/build-angular": "^0.803.0",
"@angular/animations": "^8.2.3",
"@angular/cdk": "^8.1.4",
"@angular/cdk": "^8.2.0",
"@angular/cli": "^8.3.0",
"@angular/common": "^8.2.3",
"@angular/compiler": "^8.2.3",
......@@ -45,7 +45,7 @@
"@angular/core": "^8.2.3",
"@angular/forms": "^8.2.3",
"@angular/http": "^7.2.15",
"@angular/material": "^8.1.4",
"@angular/material": "^8.2.0",
"@angular/platform-browser": "^8.2.3",
"@angular/platform-browser-dynamic": "^8.2.3",
"@angular/platform-server": "^8.2.3",
......
......@@ -128,9 +128,10 @@ $app->get('/contactsFilling', \Contact\controllers\ContactController::class . ':
$app->put('/contactsFilling', \Contact\controllers\ContactController::class . ':updateFilling');
//CustomFields
$app->get('/customFields', \CustomField\controllers\CustomFieldController::class . ':get');
$app->post('/customFields', \CustomField\controllers\CustomFieldController::class . ':create');
$app->put('/customFields/{id}', \CustomField\controllers\CustomFieldController::class . ':update');
$app->delete('/customFields/{id}', \Contact\controllers\ContactController::class . ':delete');
$app->delete('/customFields/{id}', \CustomField\controllers\CustomFieldController::class . ':delete');
//Docservers
$app->get('/docservers', \Docserver\controllers\DocserverController::class . ':get');
......@@ -192,7 +193,7 @@ $app->delete('/folders/{id}', \Folder\controllers\FolderController::class . ':de
$app->get('/folders/{id}/resources', \Folder\controllers\FolderController::class . ':getResourcesById');
$app->post('/folders/{id}/resources', \Folder\controllers\FolderController::class . ':addResourcesById');
$app->delete('/folders/{id}/resources', \Folder\controllers\FolderController::class . ':removeResourcesById');
$app->get('/folders/{id}/resources/{resId}/events', \Folder\controllers\FolderController::class . ':getEventsFromFolder');
$app->get('/folders/{id}/resources/{resId}/baskets', \Folder\controllers\FolderController::class . ':getBasketsFromFolder');
$app->get('/folders/{id}/filters', \Folder\controllers\FolderController::class . ':getFilters');
$app->put('/folders/{id}/sharing', \Folder\controllers\FolderController::class . ':sharing');
......
......@@ -1251,7 +1251,7 @@ INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id,
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (507, '', 'AGENT', 'EenvBasket', 'Y', 'N', 'N');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (529, '', 'AGENT', 'EenvBasket', 'Y', 'N', 'N');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (100, '', 'AGENT', 'SuiviParafBasket', 'Y', 'Y', 'Y');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (527, '', 'AGENT', 'MyBasket', 'N', 'Y', 'N');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (527, '', 'AGENT', 'MyBasket', 'Y', 'Y', 'N');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (100, '', 'AGENT', 'AR_Create', 'Y', 'Y', 'Y');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (528, '', 'AGENT', 'AR_Create', 'Y', 'N', 'N');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (100, '', 'AGENT', 'AR_AlreadySend', 'Y', 'Y', 'Y');
......@@ -1266,7 +1266,7 @@ INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id,
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (505, 'closing_date IS NULL', 'RESPONSABLE', 'MyBasket', 'N', 'Y', 'N');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (506, 'closing_date IS NOT NULL', 'RESPONSABLE', 'MyBasket', 'N', 'Y', 'N');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (400, '', 'RESPONSABLE', 'MyBasket', 'N', 'Y', 'N');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (527, '', 'RESPONSABLE', 'MyBasket', 'N', 'Y', 'N');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (527, '', 'RESPONSABLE', 'MyBasket', 'Y', 'Y', 'N');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (100, '', 'RESPONSABLE', 'AR_Create', 'Y', 'Y', 'Y');
INSERT INTO actions_groupbaskets (id_action, where_clause, group_id, basket_id, used_in_basketlist, used_in_action_page, default_action_list) VALUES (528, '', 'RESPONSABLE', 'AR_Create', 'Y', 'N', 'N');
......
......@@ -26,6 +26,21 @@ use Slim\Http\Response;
class CustomFieldController
{
public function get(Request $request, Response $response)
{
if (!ServiceModel::hasService(['id' => 'admin_custom_fields', 'userId' => $GLOBALS['userId'], 'location' => 'apps', 'type' => 'admin'])) {
return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']);
}
$customFields = CustomFieldModel::get();
foreach ($customFields as $key => $customField) {
$customFields[$key]['values'] = json_decode($customField['values'], true);
}
return $response->withJson(['customFields' => $customFields]);
}
public function create(Request $request, Response $response)
{
if (!ServiceModel::hasService(['id' => 'admin_custom_fields', 'userId' => $GLOBALS['userId'], 'location' => 'apps', 'type' => 'admin'])) {
......@@ -47,13 +62,14 @@ class CustomFieldController
return $response->withStatus(400)->withJson(['errors' => 'Custom field with this label already exists']);
}
CustomFieldModel::create([
'label' => $body['label'],
'type' => $body['type'],
'values' => empty($body['values']) ? null : json_encode($body['values'])
$id = CustomFieldModel::create([
'label' => $body['label'],
'type' => $body['type'],
'values' => empty($body['values']) ? '[]' : json_encode($body['values']),
'default_value' => $body['default_value']
]);
return $response->withStatus(204);
return $response->withStatus(201)->withJson(['customFieldId' => $id]);
}
public function update(Request $request, Response $response, array $args)
......@@ -82,8 +98,9 @@ class CustomFieldController
CustomFieldModel::update([
'set' => [
'label' => $body['label'],
'values' => empty($body['values']) ? null : json_encode($body['values'])
'label' => $body['label'],
'values' => empty($body['values']) ? '[]' : json_encode($body['values']),
'default_value' => $body['default_value']
],
'where' => ['id = ?'],
'data' => [$args['id']]
......
......@@ -29,7 +29,7 @@ class CustomFieldModel
'table' => ['custom_fields'],
'where' => empty($args['where']) ? [] : $args['where'],
'data' => empty($args['data']) ? [] : $args['data'],
'order_by' => empty($args['orderBy']) ? [] : $args['orderBy'],
'order_by' => empty($args['orderBy']) ? ['label'] : $args['orderBy'],
'limit' => empty($args['limit']) ? 0 : $args['limit']
]);
......
......@@ -74,7 +74,7 @@ class FolderController
'countResources' => $count
];
if ($folder['level'] == 0) {
$tree[] = $insert;
array_splice($tree, 0, 0, [$insert]);
} else {
$found = false;
foreach ($tree as $key => $branch) {
......@@ -207,13 +207,15 @@ class FolderController
$data['parent_id'] = null;
$level = 0;
} else {
$folder = FolderController::getScopeFolders(['login' => $GLOBALS['userId'], 'folderId' => $data['parent_id']]);
if (empty($folder[0])) {
$folderParent = FolderController::getScopeFolders(['login' => $GLOBALS['userId'], 'folderId' => $data['parent_id']]);
if (empty($folderParent[0])) {
return $response->withStatus(400)->withJson(['errors' => 'Parent Folder not found or out of your perimeter']);
}
$level = $folder[0]['level'] + 1;
$level = $folderParent[0]['level'] + 1;
}
FolderController::updateChildren($aArgs['id'], $level);
FolderModel::update([
'set' => [
'label' => $data['label'],
......@@ -520,7 +522,7 @@ class FolderController
return $response->withJson(['countResources' => count($foldersResources) - count($resourcesToUnclassify)]);
}
public function getEventsFromFolder(Request $request, Response $response, array $args)
public function getBasketsFromFolder(Request $request, Response $response, array $args)
{
if (!Validator::numeric()->notEmpty()->validate($args['id'])) {
return $response->withStatus(400)->withJson(['errors' => 'Route id is not an integer']);
......@@ -536,11 +538,11 @@ class FolderController
}
$baskets = BasketModel::getWithPreferences([
'select' => ['baskets.id', 'baskets.basket_id', 'baskets.basket_name', 'baskets.basket_clause', 'users_baskets_preferences.group_serial_id', 'usergroups.group_desc'],
'select' => ['baskets.id', 'baskets.basket_name', 'baskets.basket_clause', 'users_baskets_preferences.group_serial_id', 'usergroups.group_desc'],
'where' => ['users_baskets_preferences.user_serial_id = ?'],
'data' => [$GLOBALS['id']]
]);
$events = [];
$groupsBaskets = [];
$inCheckedBaskets = [];
$outCheckedBaskets = [];
foreach ($baskets as $basket) {
......@@ -556,19 +558,11 @@ class FolderController
}
}
$inCheckedBaskets[] = $basket['id'];
$group = GroupModel::getById(['id' => $basket['group_serial_id'], 'select' => ['group_id']]);
$groupBasket = GroupBasketModel::get([
'select' => ['list_event'],
'where' => ['group_id = ?', 'basket_id = ?'],
'data' => [$group['group_id'], $basket['basket_id']]
]);
if (!empty($groupBasket[0]['list_event'])) {
$events[] = ['groupId' => $basket['group_serial_id'], 'groupName' => $basket['group_desc'], 'basketId' => $basket['id'], 'basketName' => $basket['basket_name'], 'event' => $groupBasket[0]['list_event']];
}
$groupsBaskets[] = ['groupId' => $basket['group_serial_id'], 'groupName' => $basket['group_desc'], 'basketId' => $basket['id'], 'basketName' => $basket['basket_name']];
}
}
return $response->withJson(['events' => $events]);
return $response->withJson(['groupsBaskets' => $groupsBaskets]);
}
public function getFilters(Request $request, Response $response, array $args)
......@@ -630,7 +624,7 @@ class FolderController
'select' => ['distinct (folders.id)', 'folders.*'],
'where' => $where,
'data' => $data,
'orderBy' => ['level', 'label']
'orderBy' => ['level', 'label desc']
]);
return $folders;
......@@ -674,4 +668,27 @@ class FolderController
}
return false;
}
private static function updateChildren($parentId, $levelParent)
{
$folderChild = FolderModel::getChild(['id' => $parentId]);
if (!empty($folderChild)) {
$level = -1;
foreach ($folderChild as $child) {
$level = $levelParent + 1;
FolderController::updateChildren($child['id'], $level);
}
$idsChildren = array_column($folderChild, 'id');
FolderModel::update([
'set' => [
'level' => $level
],
'where' => ['id in (?)'],
'data' => [$idsChildren]
]);
}
}
}
......@@ -911,10 +911,9 @@ class ResourceListController
} elseif ($value['value'] == 'getOpinionLimitDate') {
$value['displayValue'] = $resource['opinion_limit_date'];
$display[] = $value;
} elseif ($value['value'] == 'getFolders') {
$formattedResources[$key]['folders'] = ResourceListController::getFolders(['resId' => $resource['res_id'], 'userId' => $args['userId']]);
}
}
$formattedResources[$key]['folders'] = ResourceListController::getFolders(['resId' => $resource['res_id'], 'userId' => $args['userId']]);
$formattedResources[$key]['display'] = $display;
}
}
......
......@@ -194,8 +194,8 @@ define('_ADMIN_TEMPLATES_DESC', 'Manage templates for attachments, notifications
define('_SECURITIES', 'Securities');
define('_EMAILSERVER_PARAM', 'Mail server');
define('_EMAILSERVER_PARAM_DESC', 'Link your mail serveur with application in order to send emails.');
define('_ADMIN_INDEXING_MODELS', 'Indexing models administration');
define('_ADMIN_CUSTOM_FIELDS', 'Custom fields administration');
define('_ADMIN_INDEXING_MODELS', 'Indexing models');
define('_ADMIN_CUSTOM_FIELDS', 'Custom fields');
// SERVICES
define('_REDIRECT_TO_ACTION', 'Redirect to an action');
......
......@@ -194,8 +194,8 @@ define('_ADMIN_TEMPLATES_DESC', "Gérer les modèles utilisés pour les pièces
define('_SECURITIES', 'Sécurités');
define('_EMAILSERVER_PARAM', 'Serveur e-mail');
define('_EMAILSERVER_PARAM_DESC', 'Connecter votre serveur e-mail à Maarch Courrier afin de pouvoir envoyer des courriels.');
define('_ADMIN_INDEXING_MODELS', 'Administration des modèles d\'indexation');
define('_ADMIN_CUSTOM_FIELDS', 'Administration des champs personnalisés');
define('_ADMIN_INDEXING_MODELS', 'Modèles d\'indexation');
define('_ADMIN_CUSTOM_FIELDS', 'Champs personnalisés');
// SERVICES
define('_REDIRECT_TO_ACTION', 'Rediriger vers une action');
......
......@@ -193,8 +193,8 @@ define('_ADMIN_TEMPLATES_DESC', 'De modellen die voor de bijlagen gebruikt worde
define('_SECURITIES', 'Veiligheden');
define('_EMAILSERVER_PARAM', '_TO_TRANSLATE');
define('_EMAILSERVER_PARAM_DESC', '_TO_TRANSLATE');
define('_ADMIN_INDEXING_MODELS', 'Indexing models administration'); // translate
define('_ADMIN_CUSTOM_FIELDS', 'Custom fields administration'); // translate
define('_ADMIN_INDEXING_MODELS', 'Indexing models'); // translate
define('_ADMIN_CUSTOM_FIELDS', 'Custom fields'); // translate
//SERVICES
define('_REDIRECT_TO_ACTION', 'Doorsturen naar een andere actie');
......
......@@ -96,6 +96,7 @@ export class RedirectActionComponent implements OnInit {
"three_state": false //no cascade selection
},
'core': {
force_text : true,
'themes': {
'name': 'proton',
'responsive': true
......
......@@ -37,6 +37,7 @@ import { SecuritiesAdministrationComponent } from './security/securit
import { SendmailAdministrationComponent } from './sendmail/sendmail-administration.component';
import { ShippingsAdministrationComponent } from './shipping/shippings-administration.component';
import { ShippingAdministrationComponent } from './shipping/shipping-administration.component';
import { CustomFieldsAdministrationComponent } from './customField/custom-fields-administration.component';
import { AppGuard } from '../../service/app.guard';
@NgModule({
......@@ -90,6 +91,7 @@ import { AppGuard } from '../../service/app.guard';
{ path: 'administration/shippings', canActivate: [AppGuard], component: ShippingsAdministrationComponent },
{ path: 'administration/shippings/new', canActivate: [AppGuard], component: ShippingAdministrationComponent },
{ path: 'administration/shippings/:id', canActivate: [AppGuard], component: ShippingAdministrationComponent },
{ path: 'administration/customFields', canActivate: [AppGuard], component: CustomFieldsAdministrationComponent },
]),
],
exports: [
......
......@@ -49,6 +49,7 @@ import { TechnicalAdministrationComponent } from './technical/techni
import { ListAdministrationComponent } from './basket/list/list-administration.component';
import { ShippingsAdministrationComponent } from './shipping/shippings-administration.component';
import { ShippingAdministrationComponent } from './shipping/shipping-administration.component';
import { CustomFieldsAdministrationComponent } from './customField/custom-fields-administration.component';
@NgModule({
imports: [
......@@ -107,7 +108,8 @@ import { ShippingAdministrationComponent } from './shipping/shippin
TemplateAdministrationCheckEntitiesModalComponent,
ShippingsAdministrationComponent,
ShippingAdministrationComponent,
AccountLinkComponent
AccountLinkComponent,
CustomFieldsAdministrationComponent
],
entryComponents: [
UsersAdministrationRedirectModalComponent,
......
......@@ -437,6 +437,7 @@ export class BasketAdministrationSettingsModalComponent {
"three_state": false //no cascade selection
},
'core': {
force_text : true,
'themes': {
'name': 'proton',
'responsive': true
......@@ -498,6 +499,7 @@ export class BasketAdministrationSettingsModalComponent {
"three_state": false //no cascade selection
},
'core': {
force_text : true,
'themes': {
'name': 'proton',
'responsive': true
......
@import '../../../css/vars.scss';
.mat-divider {
padding-top: 10px;
padding-bottom: 10px;
}
.div-list {
padding: 0px;
max-height: 150px;
overflow: auto;
}
.input-form {
color: #666;
width: 500px;
button {
font-size: 30px;
}
.mat-input-element {
color: $primary;
padding-left: 20px;
}
input {
padding-left: 20px;
}
::ng-deep.mat-select-value-text {
padding-left: 20px;
color: $primary;
}
::ng-deep.mat-form-field-label {
left: 20px;
}
::ng-deep.mat-form-field-infix {
padding-bottom: 15px;
}
::ng-deep.mat-form-field-flex {
background: white;
border-radius: 30px;
border: solid 1px $primary;
}
::ng-deep .mat-form-field-underline {
display: none;
}
::ng-deep.mat-form-field-suffix {
margin-right: 20px;
}
::ng-deep.mat-select-arrow-wrapper {
padding-right: 20px;
}
::ng-deep.mat-list-option {
color: rgba(0, 0, 0, 0.54);
}
textarea.cdk-textarea-autosize-measuring {
padding: 4px 0 !important;
}
}
.checkbox-form {
width: 100%;
padding: 0px;
border: solid 1px $primary;
border-radius: 30px;
overflow: hidden;
}
.checkbox-selected-list {
margin-top: 10px;
display: flex;
justify-content: center;
::ng-deep.mat-chip-list-wrapper {
justify-content: center;
}
}
.radio-form {
display: flex;
.mat-radio-button {
flex: 1;
::ng-deep.mat-radio-label-content {
font-weight: normal;
color: rgba(0, 0, 0, 0.54);
}
}
}
.customFielsdPanel {
padding-left: 0px;
::ng-deep.mat-tab-body-wrapper {
padding-left: 0px;
}
}
.mat-expansion-panel-header-description {
flex-direction: row-reverse;
}
.customFieldValues {
box-shadow: none;
border: 1px solid rgba(0,0,0,0.12);
}
.mat-expansion-panel {
margin: 5px;
}
.mat-accordion {
padding: 5px;
}
.mat-tab-group, .mat-tab-body-wrapper, .mat-tab-body-content {
height: 100%;
}
.actionsCustomFields {
display: flex;
align-items: center;
justify-content: center;
}
.actionValuesCustom {
display: flex;
}
.alert-message-info {
margin-top: 30px;
max-width: 100%;
}
.addCustomFieldTypeContainer {
justify-content: center;
display: flex;
align-items: center;
width:60px;
}
.customFieldsTypesItem {
display:flex;
padding-top: 10px;
padding-bottom: 10px;
}
\ No newline at end of file
import { Component, OnInit, ViewChild } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { LANG } from '../../translate.component';
import { NotificationService } from '../../notification.service';
import { HeaderService } from '../../../service/header.service';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { MatSidenav } from '@angular/material/sidenav';
import { AppService } from '../../../service/app.service';
import { tap, catchError, filter, exhaustMap, map, finalize } from 'rxjs/operators';
import { ConfirmComponent } from '../../../plugins/modal/confirm.component';
import { of } from 'rxjs';
import { SortPipe } from '../../../plugins/sorting.pipe';
declare function $j(selector: any): any;
@Component({
templateUrl: "custom-fields-administration.component.html",
styleUrls: ['custom-fields-administration.component.scss'],
providers: [NotificationService, AppService, SortPipe]
})
export class CustomFieldsAdministrationComponent implements OnInit {
@ViewChild('snav', { static: true }) public sidenavLeft: MatSidenav;
@ViewChild('snav2', { static: true }) public sidenavRight: MatSidenav;
lang: any = LANG;
loading: boolean = false;
customFieldsTypes: any[] = [
{
label: this.lang.stringInput,
type: 'string'
},
{
label: this.lang.selectInput,
type: 'select'
},
{
label: this.lang.dateInput,
type: 'date'
},
{
label: this.lang.radioInput,
type: 'radio'
},
{
label: this.lang.checkboxInput,
type: 'checkbox'
}
]
customFields: any[] = [];
customFieldsClone: any[] = [];
incrementCreation: number = 1;
sampleIncrement: number[] = [1,2,3,4];
dialogRef: MatDialogRef<any>;
constructor(
public http: HttpClient,
private notify: NotificationService,
public dialog: MatDialog,
private headerService: HeaderService,
public appService: AppService,
private sortPipe: SortPipe
) {
}
ngOnInit(): void {
this.headerService.setHeader(this.lang.administration + ' ' + this.lang.customFields);
window['MainHeaderComponent'].setSnav(this.sidenavLeft);
window['MainHeaderComponent'].setSnavRight(this.sidenavRight);
this.http.get("../../rest/customFields").pipe(
// TO FIX DATA BINDING SIMPLE ARRAY VALUES
map((data: any) => {
data.customFields.forEach((element: any) => {
element.values = element.values.map((info: any) => {
return {
label: info
}
});
});
return data;
}),
tap((data: any) => {
this.customFields = data.customFields;
this.customFieldsClone = JSON.parse(JSON.stringify(this.customFields));
}),
finalize(() => this.loading = false),
catchError((err: any) => {
this.notify.handleErrors(err);
return of(false);
})
).subscribe();
}
addCustomField(customFieldType: any) {
let newCustomField: any = {};
this.dialogRef = this.dialog.open(ConfirmComponent, { autoFocus: false, disableClose: true, data: { title: this.lang.add, msg: this.lang.confirmAction } });
this.dialogRef.afterClosed().pipe(
filter((data: string) => data === 'ok'),
tap(() => {
newCustomField = {
label: this.lang.newField + ' ' + this.incrementCreation,
type: customFieldType.type,
values: [],
default_value: ''
}
}),
exhaustMap((data) => this.http.post('../../rest/customFields', newCustomField)),
tap((data: any) => {
newCustomField.id = data.customFieldId
this.customFields.push(newCustomField);
this.notify.success(this.lang.customFieldAdded);
this.incrementCreation++;
}),
catchError((err: any) => {
this.notify.handleErrors(err);
return of(false);
})
).subscribe();
}
addValue(indexCustom: number) {
this.customFields[indexCustom].values.push(
{
label: this.lang.newValue
}
);
}
removeValue(customField: any, indexValue: number) {
customField.values.splice(indexValue, 1);
}
removeCustomField(indexCustom: number) {