Skip to content

Commit 341e34b

Browse files
committed
fix: resolve type issues
1 parent 75034f7 commit 341e34b

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

packages/pluggableWidgets/gallery-web/src/components/SelectionCounter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export const SelectionCounter = observer(function SelectionCounter({
1616
const clearButtonAriaLabel = `${selectionCountStore.clearButtonLabel} (${selectionCountStore.selectedCount} selected)`;
1717

1818
return (
19-
<If condition={selectionCountStore.displayCount !== ""}>
19+
<If condition={selectionCountStore.selectedCountText !== ""}>
2020
<div className={containerClass}>
2121
<span className="widget-gallery-selection-count" aria-live="polite" aria-atomic="true">
22-
{selectionCountStore.displayCount}
22+
{selectionCountStore.selectedCountText}
2323
</span>
2424
&nbsp;|&nbsp;
2525
<button

packages/pluggableWidgets/gallery-web/src/helpers/root-context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import { SelectionCounterViewModel } from "@mendix/widget-plugin-grid/main";
12
import { SelectActionHandler, SelectionHelper } from "@mendix/widget-plugin-grid/selection";
2-
import { SelectionCountStore } from "@mendix/widget-plugin-grid/selection/stores/SelectionCountStore";
33
import { createContext, useContext } from "react";
44
import { GalleryStore } from "../stores/GalleryStore";
55

66
export interface GalleryRootScope {
77
rootStore: GalleryStore;
8-
selectionCountStore: SelectionCountStore;
8+
selectionCountStore: SelectionCounterViewModel;
99
selectionHelper: SelectionHelper | undefined;
1010
itemSelectHelper: SelectActionHandler;
1111
}

packages/pluggableWidgets/gallery-web/src/stores/AttributeStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { PlainJs } from "@mendix/filter-commons/typings/settings";
22
import { DerivedPropsGate, SetupComponent, SetupComponentHost } from "@mendix/widget-plugin-mobx-kit/main";
33
import { EditableValue } from "mendix";
44
import { computed, makeObservable } from "mobx";
5-
import { ObservableStorage } from "src/typings/storage";
5+
import { ObservableStorage } from "../typings/storage";
66

77
type Gate = DerivedPropsGate<{
88
stateStorageAttr: EditableValue<string>;

packages/pluggableWidgets/gallery-web/src/stores/GalleryStore.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { createContextWithStub, FilterAPI } from "@mendix/widget-plugin-filtering/context";
22
import { CombinedFilter } from "@mendix/widget-plugin-filtering/stores/generic/CombinedFilter";
33
import { CustomFilterHost } from "@mendix/widget-plugin-filtering/stores/generic/CustomFilterHost";
4-
import { DatasourceService } from "@mendix/widget-plugin-grid/main";
5-
import { SelectionCountStore } from "@mendix/widget-plugin-grid/selection/stores/SelectionCountStore";
4+
import { DatasourceService, SelectionCounterViewModel } from "@mendix/widget-plugin-grid/main";
5+
66
import { DerivedPropsGate, SetupHost } from "@mendix/widget-plugin-mobx-kit/main";
77
import { generateUUID } from "@mendix/widget-plugin-platform/framework/generate-uuid";
88
import { SortAPI } from "@mendix/widget-plugin-sorting/react/context";
@@ -23,6 +23,7 @@ interface DynamicProps {
2323
itemSelection?: SelectionSingleValue | SelectionMultiValue;
2424
sCountFmtSingular?: DynamicValue<string>;
2525
sCountFmtPlural?: DynamicValue<string>;
26+
selectionCountPosition: "top" | "bottom" | "off";
2627
}
2728

2829
interface StaticProps {
@@ -55,7 +56,7 @@ export class GalleryStore extends SetupHost {
5556
readonly filterAPI: FilterAPI;
5657
readonly sortAPI: SortAPI;
5758
loaderCtrl: DerivedLoaderController;
58-
selectionCountStore: SelectionCountStore;
59+
selectionCountStore: SelectionCounterViewModel;
5960

6061
constructor(spec: GalleryStoreSpec) {
6162
super();
@@ -72,7 +73,7 @@ export class GalleryStore extends SetupHost {
7273
showTotalCount: spec.showTotalCount
7374
});
7475

75-
this.selectionCountStore = new SelectionCountStore(spec.gate);
76+
this.selectionCountStore = new SelectionCounterViewModel(spec.gate, spec.gate.props.selectionCountPosition);
7677

7778
this._filtersHost = new CustomFilterHost();
7879

0 commit comments

Comments
 (0)