@firestitch/system 12.4.0 → 12.4.1

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.
@@ -1,7 +1,7 @@
1
- import { OnInit, OnDestroy } from '@angular/core';
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { MatDialog } from '@angular/material/dialog';
3
- import { FsMessage } from '@firestitch/message';
4
3
  import { FsListComponent, FsListConfig } from '@firestitch/list';
4
+ import { FsMessage } from '@firestitch/message';
5
5
  import { Observable } from 'rxjs';
6
6
  import { ProcessState } from '../../enums';
7
7
  import { ProcessAction } from './../../interfaces/process-action';
@@ -26,9 +26,10 @@ export declare class ProcessesComponent implements OnInit, OnDestroy {
26
26
  private _destroy$;
27
27
  constructor(_dialog: MatDialog, _message: FsMessage);
28
28
  ngOnInit(): void;
29
- private _configList;
29
+ reload(): void;
30
30
  open(process: any): void;
31
31
  ngOnDestroy(): void;
32
+ private _configList;
32
33
  static ɵfac: i0.ɵɵFactoryDeclaration<ProcessesComponent, never>;
33
34
  static ɵcmp: i0.ɵɵComponentDeclaration<ProcessesComponent, "fs-system-processes", never, { "loadProcesses": "loadProcesses"; "loadProcess": "loadProcess"; "run": "run"; "kill": "kill"; "delete": "delete"; "download": "download"; "actions": "actions"; }, {}, never, never>;
34
35
  }
@@ -1,6 +1,6 @@
1
1
  export interface ProcessAction {
2
2
  label: string;
3
- click?: Function;
3
+ click?: (data?: any) => void;
4
4
  component?: any;
5
5
  menu?: boolean;
6
6
  }
@@ -1078,6 +1078,30 @@
1078
1078
  ProcessesComponent.prototype.ngOnInit = function () {
1079
1079
  this._configList();
1080
1080
  };
1081
+ ProcessesComponent.prototype.reload = function () {
1082
+ this.list.reload();
1083
+ };
1084
+ ProcessesComponent.prototype.open = function (process) {
1085
+ var _this = this;
1086
+ this._dialog.open(ProcessComponent, {
1087
+ data: {
1088
+ process: process,
1089
+ download: this.download,
1090
+ run: this.run,
1091
+ loadProcess: this.loadProcess,
1092
+ },
1093
+ width: '85%',
1094
+ })
1095
+ .afterClosed()
1096
+ .pipe(operators.takeUntil(this._destroy$))
1097
+ .subscribe(function () {
1098
+ _this.reload();
1099
+ });
1100
+ };
1101
+ ProcessesComponent.prototype.ngOnDestroy = function () {
1102
+ this._destroy$.next();
1103
+ this._destroy$.complete();
1104
+ };
1081
1105
  ProcessesComponent.prototype._configList = function () {
1082
1106
  var _this = this;
1083
1107
  this.config = {
@@ -1087,22 +1111,23 @@
1087
1111
  {
1088
1112
  type: filter.ItemType.Keyword,
1089
1113
  name: 'keyword',
1090
- label: 'Search'
1114
+ label: 'Search',
1091
1115
  },
1092
1116
  {
1093
1117
  type: filter.ItemType.Select,
1094
1118
  name: 'state',
1095
1119
  label: 'Status',
1096
- values: ProcessStates
1120
+ values: ProcessStates,
1097
1121
  },
1098
1122
  ],
1099
1123
  fetch: function (query) {
1100
1124
  return _this.loadProcesses(query)
1101
1125
  .pipe(operators.map(function (response) { return ({ data: response.data, paging: response.paging }); }));
1102
- }
1126
+ },
1103
1127
  };
1104
1128
  if (this.run) {
1105
- this.config.rowActions.push({
1129
+ this.config.rowActions
1130
+ .push({
1106
1131
  label: 'Run',
1107
1132
  show: function (process) {
1108
1133
  return process.state !== exports.ProcessState.Running;
@@ -1111,13 +1136,13 @@
1111
1136
  _this._message.info('Running process...');
1112
1137
  _this.run(data)
1113
1138
  .subscribe(function () {
1114
- _this.list.reload();
1139
+ _this.reload();
1115
1140
  _this._message.success('Succesfully ran process');
1116
1141
  });
1117
1142
  setTimeout(function () {
1118
- _this.list.reload();
1143
+ _this.reload();
1119
1144
  }, 500);
1120
- }
1145
+ },
1121
1146
  });
1122
1147
  }
1123
1148
  if (this.kill) {
@@ -1130,13 +1155,13 @@
1130
1155
  _this._message.info('Killing process...');
1131
1156
  _this.kill(data)
1132
1157
  .subscribe(function () {
1133
- _this.list.reload();
1158
+ _this.reload();
1134
1159
  _this._message.success('Succesfully killed process');
1135
1160
  });
1136
1161
  setTimeout(function () {
1137
- _this.list.reload();
1162
+ _this.reload();
1138
1163
  }, 500);
1139
- }
1164
+ },
1140
1165
  });
1141
1166
  }
1142
1167
  if (this.delete) {
@@ -1145,10 +1170,10 @@
1145
1170
  click: function (data) {
1146
1171
  _this.delete(data)
1147
1172
  .subscribe(function () {
1148
- _this.list.reload();
1173
+ _this.reload();
1149
1174
  _this._message.success('Deleted process');
1150
1175
  });
1151
- }
1176
+ },
1152
1177
  });
1153
1178
  }
1154
1179
  this.actions.forEach(function (action) {
@@ -1156,39 +1181,24 @@
1156
1181
  primary: false,
1157
1182
  label: action.label,
1158
1183
  menu: action.menu,
1159
- click: function () {
1184
+ click: function (data) {
1160
1185
  if (action.click) {
1161
- action.click();
1186
+ action.click(data);
1162
1187
  }
1163
1188
  if (action.component) {
1164
- var dialogRef = _this._dialog.open(action.component, {
1165
- width: '800px'
1166
- });
1167
- dialogRef.afterClosed()
1189
+ _this._dialog.open(action.component, {
1190
+ width: '800px',
1191
+ })
1192
+ .afterClosed()
1168
1193
  .pipe(operators.takeUntil(_this._destroy$))
1169
1194
  .subscribe(function () {
1170
- _this.list.reload();
1195
+ _this.reload();
1171
1196
  });
1172
1197
  }
1173
1198
  },
1174
1199
  });
1175
1200
  });
1176
1201
  };
1177
- ProcessesComponent.prototype.open = function (process) {
1178
- this._dialog.open(ProcessComponent, {
1179
- data: {
1180
- process: process,
1181
- download: this.download,
1182
- run: this.run,
1183
- loadProcess: this.loadProcess,
1184
- },
1185
- width: '85%'
1186
- });
1187
- };
1188
- ProcessesComponent.prototype.ngOnDestroy = function () {
1189
- this._destroy$.next();
1190
- this._destroy$.complete();
1191
- };
1192
1202
  return ProcessesComponent;
1193
1203
  }());
1194
1204
  ProcessesComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ProcessesComponent, deps: [{ token: i1__namespace.MatDialog }, { token: i1__namespace$1.FsMessage }], target: i0__namespace.ɵɵFactoryTarget.Component });