-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
144 changed files
with
5,683 additions
and
15 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HtmlViewer = void 0; | ||
const tslib_1 = require("tslib"); | ||
const core_1 = require("@angular/core"); | ||
const platform_browser_1 = require("@angular/platform-browser"); | ||
const base_widget_class_1 = require("../app/components/widgets/base-widget.class"); | ||
let HtmlViewer = class HtmlViewer extends base_widget_class_1.BaseWidget { | ||
constructor() { | ||
super(...arguments); | ||
this.isSpinner = false; | ||
this.san = (0, core_1.inject)(platform_browser_1.DomSanitizer); | ||
} | ||
static { this.AddonInfo = { | ||
// Version of addon system, should be specified manually as number, not reference | ||
// version always should be equal to BaseWidget.CURRENT_ADDON_VERSION | ||
// used to compare unsupported addons when breaking changes are made into BaseWidget | ||
// Note: do not use reference to BaseWidget.CURRENT_ADDON_VERSIO here! | ||
// specify number MANUALLY | ||
version: 1, | ||
// Widget type | ||
// 'custom' for all non-standard widgets | ||
// 'chart' for highcharts widget | ||
type: 'custom' | ||
}; } | ||
ngOnInit() { | ||
this.url = this.san.bypassSecurityTrustResourceUrl(this.getUrl()); | ||
this.subOnFilter = this.fs.onApplyFilter.subscribe(flt => { | ||
this.url = this.san.bypassSecurityTrustResourceUrl(this.getUrl().replace('$$$FILTERS', encodeURIComponent(flt.value))); | ||
}); | ||
} | ||
getUrl() { | ||
return this.widget?.properties?.Data || ''; | ||
} | ||
ngOnDestroy() { | ||
this.subOnFilter.unsubscribe(); | ||
super.ngOnDestroy(); | ||
} | ||
}; | ||
exports.HtmlViewer = HtmlViewer; | ||
exports.HtmlViewer = HtmlViewer = tslib_1.__decorate([ | ||
(0, core_1.Component)({ | ||
standalone: true, | ||
template: ` | ||
<iframe [src]="url" style="border: none; width:100%; height:100%; flex: 1 1 100%"></iframe>` | ||
}) | ||
], HtmlViewer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SimpleAddon = void 0; | ||
const tslib_1 = require("tslib"); | ||
const core_1 = require("@angular/core"); | ||
const base_widget_class_1 = require("../app/components/widgets/base-widget.class"); | ||
let SimpleAddon = class SimpleAddon extends base_widget_class_1.BaseWidget { | ||
static { this.AddonInfo = { | ||
// Widget type | ||
// 'custom' for all non-standard widgets | ||
// 'chart' for highcharts widget | ||
type: 'custom' | ||
}; } | ||
/** | ||
* Initialization | ||
*/ | ||
ngOnInit() { | ||
super.ngOnInit(); | ||
// Initialize addon here | ||
console.log('Hello!'); | ||
} | ||
/** | ||
* Initialization after DOM element has been created and accessible | ||
*/ | ||
ngAfterViewInit() { | ||
// Here you can access this.el.nativeElement, to manipulate DOM | ||
this.drawOnCanvas(); | ||
} | ||
/** | ||
* Draw on canvas | ||
*/ | ||
drawOnCanvas() { | ||
const canvas = this.canvas?.nativeElement; | ||
const ctx = canvas?.getContext('2d'); | ||
if (!ctx) { | ||
return; | ||
} | ||
const x = canvas.width / 2; | ||
const y = canvas.height / 2; | ||
ctx.clearRect(0, 0, canvas.width, canvas.height); | ||
ctx.beginPath(); | ||
ctx.ellipse(x, y, Math.min(x, y), Math.min(x, y), 0, 0, Math.PI * 2); | ||
ctx.closePath(); | ||
ctx.stroke(); | ||
} | ||
/** | ||
* Request data from server if needed | ||
*/ | ||
requestData() { | ||
super.requestData(); | ||
// You can make you own data request here if it not supposed to run MDX | ||
// Or you need to call external REST API | ||
} | ||
/** | ||
* Parse retrieved data | ||
*/ | ||
retrieveData(data) { | ||
super.retrieveData(data); | ||
// Here you can parse data, and display it as needed | ||
// data - is MDX result | ||
if (data.Error) { | ||
return; | ||
} | ||
console.log(data); | ||
} | ||
/** | ||
* Drilldown processing | ||
*/ | ||
doDrill(path, name, category, noDrillCallback) { | ||
return super.doDrill(path, name, category, noDrillCallback); | ||
} | ||
/** | ||
* Drillup processing | ||
*/ | ||
doDrillUp() { | ||
super.doDrillUp(); | ||
} | ||
/** | ||
* Resize callback | ||
*/ | ||
onResize() { | ||
// Use to redraw widget after resize event | ||
super.onResize(); | ||
// Adjust canvas size to new widget size | ||
const canvas = this.canvas?.nativeElement; | ||
if (!canvas) { | ||
return; | ||
} | ||
canvas.width = canvas.offsetWidth; | ||
canvas.height = canvas.offsetHeight; | ||
// Redraw | ||
this.drawOnCanvas(); | ||
} | ||
}; | ||
exports.SimpleAddon = SimpleAddon; | ||
tslib_1.__decorate([ | ||
(0, core_1.ViewChild)('canvas') | ||
], SimpleAddon.prototype, "canvas", void 0); | ||
exports.SimpleAddon = SimpleAddon = tslib_1.__decorate([ | ||
(0, core_1.Component)({ | ||
selector: 'dsw-simple-addon', | ||
standalone: true, | ||
template: ` | ||
<h2>Hello, this is simple addon component</h2> | ||
<button (click)="requestData()">Refresh</button> | ||
<canvas #canvas></canvas> | ||
`, | ||
styles: [` | ||
:host { | ||
padding: 10px; | ||
} | ||
h1 { | ||
color: green; | ||
} | ||
canvas { | ||
width: 100%; | ||
height: 100%; | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
pointer-events: none; | ||
} | ||
`] | ||
}) | ||
], SimpleAddon); |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.