Skip to content

Commit

Permalink
* added support for dragging and resizing restrictions for widgets by…
Browse files Browse the repository at this point in the history
… URL parameters: `nodrag=1` and `noresize=1` (#392)

* pivot top left cell now empty (#391)
  • Loading branch information
agnybida committed Aug 14, 2023
1 parent 16ac6df commit 9173f4d
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deep-see-web",
"version": "3.2.2",
"version": "3.2.3",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config=proxy.conf.json --port 4007",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class DashboardScreenComponent extends DashboardEditingClass implements O
constructor(@Inject(Injector) protected inj: Injector) {
super(inj);

this.checkRestrictions();
this.hs.resetSearch();
this.hs.hideMobileFilterButton();

Expand Down Expand Up @@ -977,4 +978,13 @@ export class DashboardScreenComponent extends DashboardEditingClass implements O
enabled: false
};
}

private checkRestrictions() {
if (this.route.snapshot.queryParamMap.get('nodrag') === '1') {
this.tilesOptions.draggable.enabled = false;
}
if (this.route.snapshot.queryParamMap.get('noresize') === '1') {
this.tilesOptions.resizable.enabled = false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<div class="divider"></div>

<div class="drag-handle" [class.expanded]="widget?.isExpanded" (dblclick)="onHeaderDoubleClick()"></div>
<div class="drag-handle" [class.no-drag]="noDrag" [class.expanded]="widget?.isExpanded" (dblclick)="onHeaderDoubleClick()"></div>

<!--<span class="right-side">-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
border-bottom: var(--cl-widget-header-border);

& > .drag-handle {
position: absolute;
position: absolute;
left: -20px;
right: -20px;
Expand Down Expand Up @@ -115,6 +114,10 @@
justify-content: center;
align-items: center;

&.no-drag {
cursor: default;
}

// Disable drag when widget is expanded to fullscreen
&.expanded {
cursor: default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class WidgetHeaderComponent implements OnInit, OnDestroy {
hasFilters = false;
filtersTooltip = '';
private subFiltersChanged: Subscription;
noDrag = false;

constructor(private ss: StorageService,
private us: UtilService,
Expand All @@ -38,6 +39,7 @@ export class WidgetHeaderComponent implements OnInit, OnDestroy {
private hs: HeaderService,
private eds: EditorService,
private route: ActivatedRoute) {
this.noDrag = this.route.snapshot.queryParamMap.get('nodrag') === '1';
}

ngOnInit() {
Expand Down
3 changes: 2 additions & 1 deletion src/app/lib/lightPivotTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3901,7 +3901,8 @@ PivotView.prototype.renderRawData = function (data) {
};

// top left header setup
header.textContent = info.leftHeaderColumnsNumber ? rawData[0][0].value : "";
// Request by Shvarov, make top left cell empty (DSW repo #391)
header.textContent = '';
if (rawData[0][0].style && !LISTING) header.setAttribute("style", rawData[0][0].style);
if (this.tablesStack.length > 1 && !this.controller.CONFIG["hideButtons"]) {
header.className += "back ";
Expand Down
12 changes: 12 additions & 0 deletions src/app/services/filter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ export class FilterService {


loadFiltersFromUrl() {
/*
let query = window.location.hash.split('?')[1];
query = query.replace(/&\.%5B/g, '%26.%5B');
query = query.replace(/&\.\[/g, '%26.%5B');
const p = query.split('&');
let param = '';
p.forEach(q => {
if (q.split('=')[0].toLowerCase() === 'filters') {
param = q.split('=')[1];
};
});
*/
let param = this.route.snapshot.queryParamMap.get('FILTERS');
if (!param) {
// Workaround for invalid escaped links where "=" char is escaped. Requested by Shvarov
Expand Down
6 changes: 5 additions & 1 deletion src/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#### 3.2.3
* added support for dragging and resizing restrictions for widgets by URL parameters: `nodrag=1` and `noresize=1` (#392)
* pivot top left cell now empty (#391)

#### 3.2.2
* fixed issues with filter URLs on shared dashboard (interval filters/multiple filters)
* fixed issues with filter URLs on the shared dashboard (interval filters/multiple filters)
* added support for wrong escaped dashboard links. when "=" character has been escaped, but it shouldn't

#### 3.2.1
Expand Down

0 comments on commit 9173f4d

Please sign in to comment.