Skip to content

Commit f1d42a6

Browse files
Merge pull request #101 from mendix/feat/removing-warnings
Removing warnings
2 parents 329419a + b1eced2 commit f1d42a6

File tree

13 files changed

+53
-40
lines changed

13 files changed

+53
-40
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## 1.3.14 - 2021-06-22
10+
11+
### Fixed
12+
13+
- We fixed all `logger` deprecated warnings being thrown during the execution.
14+
15+
## 1.3.13 - 2021-06-02
16+
917
### Fixed
1018

1119
- Fixed an issue introduced in v1.3.12 where if the list view's search is not enabled, then the widget would error on any list view control widget interaction.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "list-view-controls",
33
"widgetName": "ListViewControls",
4-
"version": "1.3.13",
4+
"version": "1.3.14",
55
"description": "Search and filter Mendix list views",
66
"copyright": "Mendix BV",
77
"scripts": {

src/CheckBoxFilter/components/CheckBoxFilterContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export default class CheckboxFilterContainer extends Component<ContainerProps, C
127127

128128
private applyFilter(isChecked: boolean, restoreState = false) {
129129
if (this.dataSourceHelper) {
130-
logger.debug(this.props.uniqueid, "applyFilter", isChecked, this.props.group);
130+
mx.logger.debug(this.props.uniqueid, "applyFilter", isChecked, this.props.group);
131131
this.dataSourceHelper.setConstraint(this.props.uniqueid, this.getConstraint(isChecked), this.props.group, restoreState);
132132
this.setState({ isChecked });
133133
}

src/DropDownFilter/components/DropDownFilterContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export default class DropDownFilterContainer extends Component<ContainerProps, C
148148
private applyFilter(selectedFilter: FilterProps, restoreState = false) {
149149
const constraint = this.getConstraint(selectedFilter);
150150
if (this.dataSourceHelper) {
151-
logger.debug(this.props, this.props.uniqueid, "applyFilter", constraint);
151+
mx.logger.debug(this.props, this.props.uniqueid, "applyFilter", constraint);
152152
this.dataSourceHelper.setConstraint(this.props.uniqueid, constraint, undefined, restoreState);
153153
}
154154
this.setState({ selectedOption: selectedFilter });

src/DropDownSort/components/DropDownSortContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export default class DropDownSortContainer extends Component<ContainerProps, Con
162162
const { targetListView } = this.state;
163163

164164
if (targetListView && this.dataSourceHelper) {
165-
logger.debug(this.props.uniqueid, "updateSort", selectedOption.name, selectedOption.sort);
165+
mx.logger.debug(this.props.uniqueid, "updateSort", selectedOption.name, selectedOption.sort);
166166
this.dataSourceHelper.setSorting(this.props.uniqueid, [ selectedOption.name, selectedOption.sort ], restoreState);
167167
this.setState({ selectedOption });
168168
this.publishWidgetChanges(selectedOption);

src/Pagination/components/PaginationContainer.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class PaginationContainer extends Component<ModelerProps, PaginationContainerSta
5252
constructor(props: ModelerProps) {
5353
super(props);
5454

55-
logger.debug(this.props.uniqueid, ".constructor");
55+
mx.logger.debug(this.props.uniqueid, ".constructor");
5656

5757
this.updateListView = this.updateListView.bind(this);
5858
this.translateMessageStatus = this.translateMessageStatus.bind(this);
@@ -76,21 +76,21 @@ class PaginationContainer extends Component<ModelerProps, PaginationContainerSta
7676
}
7777

7878
async componentDidMount() {
79-
logger.debug(this.props.uniqueid, ".componentDidMount");
79+
mx.logger.debug(this.props.uniqueid, ".componentDidMount");
8080
const isValidConfig = !!mx.session.getConfig("uiconfig.translations");
8181
if (!isValidConfig) {
8282
try {
8383
await getTranslations();
8484
} catch (e) {
85-
logger.debug(this.props.uniqueid, ".loadingTranslations", e.message);
85+
mx.logger.debug(this.props.uniqueid, ".loadingTranslations", e.message);
8686
}
8787
this.setState({ loadTranslations: true });
8888
}
8989
SharedUtils.delay(this.connectToListView.bind(this), this.checkListViewAvailable.bind(this), 20);
9090
}
9191

9292
render() {
93-
logger.debug(this.props.uniqueid, ".render");
93+
mx.logger.debug(this.props.uniqueid, ".render");
9494
return createElement("div",
9595
{
9696
className: classNames("widget-pagination", this.props.class),
@@ -105,7 +105,7 @@ class PaginationContainer extends Component<ModelerProps, PaginationContainerSta
105105
}
106106

107107
componentWillUnmount() {
108-
logger.debug(this.props.uniqueid, ".componentWillUnmount");
108+
mx.logger.debug(this.props.uniqueid, ".componentWillUnmount");
109109
showLoadMoreButton(this.state.targetListView);
110110
this.viewStateManager.destroy();
111111
}
@@ -115,7 +115,7 @@ class PaginationContainer extends Component<ModelerProps, PaginationContainerSta
115115
}
116116

117117
private checkListViewAvailable(): boolean {
118-
logger.debug(this.props.uniqueid, ".checkListViewAvailable");
118+
mx.logger.debug(this.props.uniqueid, ".checkListViewAvailable");
119119
if (!this.widgetDom) {
120120
return false;
121121
}
@@ -129,11 +129,11 @@ class PaginationContainer extends Component<ModelerProps, PaginationContainerSta
129129
}
130130

131131
private renderPageButton(): ReactNode {
132-
logger.debug(this.props.uniqueid, ".renderPageButton");
132+
mx.logger.debug(this.props.uniqueid, ".renderPageButton");
133133

134134
if (this.state.validationPassed && this.state.pageSize && this.state.targetListView!._datasource.getSetSize() > 0) {
135135
const { offset, pageSize } = this.state;
136-
logger.debug(this.props.uniqueid, ".renderPageButton pagesize, offset, listsize", pageSize, offset, this.state.targetListView!._datasource.getSetSize());
136+
mx.logger.debug(this.props.uniqueid, ".renderPageButton pagesize, offset, listsize", pageSize, offset, this.state.targetListView!._datasource.getSetSize());
137137

138138
return createElement(Pagination, {
139139
getMessageStatus: this.translateMessageStatus,
@@ -152,7 +152,7 @@ class PaginationContainer extends Component<ModelerProps, PaginationContainerSta
152152
}
153153

154154
public updateListView(offSet?: number, pageSize?: number) {
155-
logger.debug(this.props.uniqueid, ".updateListView");
155+
mx.logger.debug(this.props.uniqueid, ".updateListView");
156156
if (this.state.validationPassed) {
157157
this.setState({
158158
offset: offSet !== undefined ? offSet : this.state.offset,
@@ -194,10 +194,10 @@ class PaginationContainer extends Component<ModelerProps, PaginationContainerSta
194194
}
195195

196196
private beforeListViewDataRender(targetListView: DataSourceHelperListView) {
197-
logger.debug(this.props.uniqueid, ".beforeListViewDataRender");
197+
mx.logger.debug(this.props.uniqueid, ".beforeListViewDataRender");
198198

199199
dojoAspect.before(targetListView, "_renderData", () => {
200-
logger.debug(this.props.uniqueid, "_renderData.before");
200+
mx.logger.debug(this.props.uniqueid, "_renderData.before");
201201

202202
const datasource = targetListView._datasource;
203203
if (datasource.getSetSize() === 0) {
@@ -229,7 +229,7 @@ class PaginationContainer extends Component<ModelerProps, PaginationContainerSta
229229
listSize: datasource.getSetSize()
230230
});
231231
} else {
232-
logger.debug(this.props.uniqueid, ".initialLoading False, pagingLoading False");
232+
mx.logger.debug(this.props.uniqueid, ".initialLoading False, pagingLoading False");
233233
const previousOffset = this.state.offset;
234234
const listSize = datasource.getSetSize();
235235
let offset = previousOffset;
@@ -258,7 +258,7 @@ class PaginationContainer extends Component<ModelerProps, PaginationContainerSta
258258
}
259259

260260
private afterListViewLoaded(targetListView: DataSourceHelperListView) {
261-
logger.debug(this.props.uniqueid, ".afterListViewLoad");
261+
mx.logger.debug(this.props.uniqueid, ".afterListViewLoad");
262262
// Initial load of list view, also take in account the previous page state
263263
const datasource = targetListView._datasource;
264264
const pageSize = this.state.pageSize ? this.state.pageSize : datasource.getPageSize() && datasource.getPageSize() || 10;
@@ -271,9 +271,9 @@ class PaginationContainer extends Component<ModelerProps, PaginationContainerSta
271271
}
272272

273273
private afterListViewDataRender(targetListView: DataSourceHelperListView) {
274-
logger.debug(this.props.uniqueid, ".afterListViewDataRender");
274+
mx.logger.debug(this.props.uniqueid, ".afterListViewDataRender");
275275
dojoAspect.after(targetListView, "_renderData", () => {
276-
logger.debug(this.props.uniqueid, "_renderData.after");
276+
mx.logger.debug(this.props.uniqueid, "_renderData.after");
277277
resetListViewHeight(targetListView.domNode as HTMLElement);
278278
});
279279
}

src/Pagination/utils/ContainerUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const getListNode = (targetNode: HTMLElement): HTMLUListElement => {
4444
};
4545

4646
export const setListNodeToEmpty = (targetNode: HTMLElement) => {
47-
logger.debug("setListNodeToEmpty");
47+
mx.logger.debug("setListNodeToEmpty");
4848
// Explicitly remove children as IE does not like listNode.innerHTML = "";
4949
const listNode = targetNode.querySelector("ul") as HTMLUListElement;
5050
while (listNode.firstChild) {
@@ -53,12 +53,12 @@ export const setListNodeToEmpty = (targetNode: HTMLElement) => {
5353
};
5454

5555
export const showLoader = (targetListView: DataSourceHelperListView) => {
56-
logger.debug("showLoader");
56+
mx.logger.debug("showLoader");
5757
targetListView.domNode.classList.add("widget-pagination-loading");
5858
};
5959

6060
export const hideLoader = (targetListView: DataSourceHelperListView) => {
61-
logger.debug("hideLoader");
61+
mx.logger.debug("hideLoader");
6262
targetListView.domNode.classList.remove("widget-pagination-loading");
6363
};
6464

@@ -84,6 +84,6 @@ export const getTranslations = async (): Promise<void> => {
8484
const localeIndex = metadataJson.languages.indexOf(localeCode);
8585
window.__widgets_translations = Object.keys(systemTexts).reduce((translations, currentKey) => ({ ...translations, [currentKey]: systemTexts[currentKey][localeIndex] }), {});
8686
} else {
87-
logger.error("Error while loading translations");
87+
mx.logger.error("Error while loading translations");
8888
}
8989
};

src/Shared/DataSourceHelper/DataSourceHelper.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class DataSourceHelper {
4747
this.originalSort = window.mx.isOffline() ? this.widget._datasource._sort : this.widget._datasource._sorting;
4848

4949
aspect.after(widget, "storeState", (store: (key: string, value: any) => void) => {
50-
logger.debug("after storeState");
50+
mx.logger.debug("after storeState");
5151
if (widget.__customWidgetDataSourceHelper) {
5252
const sorting = widget.__customWidgetDataSourceHelper.sorting && widget.__customWidgetDataSourceHelper.originalSort;
5353
store("lvcSorting", sorting);
@@ -98,13 +98,13 @@ export class DataSourceHelper {
9898
}
9999

100100
private registerUpdate(restoreState: boolean) {
101-
logger.debug("DataSourceHelper .registerUpdate");
101+
mx.logger.debug("DataSourceHelper .registerUpdate");
102102
if (this.timeoutHandle) {
103103
window.clearTimeout(this.timeoutHandle);
104104
}
105105
if (!this.updateInProgress) {
106106
this.timeoutHandle = window.setTimeout(() => {
107-
logger.debug("DataSourceHelper .execute");
107+
mx.logger.debug("DataSourceHelper .execute");
108108
this.updateInProgress = true;
109109
// TODO Check if there's currently no update happening on the listView coming from another
110110
// Feature/functionality/widget which does not use DataSourceHelper
@@ -215,12 +215,12 @@ export class DataSourceHelper {
215215
} else {
216216
this.widget._datasource._sorting = sorting;
217217
}
218-
logger.debug("DataSourceHelper .set sort and constraint");
218+
mx.logger.debug("DataSourceHelper .set sort and constraint");
219219
const offset = this.widget._datasource.getOffset();
220220
const pageSize = this.widget._datasource.getPageSize();
221221
if (!this.widget.__lvcPagingEnabled && offset > 0) {
222222
// In case load more is used, the data source have to reload the full content
223-
logger.debug("reset offset");
223+
mx.logger.debug("reset offset");
224224
this.widget._datasource.setOffset(0);
225225
this.widget._datasource.setPageSize(pageSize + offset);
226226
}
@@ -229,9 +229,9 @@ export class DataSourceHelper {
229229
}
230230

231231
this.widget.update(null, () => {
232-
logger.debug("DataSourceHelper .updated");
232+
mx.logger.debug("DataSourceHelper .updated");
233233
if (!this.widget.__lvcPagingEnabled && offset > 0) {
234-
logger.debug("restore offset");
234+
mx.logger.debug("restore offset");
235235
// Restore the original paging and offset for load more.
236236
this.widget._datasource.setOffset(offset);
237237
this.widget._datasource.setPageSize(pageSize);
@@ -291,13 +291,13 @@ export class DataSourceHelper {
291291
};
292292

293293
if (changed) {
294-
logger.debug(".updateDatasource changed", offset, pageSize);
294+
mx.logger.debug(".updateDatasource changed", offset, pageSize);
295295
this.widget.__customWidgetPagingLoading = true;
296296
this.showLoader();
297297
this.widget.sequence([ "_sourceReload", "_renderData" ], () => {
298298
this.widget.__customWidgetPagingLoading = false;
299299
resetListViewHeight(this.widget.domNode);
300-
logger.debug(".updateDatasource updated");
300+
mx.logger.debug(".updateDatasource updated");
301301
this.hideLoader();
302302
});
303303
}

src/Shared/FormViewState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class FormViewState<T> {
1414
const mxform = this.form;
1515
const widgetViewState = mxform && mxform.viewState ? mxform.viewState[this.widgetId] : void 0;
1616
const state = widgetViewState && widgetViewState[key] !== undefined ? widgetViewState[key] : defaultValue;
17-
logger.debug("getPageState", this.widgetId, key, defaultValue, state);
17+
mx.logger.debug("getPageState", this.widgetId, key, defaultValue, state);
1818
return state;
1919
}
2020

0 commit comments

Comments
 (0)