1- import { CdkDragDrop , moveItemInArray } from '@angular/cdk/drag-drop' ;
21import { Component , OnInit } from '@angular/core' ;
3- import { TableField , TableOrdering , TableSettings } from 'src/app/models/table' ;
2+ import { TableField , TableSettings } from 'src/app/models/table' ;
43
54import { AlertComponent } from '../../../ui-components/alert/alert.component' ;
65import { Angulartics2 } from 'angulartics2' ;
@@ -61,9 +60,7 @@ export class DbTableSettingsComponent implements OnInit {
6160 public loading : boolean = true ;
6261 public fields : string [ ] ;
6362 public fields_to_exclude : string [ ] ;
64- // public orderChanged: boolean = false;
6563 public iconChanged : boolean = false ;
66- public listFieldsOrder : string [ ] ;
6764 public tableSettingsInitial : TableSettings = {
6865 connection_id : '' ,
6966 table_name : '' ,
@@ -140,13 +137,9 @@ export class DbTableSettingsComponent implements OnInit {
140137 if ( Object . keys ( res ) . length !== 0 ) {
141138 this . isSettingsExist = true
142139 this . tableSettings = res ;
143- this . listFieldsOrder = [ ...res . list_fields ] ;
144140 } else {
145141 this . tableSettings = this . tableSettingsInitial ;
146142 } ;
147- if ( Object . keys ( res ) . length === 0 || ( res ?. list_fields && ! res . list_fields . length ) ) {
148- this . listFieldsOrder = [ ...this . fields ] ;
149- } ;
150143 this . title . setTitle ( `${ res . display_name || this . displayTableName } - Table settings | ${ this . _company . companyTabTitle || 'Rocketadmin' } ` ) ;
151144 }
152145 ) ;
@@ -157,18 +150,6 @@ export class DbTableSettingsComponent implements OnInit {
157150 this . iconChanged = true ;
158151 }
159152
160- // drop(event: CdkDragDrop<string[]>) {
161- // // moveItemInArray(this.listFieldsOrder, event.previousIndex, event.currentIndex);
162- // // this.tableSettings.list_fields = [...this.listFieldsOrder];
163- // // this.orderChanged = true;
164- // }
165-
166- // resetColumnsOrder() {
167- // // this.tableSettings.list_fields = [];
168- // this.listFieldsOrder = [...this.fields];
169- // // this.orderChanged = true;
170- // }
171-
172153 updateSettings ( ) {
173154 this . submitting = true ;
174155 this . tableSettings . connection_id = this . connectionID ;
0 commit comments