@bizdoc/core 1.11.0-next.2 → 1.11.0-next.6

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.
@@ -1262,8 +1262,8 @@ class MailboxService {
1262
1262
  reportProgress: true
1263
1263
  });
1264
1264
  }
1265
- removeattachment(id, fileId) {
1266
- return this._http.delete(`/api/attachments/${id}/${fileId}`);
1265
+ removeattachment(recipientId, fileId) {
1266
+ return this._http.delete(`/api/attachments/${recipientId}/${fileId}`);
1267
1267
  }
1268
1268
  read(id, read, folderId, received) {
1269
1269
  return this._http.put(`/api/mailbox/read/${id}`, undefined, { params: { read } }).pipe(tap(() => folderId && this._updateunreadcounter(received, folderId, read ? 1 : -1)));
@@ -1293,13 +1293,13 @@ class MailboxService {
1293
1293
  });
1294
1294
  }));
1295
1295
  }
1296
- checkOut(documentId, version, attachmentId) {
1297
- return this._http.put(`/api/attachments/${documentId}/${attachmentId}/checkout`, null, { params: { version } });
1296
+ checkOut(recipientId, version, attachmentId) {
1297
+ return this._http.put(`/api/attachments/${recipientId}/${attachmentId}/checkout`, null, { params: { version } });
1298
1298
  }
1299
- checkIn(documentId, version, attachmentId, file) {
1299
+ checkIn(recipientId, version, attachmentId, file) {
1300
1300
  const fd = new FormData();
1301
1301
  fd.append(file.name, file);
1302
- const req = new HttpRequest('PUT', `/api/attachments/${documentId}/${attachmentId}/checkin?version=${version}`, fd, {
1302
+ const req = new HttpRequest('PUT', `/api/attachments/${recipientId}/${attachmentId}/checkin?version=${version}`, fd, {
1303
1303
  reportProgress: true,
1304
1304
  });
1305
1305
  //const initialState: UploadEvent = { state: 'PENDING', progress: 0 }
@@ -1354,10 +1354,8 @@ class MailboxService {
1354
1354
  if (options.isPrivate)
1355
1355
  url += '&isprivate=true';
1356
1356
  }
1357
- const req = new HttpRequest('POST', url, {
1358
- body: fd,
1357
+ const req = new HttpRequest('POST', url, fd, {
1359
1358
  reportProgress: true,
1360
- observe: 'events',
1361
1359
  });
1362
1360
  this._http.request(req).subscribe(event => {
1363
1361
  if (event instanceof ProgressEvent) {
@@ -5575,7 +5573,9 @@ class CubeService {
5575
5573
  * @param axis name
5576
5574
  */
5577
5575
  values(cube, axis, dependencies) {
5578
- return this._http.get(`/api/cube/segmentvalues/${cube}/${axis}`, { params: dependencies });
5576
+ let cacheId = cube + axis;
5577
+ dependencies && Object.keys(dependencies).forEach(k => cacheId += k);
5578
+ return this._cacheOr(cacheId, () => this._http.get(`/api/cube/segmentvalues/${cube}/${axis}`, { params: dependencies }));
5579
5579
  }
5580
5580
  /**
5581
5581
  * get axis combinations
@@ -5676,8 +5676,11 @@ class CubeService {
5676
5676
  const options = this._session.profile.cubes.find(c => c.name === cube);
5677
5677
  const axisTypeMap = {};
5678
5678
  options.axes.forEach(x => axisTypeMap[x.name] = x.dataType);
5679
- if (!r.length)
5679
+ if (!r.length) {
5680
+ observe.next(r);
5681
+ observe.complete();
5680
5682
  return;
5683
+ }
5681
5684
  const base = r[0].points;
5682
5685
  r.forEach((s, i) => {
5683
5686
  s.points.forEach(p => {
@@ -5884,19 +5887,19 @@ class CubeFilterComponent {
5884
5887
  this._cube.axes.forEach(a => {
5885
5888
  if (a.hidden || a.selectionMode === 'None')
5886
5889
  return;
5887
- let { decendentOf } = a;
5888
- if (decendentOf) {
5890
+ let { descendentOf } = a;
5891
+ if (descendentOf) {
5889
5892
  let ancestors = this._ancestors[a.name] = [];
5890
- while (decendentOf) {
5891
- let axis = this._cube.axes.find(a => a.name === decendentOf);
5893
+ while (descendentOf) {
5894
+ let axis = this._cube.axes.find(a => a.name === descendentOf);
5892
5895
  ancestors.push(axis.name);
5893
5896
  if (a.selectionMode !== 'Pattern') {
5894
- if (!this._decendents[decendentOf])
5895
- this._decendents[decendentOf] = [a.name];
5897
+ if (!this._decendents[descendentOf])
5898
+ this._decendents[descendentOf] = [a.name];
5896
5899
  else
5897
- this._decendents[decendentOf].push(a.name);
5900
+ this._decendents[descendentOf].push(a.name);
5898
5901
  }
5899
- decendentOf = axis.decendentOf;
5902
+ descendentOf = axis.descendentOf;
5900
5903
  }
5901
5904
  }
5902
5905
  const ctrl = config[a.name] = this._fb.control(this.axes[a.name]);
@@ -6711,7 +6714,7 @@ class AttachmentsComponent {
6711
6714
  this.ngOnChanges();
6712
6715
  }
6713
6716
  discard(item) {
6714
- const task = () => this._mailbox.removeattachment(this.model.documentId, item.id).subscribe(() => {
6717
+ const task = () => this._mailbox.removeattachment(this.model.id, item.id).subscribe(() => {
6715
6718
  //item.deleted = true;
6716
6719
  this.model.attachments.remove(item);
6717
6720
  this.ngOnChanges();
@@ -8221,7 +8224,7 @@ class ComposeFormComponent {
8221
8224
  fileMap[f.name] = model;
8222
8225
  this.model.attachments.push(model);
8223
8226
  });
8224
- return this._mailbox.upload(this.model.documentId, this.model.formId, this.model.version, files).
8227
+ return this._mailbox.upload(this.model.id, this.model.formId, this.model.version, files).
8225
8228
  pipe(tap((r) => {
8226
8229
  files.length === 1 ? this._sb.toast(!exists ? 'UploadOk' : 'UploadVersionOk', files[0].name) :
8227
8230
  this._sb.toast('UploadMany', files.length);
@@ -9297,14 +9300,13 @@ class CubeChartComponent {
9297
9300
  }
9298
9301
  CubeChartComponent.nextId = 0;
9299
9302
  CubeChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CubeChartComponent, deps: [{ token: CubeService }, { token: PromptService }, { token: TranslateService }, { token: SessionService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
9300
- CubeChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: CubeChartComponent, selector: "bizdoc-cube-chart", inputs: { width: "width", height: "height", cube: "cube", xAxis: "xAxis", series: "series", indices: "indices", filters: "filters", yAxis: "yAxis", chartType: "chartType", indicesChartType: "indicesChartType", scope: "scope", loading: "loading", palettes: "palettes" }, outputs: { explore: "explore", loadingChange: "loadingChange" }, host: { attributes: { "dir": "ltr" }, properties: { "id": "this.id" }, classAttribute: "cube-view" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
9303
+ CubeChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: CubeChartComponent, selector: "bizdoc-cube-chart", inputs: { width: "width", height: "height", cube: "cube", xAxis: "xAxis", series: "series", indices: "indices", filters: "filters", yAxis: "yAxis", chartType: "chartType", indicesChartType: "indicesChartType", scope: "scope", loading: "loading", palettes: "palettes" }, outputs: { explore: "explore", loadingChange: "loadingChange" }, host: { properties: { "id": "this.id" }, classAttribute: "cube-view" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
9301
9304
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CubeChartComponent, decorators: [{
9302
9305
  type: Component,
9303
9306
  args: [{
9304
9307
  selector: 'bizdoc-cube-chart',
9305
9308
  template: '',
9306
9309
  host: {
9307
- dir: 'ltr',
9308
9310
  class: 'cube-view'
9309
9311
  }
9310
9312
  }]
@@ -21935,10 +21937,8 @@ let UsageReportArgs = class UsageReportArgs {
21935
21937
  this.exclude.push(exclude);
21936
21938
  }
21937
21939
  const cube = this._session.profile.cubes.find(c => c.name == name) || this._session.profile.cubes[0], controls = {};
21938
- this._axes = cube.axes.filter(a => !a.hidden && a.selectionMode !== 'None');
21939
- this._axes.forEach(a => {
21940
- controls[a.name] = this._fb.control(null);
21941
- });
21940
+ const axes = cube.axes.filter(a => !a.hidden && a.selectionMode !== 'None');
21941
+ axes.forEach(a => controls[a.name] = this._fb.control(null));
21942
21942
  this.form = this._fb.group(controls);
21943
21943
  }
21944
21944
  ngOnInit() {
@@ -25775,7 +25775,7 @@ class FileInput {
25775
25775
  // this._sb.error(this._translate.get('CheckInMatchErr', item.fileName));
25776
25776
  // return;
25777
25777
  //}
25778
- this._mailbox.checkIn(this._model.documentId, this._model.version, item.id, files[0]).subscribe(a => {
25778
+ this._mailbox.checkIn(this._model.id, this._model.version, item.id, files[0]).subscribe(a => {
25779
25779
  //if (a instanceof UploadEvent) {
25780
25780
  // Object.assign(item, {
25781
25781
  // progress: a.loaded / a.total
@@ -25788,14 +25788,14 @@ class FileInput {
25788
25788
  });
25789
25789
  }
25790
25790
  checkOut(item) {
25791
- this._mailbox.checkOut(this._model.documentId, this._model.version, item.id).
25791
+ this._mailbox.checkOut(this._model.id, this._model.version, item.id).
25792
25792
  subscribe(() => {
25793
25793
  item.checkedOut = new Date();
25794
25794
  this.download(item);
25795
25795
  });
25796
25796
  }
25797
25797
  discard(item) {
25798
- const task = () => this._mailbox.removeattachment(this._model.documentId, item.id).subscribe(() => {
25798
+ const task = () => this._mailbox.removeattachment(this._model.id, item.id).subscribe(() => {
25799
25799
  item.deleted = true;
25800
25800
  if (this.multiple) {
25801
25801
  this.items.remove(item);
@@ -25845,7 +25845,7 @@ class FileInput {
25845
25845
  for (let item of checkedOut) {
25846
25846
  let file = files.find(f => f.name.startsWith(item.fileName));
25847
25847
  if (file) {
25848
- let observable = this._mailbox.checkIn(this._model.documentId, this._model.version, item.id, file).pipe(tap$1(e => {
25848
+ let observable = this._mailbox.checkIn(this._model.id, this._model.version, item.id, file).pipe(tap$1(e => {
25849
25849
  //Object.assign(item, a, { progress: null });
25850
25850
  }));
25851
25851
  observables.push(observable);
@@ -25962,7 +25962,7 @@ class FileInput {
25962
25962
  _upload(files) {
25963
25963
  const observables = [];
25964
25964
  for (let file of files) {
25965
- let observable = this._mailbox.upload(this._model.documentId, this._model.formId, this._model.version, [file], { isPrivate: true }).
25965
+ let observable = this._mailbox.upload(this._model.id, this._model.formId, this._model.version, [file], { isPrivate: true }).
25966
25966
  pipe(tap$1(e => {
25967
25967
  // if (e.progress) {
25968
25968
  // }