ps-toolkit-ui 0.0.26 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,6 +132,7 @@ const strings = {
132
132
  RePassword: 'تکرار کلمه عبور',
133
133
  PassportLetter: 'حرف',
134
134
  Passport: 'گذرنامه',
135
+ List: 'لیست',
135
136
  Priority: 'اولویت',
136
137
  PassportImage: 'تصویر گذرنامه',
137
138
  PassportExpireDate: 'تاریخ انقضاء گذرنامه',
@@ -1087,7 +1088,6 @@ class FormClass {
1087
1088
  clear() {
1088
1089
  this.method = Method.Post;
1089
1090
  this.url = this.baseUrl;
1090
- this.name = this.name.replace('Update', 'Insert');
1091
1091
  this.setButtons(this.onTop, false);
1092
1092
  this.clearInputs();
1093
1093
  }
@@ -1810,6 +1810,8 @@ class TableRowComponent {
1810
1810
  this.confirmShow = new EventEmitter();
1811
1811
  this.changeRows = new EventEmitter();
1812
1812
  this.loadParent = new EventEmitter();
1813
+ this.optEdit = null;
1814
+ this.optDelete = null;
1813
1815
  this.showChildren = null;
1814
1816
  this.addChildren = null;
1815
1817
  this.itemsWidth = 0;
@@ -1818,8 +1820,14 @@ class TableRowComponent {
1818
1820
  get type() { return InputType; }
1819
1821
  ngOnInit() {
1820
1822
  this.itemsWidth = this.table.cols.reduce((a, { percent }) => a + percent, 0);
1821
- this.optEdit = new InputClass(this.table.environment, this.table.l, this.table.name + 'UpdateTitle', 'fad fa-pen', InputType.Icon, 'blue h-25 m-h-5 d-ib va-m f-u');
1822
- this.optDelete = new InputClass(this.table.environment, this.table.l, this.table.name + 'DeleteTitle', 'fad fa-trash', InputType.Icon, 'red h-25 m-h-5 d-ib va-m f-u');
1823
+ const updateAccess = this.table.permissions.getAccess('Update');
1824
+ const deleteAccess = this.table.permissions.getAccess('Delete');
1825
+ if (updateAccess != null) {
1826
+ this.optEdit = new InputClass(this.table.environment, this.table.l, updateAccess.Name, 'fad fa-pen', InputType.Icon, 'blue h-25 m-h-5 d-ib va-m f-u');
1827
+ }
1828
+ if (deleteAccess != null) {
1829
+ this.optDelete = new InputClass(this.table.environment, this.table.l, deleteAccess.Name, 'fad fa-trash', InputType.Icon, 'red h-25 m-h-5 d-ib va-m f-u');
1830
+ }
1823
1831
  if (this.table.hasChildren) {
1824
1832
  if (!this.table.childrenAutoLoad) {
1825
1833
  this.children = this.getChildren();
@@ -1862,54 +1870,58 @@ class TableRowComponent {
1862
1870
  };
1863
1871
  }
1864
1872
  this.options = this.getOptions();
1865
- if (this.table.form) {
1866
- this.optEdit.onClick = () => {
1867
- this.table.form.url = this.table.url + 'Update/' + this.row.Id;
1868
- if (this.table.hasChildren && this.row.ParentId != null) {
1869
- this.table.form.onSuccessBase = () => {
1870
- this.table.modal.hide();
1871
- if (this.table.childrenAutoLoad) {
1872
- this.loadParent.emit(this.row.ParentId);
1873
- }
1874
- else {
1873
+ if (this.optEdit !== null) {
1874
+ if (this.table.form) {
1875
+ this.optEdit.onClick = () => {
1876
+ this.table.form.url = this.table.url + 'Update/' + this.row.Id;
1877
+ if (this.table.hasChildren && this.row.ParentId != null) {
1878
+ this.table.form.onSuccessBase = () => {
1879
+ this.table.modal.hide();
1880
+ if (this.table.childrenAutoLoad) {
1881
+ this.loadParent.emit(this.row.ParentId);
1882
+ }
1883
+ else {
1884
+ this.table.load();
1885
+ }
1886
+ };
1887
+ }
1888
+ else {
1889
+ this.table.form.onSuccessBase = () => {
1890
+ if (!this.table.form.onTop) {
1891
+ this.table.modal.hide();
1892
+ }
1893
+ this.table.form.clear();
1875
1894
  this.table.load();
1876
- }
1877
- };
1895
+ };
1896
+ }
1897
+ this.edit();
1898
+ };
1899
+ }
1900
+ else {
1901
+ this.optEdit.url = this.table.url + '/Update/' + this.row.Id;
1902
+ }
1903
+ }
1904
+ if (this.optDelete != null) {
1905
+ this.optDelete.onClick = () => {
1906
+ if (this.table.form) {
1907
+ this.table.form.clear();
1908
+ }
1909
+ if (this.table.permissions.Type === PermissionTypeEnum.Form) {
1910
+ this.table.rows = this.table.rows.filter(x => x.Id !== this.row.Id);
1911
+ this.changeRows.emit(this.row);
1878
1912
  }
1879
1913
  else {
1880
- this.table.form.onSuccessBase = () => {
1881
- if (!this.table.form.onTop) {
1882
- this.table.modal.hide();
1883
- }
1884
- this.table.form.clear();
1885
- this.table.load();
1886
- };
1914
+ this.confirmShow.emit({ id: this.row.Id, accept: () => {
1915
+ if (this.table.hasChildren && this.table.childrenAutoLoad && this.row.ParentId != null) {
1916
+ this.loadParent.emit(this.row.ParentId);
1917
+ }
1918
+ else {
1919
+ this.table.load();
1920
+ }
1921
+ } });
1887
1922
  }
1888
- this.edit();
1889
1923
  };
1890
1924
  }
1891
- else {
1892
- this.optEdit.url = this.table.url + '/Update/' + this.row.Id;
1893
- }
1894
- this.optDelete.onClick = () => {
1895
- if (this.table.form) {
1896
- this.table.form.clear();
1897
- }
1898
- if (this.table.permissions.Type === PermissionTypeEnum.Form) {
1899
- this.table.rows = this.table.rows.filter(x => x.Id !== this.row.Id);
1900
- this.changeRows.emit(this.row);
1901
- }
1902
- else {
1903
- this.confirmShow.emit({ id: this.row.Id, accept: () => {
1904
- if (this.table.hasChildren && this.table.childrenAutoLoad && this.row.ParentId != null) {
1905
- this.loadParent.emit(this.row.ParentId);
1906
- }
1907
- else {
1908
- this.table.load();
1909
- }
1910
- } });
1911
- }
1912
- };
1913
1925
  if (this.table.sortable) {
1914
1926
  this.setSortRow();
1915
1927
  }
@@ -2031,8 +2043,9 @@ class TableRowComponent {
2031
2043
  return c;
2032
2044
  }
2033
2045
  edit() {
2046
+ const editAccess = this.table.permissions.getAccess('Update');
2034
2047
  if (this.table.permissions.Type === PermissionTypeEnum.Form) {
2035
- this.table.form.name = this.table.name + 'UpdateTitle';
2048
+ this.table.form.name = editAccess.Name;
2036
2049
  this.table.form.setData(this.row);
2037
2050
  this.table.form.setButtons(this.table.form.onTop, true, this.row.Id);
2038
2051
  this.table.form.inputs.filter(x => x.inEditDisabled).forEach(x => x.disabled = true);
@@ -2040,7 +2053,7 @@ class TableRowComponent {
2040
2053
  }
2041
2054
  else {
2042
2055
  new RequestClass(this.table.environment, this.table.l).send(this.table.url + 'Get/' + this.row.Id, Method.Post, null, this.optEdit, (result) => {
2043
- this.table.form.name = this.table.name + 'UpdateTitle';
2056
+ this.table.form.name = editAccess.Name;
2044
2057
  this.table.form.setButtons(this.table.form.onTop, true, this.row.Id);
2045
2058
  this.table.form.setData(result);
2046
2059
  this.table.form.inputs.filter(x => x.inEditDisabled).forEach(x => x.disabled = true);
@@ -2257,7 +2270,7 @@ class TableComponent {
2257
2270
  TableComponent.decorators = [
2258
2271
  { type: Component, args: [{
2259
2272
  selector: 'lib-table',
2260
- template: "<div [id]=\"table.id + 'Table'\" [style]=\"table.style\" #tableDiv [className]=\"(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren ? ' has-children' : '') + ' table-con'\">\r\n <div *ngIf=\"table.displayLabel\" class=\"title\">\r\n {{this.table.l(this.table.name + 'ListTitle')}}\r\n <div class=\"extra-buttons\" *ngIf=\"table.extraButtons\">\r\n <div *ngIf=\"table.permissions && table.permissions.hasAccess('Report')\" class=\"export\">\r\n <lib-form-icon [inp]=\"export\"></lib-form-icon>\r\n <div class=\"export-dropdown\" #exportDropDown>\r\n <div (click)=\"report('Print')\" class=\"item\"><div class=\"text\">Print</div><i class=\"fad fa-print\"></i></div>\r\n <div (click)=\"report('Excel')\" class=\"item\"><div class=\"text\">Excel</div><i class=\"fad fa-file-excel\"></i></div>\r\n <div (click)=\"report('CSV')\" class=\"item\"><div class=\"text\">CSV</div><i class=\"fad fa-file-csv\"></i></div>\r\n <div (click)=\"report('PDF')\" class=\"item\"><div class=\"text\">PDF</div><i class=\"fad fa-file-pdf\"></i></div>\r\n </div>\r\n </div>\r\n <lib-form-icon [inp]=\"reload\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"maximum\"></lib-form-icon>\r\n </div>\r\n <div *ngIf=\"table.buttons.length > 0\" class=\"buttons\">\r\n <lib-form-button [inp]=\"btn\" *ngFor=\"let btn of table.buttons\"></lib-form-button>\r\n </div>\r\n </div>\r\n <div class=\"search-form\" *ngIf=\"table.searchForm\">\r\n <lib-form [form]=\"table.searchForm\"></lib-form>\r\n </div>\r\n <lib-form *ngIf=\"table.form && table.form.onTop\" [form]=\"table.form\"></lib-form>\r\n <table>\r\n <thead>\r\n <tr>\r\n <th *ngIf=\"table.hasChildren\" style=\"width: 50px\"></th>\r\n <th *ngIf=\"table.sortable\" style=\"width: 50px\"></th>\r\n <th *ngIf=\"table.withSelect\" style=\"width: 50px\">\r\n <i (click)=\"selectAll()\" [className]=\"(allSelected() ? 'fas fa-check-square green' : isSelected() ? 'fas fa-minus-square green' : 'far fa-square') + ' select-row'\" *ngIf=\"table.rows.length > 0\"></i>\r\n </th>\r\n <th (click)=\"!table.sortable && col.sort && changeSort($event, col.name)\" [className]=\"(!table.sortable && col.sort ? 'sort' : '')\" *ngFor=\"let col of table.cols\" [style]=\"{width: col.percent + '%'}\">\r\n <i *ngIf=\"!table.sortable && col.sort\" [className]=\"'sort-icon fas' + (table.sort === col.name ? (table.sortType === 'ASC' ? ' fa-sort-up' : ' fa-sort-down') : ' fa-sort')\"></i>\r\n <span *ngIf=\"col.search == null\">{{ table.l(col.name) }}</span>\r\n <div class=\"w-90 header-search p-h-20 m-r-5\" *ngIf=\"!table.sortable && col.search != null\">\r\n <lib-form-textbox *ngIf=\"col.type != colType.Date\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"col.type == colType.Date\" [inp]=\"col.search\"></lib-form-date>\r\n </div>\r\n </th>\r\n<!-- <th *ngIf=\"table.hasOption()\" [style]=\"{width: (100 - itemsWidth) + '%'}\">-->\r\n<!-- <span *ngIf=\"!table.withSelect || !isSelected()\">{{ table.l('Options') }}</span>-->\r\n<!-- <span *ngIf=\"table.withSelect && isSelected()\" class=\"option-con\">-->\r\n<!-- <span *ngFor=\"let opt of options\">-->\r\n<!-- <lib-form-button *ngIf=\"opt.type == type.Button\" [inp]=\"opt\"></lib-form-button>-->\r\n<!-- <lib-form-icon *ngIf=\"opt.type == type.Icon\" [inp]=\"opt\"></lib-form-icon>-->\r\n<!-- </span>-->\r\n<!-- </span>-->\r\n<!-- </th>-->\r\n </tr>\r\n </thead>\r\n <tbody #rows [style]=\"table.perPage > 0 ? {height: table.height * table.perPage + 'px'} : table.loading || !table.permission || table.rows.length == 0 ? {height: '100px'} : {}\">\r\n <lib-table-row (confirmShow)=\"onConfirmShow($event)\" [level]=\"1\" (changeRows)=\"onChangeRows($event)\" [id]=\"row.id ? row.id : ''\" [table]=\"table\" [row]=\"row\" *ngFor=\"let row of getRows()\"></lib-table-row>\r\n <tr *ngIf=\"table.perPage > 0\" [style]=\"{height: (table.perPage > 0 ? (table.perPage - table.rows.length) * table.height : '100') + 'px', visibility: 'hidden'}\"></tr>\r\n <lib-table-loading [table]=\"table\"></lib-table-loading>\r\n </tbody>\r\n <tfoot>\r\n <tr>\r\n <td colspan=\"100%\">\r\n <lib-table-pagination [table]=\"table\" *ngIf=\"table.perPage > 0\"></lib-table-pagination>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n </table>\r\n <lib-modal *ngIf=\"table.modal != null\" [modal]=\"table.modal\"></lib-modal>\r\n <lib-modal [modal]=\"opt.modal\" *ngFor=\"let opt of getOptionModals()\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"></lib-confirm>\r\n</div>\r\n",
2273
+ template: "<div [id]=\"table.id + 'Table'\" [style]=\"table.style\" #tableDiv [className]=\"(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren ? ' has-children' : '') + ' table-con'\">\r\n <div *ngIf=\"table.displayLabel\" class=\"title\">\r\n {{this.table.title ? this.table.title : 'List'}}\r\n <div class=\"extra-buttons\" *ngIf=\"table.extraButtons\">\r\n <div *ngIf=\"table.permissions && table.permissions.hasAccess('Report')\" class=\"export\">\r\n <lib-form-icon [inp]=\"export\"></lib-form-icon>\r\n <div class=\"export-dropdown\" #exportDropDown>\r\n <div (click)=\"report('Print')\" class=\"item\"><div class=\"text\">Print</div><i class=\"fad fa-print\"></i></div>\r\n <div (click)=\"report('Excel')\" class=\"item\"><div class=\"text\">Excel</div><i class=\"fad fa-file-excel\"></i></div>\r\n <div (click)=\"report('CSV')\" class=\"item\"><div class=\"text\">CSV</div><i class=\"fad fa-file-csv\"></i></div>\r\n <div (click)=\"report('PDF')\" class=\"item\"><div class=\"text\">PDF</div><i class=\"fad fa-file-pdf\"></i></div>\r\n </div>\r\n </div>\r\n <lib-form-icon [inp]=\"reload\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"maximum\"></lib-form-icon>\r\n </div>\r\n <div *ngIf=\"table.buttons.length > 0\" class=\"buttons\">\r\n <lib-form-button [inp]=\"btn\" *ngFor=\"let btn of table.buttons\"></lib-form-button>\r\n </div>\r\n </div>\r\n <div class=\"search-form\" *ngIf=\"table.searchForm\">\r\n <lib-form [form]=\"table.searchForm\"></lib-form>\r\n </div>\r\n <lib-form *ngIf=\"table.form && table.form.onTop\" [form]=\"table.form\"></lib-form>\r\n <table>\r\n <thead>\r\n <tr>\r\n <th *ngIf=\"table.hasChildren\" style=\"width: 50px\"></th>\r\n <th *ngIf=\"table.sortable\" style=\"width: 50px\"></th>\r\n <th *ngIf=\"table.withSelect\" style=\"width: 50px\">\r\n <i (click)=\"selectAll()\" [className]=\"(allSelected() ? 'fas fa-check-square green' : isSelected() ? 'fas fa-minus-square green' : 'far fa-square') + ' select-row'\" *ngIf=\"table.rows.length > 0\"></i>\r\n </th>\r\n <th (click)=\"!table.sortable && col.sort && changeSort($event, col.name)\" [className]=\"(!table.sortable && col.sort ? 'sort' : '')\" *ngFor=\"let col of table.cols\" [style]=\"{width: col.percent + '%'}\">\r\n <i *ngIf=\"!table.sortable && col.sort\" [className]=\"'sort-icon fas' + (table.sort === col.name ? (table.sortType === 'ASC' ? ' fa-sort-up' : ' fa-sort-down') : ' fa-sort')\"></i>\r\n <span *ngIf=\"col.search == null\">{{ table.l(col.name) }}</span>\r\n <div class=\"w-90 header-search p-h-20 m-r-5\" *ngIf=\"!table.sortable && col.search != null\">\r\n <lib-form-textbox *ngIf=\"col.type != colType.Date\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"col.type == colType.Date\" [inp]=\"col.search\"></lib-form-date>\r\n </div>\r\n </th>\r\n<!-- <th *ngIf=\"table.hasOption()\" [style]=\"{width: (100 - itemsWidth) + '%'}\">-->\r\n<!-- <span *ngIf=\"!table.withSelect || !isSelected()\">{{ table.l('Options') }}</span>-->\r\n<!-- <span *ngIf=\"table.withSelect && isSelected()\" class=\"option-con\">-->\r\n<!-- <span *ngFor=\"let opt of options\">-->\r\n<!-- <lib-form-button *ngIf=\"opt.type == type.Button\" [inp]=\"opt\"></lib-form-button>-->\r\n<!-- <lib-form-icon *ngIf=\"opt.type == type.Icon\" [inp]=\"opt\"></lib-form-icon>-->\r\n<!-- </span>-->\r\n<!-- </span>-->\r\n<!-- </th>-->\r\n </tr>\r\n </thead>\r\n <tbody #rows [style]=\"table.perPage > 0 ? {height: table.height * table.perPage + 'px'} : table.loading || !table.permission || table.rows.length == 0 ? {height: '100px'} : {}\">\r\n <lib-table-row (confirmShow)=\"onConfirmShow($event)\" [level]=\"1\" (changeRows)=\"onChangeRows($event)\" [id]=\"row.id ? row.id : ''\" [table]=\"table\" [row]=\"row\" *ngFor=\"let row of getRows()\"></lib-table-row>\r\n <tr *ngIf=\"table.perPage > 0\" [style]=\"{height: (table.perPage > 0 ? (table.perPage - table.rows.length) * table.height : '100') + 'px', visibility: 'hidden'}\"></tr>\r\n <lib-table-loading [table]=\"table\"></lib-table-loading>\r\n </tbody>\r\n <tfoot>\r\n <tr>\r\n <td colspan=\"100%\">\r\n <lib-table-pagination [table]=\"table\" *ngIf=\"table.perPage > 0\"></lib-table-pagination>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n </table>\r\n <lib-modal *ngIf=\"table.modal != null\" [modal]=\"table.modal\"></lib-modal>\r\n <lib-modal [modal]=\"opt.modal\" *ngFor=\"let opt of getOptionModals()\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"></lib-confirm>\r\n</div>\r\n",
2261
2274
  styles: [".table-con{background-color:#fff;border-radius:5px;box-shadow:var(--box-shadow-table);float:right;padding:20px;position:relative;width:100%}.table-con.maximum{border-radius:0;height:100%;overflow-y:auto;position:fixed;right:0;top:0;width:100%;z-index:11}.table-con>.title{float:right;font-family:VazirBold;font-size:16px;height:40px;line-height:40px;margin-bottom:10px;position:relative;text-align:right;width:100%}.table-con>.title .extra-buttons{float:left;margin-top:5px}.table-con>.title .extra-buttons .export{float:right;position:relative}.table-con>.title .extra-buttons .export .export-dropdown{background-color:#fff;border-radius:5px;box-shadow:var(--box-shadow-table);display:none;overflow:hidden;padding:15px 0;position:absolute;right:-50px;top:35px;width:130px;z-index:2}.table-con>.title .extra-buttons .export .export-dropdown .item{cursor:pointer;float:right;padding:0 15px;text-align:center;width:100%}.table-con>.title .extra-buttons .export .export-dropdown .item:hover{background-color:var(--black-22)}.table-con>.title .extra-buttons .export .export-dropdown .text{float:right;font-family:VazirLight;font-size:13px;height:40px;line-height:41px;width:70%}.table-con>.title .extra-buttons .export .export-dropdown i{color:var(--black-88);float:right;font-size:14px;height:40px;line-height:40px;width:30%}.table-con>.title .buttons{float:left;margin-left:10px;margin-top:5px}.table-con>.search-form{border-radius:5px;float:right;margin-bottom:5px;width:100%}.table-con table{border-spacing:0!important;width:100%}.table-con table thead tr{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;position:relative}.table-con table thead tr th{background-color:var(--base-11);color:var(--black-88);font-family:VazirLight;font-size:12px;font-weight:400;height:45px;position:relative;vertical-align:middle}.table-con table thead tr th:first-child{border-bottom-right-radius:5px;border-top-right-radius:5px}.table-con table thead tr th:last-child{border-bottom-left-radius:5px;border-top-left-radius:5px}.table-con table thead tr th.sort{cursor:pointer}.table-con table thead tr th .sort-icon{font-size:13px;height:20px;left:5px;line-height:20px;opacity:.6;position:absolute;top:calc(50% - 10px);width:20px}.table-con table tbody{position:relative}.table-con table tfoot tr{height:45px}.table-con table tfoot tr td{position:relative;vertical-align:bottom}::ng-deep .table-con:not(.sortable) table lib-table-row:last-of-type>tr:after{background-image:unset}::ng-deep .table-con table thead tr th .select-row{cursor:pointer;font-size:18px;height:30px;line-height:30px}"]
2262
2275
  },] }
2263
2276
  ];
@@ -4239,18 +4252,21 @@ FormSelectComponent.propDecorators = {
4239
4252
  };
4240
4253
 
4241
4254
  class PermissionClass {
4242
- constructor(Name = '', Icon = '', Type = null, Area = '', Controller = '', Action = '', Children = [], Accesses = []) {
4255
+ constructor(Name = '', Icon = '', Type = null, Area = '', Controller = '', Action = '', Accesses = []) {
4243
4256
  this.Name = Name;
4244
4257
  this.Icon = Icon;
4245
4258
  this.Type = Type;
4246
4259
  this.Area = Area;
4247
4260
  this.Controller = Controller;
4248
4261
  this.Action = Action;
4249
- this.Children = Children;
4250
4262
  this.Accesses = Accesses;
4251
4263
  this.RelatedId = null;
4252
4264
  this.Condition = null;
4253
4265
  }
4266
+ getAccess(a) {
4267
+ const c = this.Accesses.filter(x => x.Action === a && x.Type === PermissionTypeEnum.Access);
4268
+ return c.length > 0 ? c[0] : null;
4269
+ }
4254
4270
  hasAccess(a) {
4255
4271
  return this.Accesses.filter(x => x.Action === a && x.Type === PermissionTypeEnum.Access).length > 0;
4256
4272
  }
@@ -5959,17 +5975,10 @@ class BaseComponent {
5959
5975
  return p.length > 0 ? this.getPermissionClass(p[0]) : null;
5960
5976
  }
5961
5977
  getPermissionClass(p) {
5962
- console.log('$$$$$$$$$$');
5963
- console.log(p);
5964
- console.log('$$$$$$$$$$');
5965
- return new PermissionClass(p.Name, p.Icon, p.Type, p.Area, p.Controller, p.Action, [], this.getPermissionAccessesClass(p.Id));
5978
+ return new PermissionClass(p.Name, p.Icon, p.Type, p.Area, p.Controller, p.Action, this.getPermissionAccessesClass(p.Id));
5966
5979
  }
5967
5980
  getPermissionAccessesClass(parentId) {
5968
- console.log('--------------');
5969
- console.log(parentId);
5970
- console.log(this.app.currentUser.Permissions.filter(x => x.ParentId = parentId));
5971
- console.log('--------------');
5972
- return this.app.currentUser.Permissions.filter(x => x.ParentId = parentId).map(x => this.getPermissionClass(x));
5981
+ return this.app.currentUser.Permissions.filter(x => x.ParentId === parentId).map(x => this.getPermissionClass(x));
5973
5982
  }
5974
5983
  hasAccess(a) {
5975
5984
  return this.permissions ? this.permissions.hasAccess(a) : false;
@@ -6024,6 +6033,7 @@ class TableClass {
6024
6033
  this.page = 1;
6025
6034
  this.sort = null;
6026
6035
  this.queryParams = {};
6036
+ this.title = null;
6027
6037
  this.sortType = null;
6028
6038
  this.displayLabel = true;
6029
6039
  this.isReport = false;
@@ -6084,7 +6094,9 @@ class TableClass {
6084
6094
  return this.url + (this.isReport || isReport ? 'Report?' : 'List');
6085
6095
  }
6086
6096
  showInsertModal() {
6097
+ const insertAccess = this.permissions.getAccess('Insert');
6087
6098
  this.form.url = this.form.baseUrl = this.url + 'Insert';
6099
+ this.form.name = insertAccess.Name;
6088
6100
  this.form.method = Method.Post;
6089
6101
  this.form.inputs.filter(x => x.inEditDisabled).forEach(x => x.disabled = false);
6090
6102
  this.form.inputs.filter(x => !x.inEditVisible).forEach(x => x.visible = true);
@@ -6092,7 +6104,9 @@ class TableClass {
6092
6104
  }
6093
6105
  set(changeRows = null) {
6094
6106
  this.permission = true;
6095
- if (this.permissions && this.permissions.hasAccess('List')) {
6107
+ const listAccess = this.permissions.getAccess('List');
6108
+ if (this.permissions && listAccess !== null) {
6109
+ this.title = listAccess.Name;
6096
6110
  this.url = this.permissions.getUrl();
6097
6111
  if (this.permissions.Type !== PermissionTypeEnum.Form) {
6098
6112
  this.load();
@@ -6105,8 +6119,9 @@ class TableClass {
6105
6119
  this.permission = false;
6106
6120
  return;
6107
6121
  }
6108
- const insert = new InputClass(this.environment, this.l, this.name + 'InsertTitle', 'fad fa-plus fa-rotate-90', InputType.Button, 'w-u green h-30');
6109
- if (this.permissions.hasAccess('Insert')) {
6122
+ const insertAccess = this.permissions.getAccess('Insert');
6123
+ if (insertAccess != null) {
6124
+ const insert = new InputClass(this.environment, this.l, insertAccess.Name, 'fad fa-plus fa-rotate-90', InputType.Button, 'w-u green h-30');
6110
6125
  if (this.form) {
6111
6126
  this.form.url = this.form.baseUrl = this.url + 'Insert';
6112
6127
  if (!this.form.onTop) {
@@ -6124,8 +6139,15 @@ class TableClass {
6124
6139
  }
6125
6140
  }
6126
6141
  else {
6127
- insert.url = this.url;
6128
6142
  this.buttons.unshift(insert);
6143
+ if (this.modal) {
6144
+ insert.onClick = () => {
6145
+ this.modal.show();
6146
+ };
6147
+ }
6148
+ else {
6149
+ insert.url = this.url + 'Insert';
6150
+ }
6129
6151
  }
6130
6152
  }
6131
6153
  if ((this.permissions.hasAccess('Insert') || this.permissions.hasAccess('Update')) && this.form) {
@@ -6156,16 +6178,6 @@ class TableClass {
6156
6178
  this.modal.form = this.form;
6157
6179
  }
6158
6180
  }
6159
- else {
6160
- if (this.modal) {
6161
- insert.onClick = () => {
6162
- this.modal.show();
6163
- };
6164
- }
6165
- else {
6166
- insert.url = this.url + 'Insert';
6167
- }
6168
- }
6169
6181
  for (const option of this.permissions.getOptions()) {
6170
6182
  if (this.options.filter(x => x.name === option.Name).length > 0) {
6171
6183
  continue;
@@ -6199,6 +6211,7 @@ class TableClass {
6199
6211
  opt.modal.table.set();
6200
6212
  }
6201
6213
  if (opt.modal.form) {
6214
+ opt.modal.form.name = option.Name;
6202
6215
  opt.modal.form.url = opt.modal.form.baseUrl + 'Update/' + btn.row.Id;
6203
6216
  opt.modal.form.loadData(opt.modal.form.baseUrl + 'Get/' + btn.row.Id);
6204
6217
  opt.modal.form.onSuccessBase = () => {