Skip to content

Commit

Permalink
version-1.0.0-alpha14
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaszPilch committed Dec 20, 2020
1 parent b18e430 commit 11e8b05
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 86 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bheui/components",
"version": "1.0.0-alpha13",
"version": "1.0.0-alpha14",
"description": "Components fo BHE be UI",
"main": "dist",
"scripts": {
Expand Down Expand Up @@ -31,7 +31,7 @@
"homepage": "https://github.com/TomaszPilch/BHE-be-ui-components#readme",
"peerDependencies": {
"@fluentui/react": "^7.149.4",
"@uifabric/experiments": "^7.36.10",
"@uifabric/experiments": "^7.37.2",
"axios": "^0.21.0",
"next": "^10.0.1",
"office-ui-fabric-core": "^11.0.0",
Expand Down Expand Up @@ -89,7 +89,7 @@
"@types/react-select": "^3.0.23",
"@types/seamless-immutable": "^7.1.15",
"@types/uuid": "^8.3.0",
"@uifabric/experiments": "^7.36.10",
"@uifabric/experiments": "^7.37.2",
"axios": "^0.21.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/FilterComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class FilterComponent extends React.PureComponent<FilterComponent
this.props.onChangeFilterValue(options.key, event.target.value, true)
}

handleOnSelectChange = (value: string) => {
handleOnSelectChange = (_column: string, value: string | number | null) => {
const { options } = this.props
this.props.onChangeFilterValue(options.key, value, true)
}
Expand Down
31 changes: 18 additions & 13 deletions src/components/ListComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ class ListComponent<CustomComponentProps = {}> extends React.PureComponent<ListC
}

componentDidUpdate(prevProps: ListComponentProps<CustomComponentProps>): void {
if (prevProps.module !== this.props.module) {
this.setState({ showFilter: false })
}
if (prevProps.module !== this.props.module || prevProps.refreshSig !== this.props.refreshSig) {
this.props.onChangeRefreshSig(false)
this.props.loadData()
Expand Down Expand Up @@ -219,7 +222,7 @@ class ListComponent<CustomComponentProps = {}> extends React.PureComponent<ListC
const { rights, module } = this.props
return (
<span key={`actions-${item.id}`}>
{rights[USER_RIGHTS.VIEW] && this.handleHasModuleThisAction('view') && (
{rights[USER_RIGHTS.VIEW] > 0 && this.handleHasModuleThisAction('view') && (
<FontIcon
className="list-container__action"
iconName="View"
Expand All @@ -228,7 +231,7 @@ class ListComponent<CustomComponentProps = {}> extends React.PureComponent<ListC
}}
/>
)}
{rights[USER_RIGHTS.EDIT] && this.handleHasModuleThisAction('edit') && (
{rights[USER_RIGHTS.EDIT] > 0 && this.handleHasModuleThisAction('edit') && (
<FontIcon
className="list-container__action"
iconName="Edit"
Expand All @@ -237,7 +240,7 @@ class ListComponent<CustomComponentProps = {}> extends React.PureComponent<ListC
}}
/>
)}
{rights[USER_RIGHTS.DELETE] && this.handleHasModuleThisAction('delete') && (
{rights[USER_RIGHTS.DELETE] > 0 && this.handleHasModuleThisAction('delete') && (
<FontIcon
className="list-container__action list-container__action--delete"
iconName="Delete"
Expand Down Expand Up @@ -396,16 +399,6 @@ class ListComponent<CustomComponentProps = {}> extends React.PureComponent<ListC
selection={this.selection}
selectionMode={SelectionMode.multiple}
/>
{maxCount > limit && (
<Pagination
format="buttons"
itemsPerPage={limit}
onPageChange={this.handlePageChange}
pageCount={maxPage}
selectedPageIndex={page - 1} // index
totalItemCount={maxCount}
/>
)}
</MarqueeSelection>
{selectedArray.length > 0 && rights[USER_RIGHTS.DELETE] && this.handleHasModuleThisAction('delete') && (
<CommandBar
Expand All @@ -423,6 +416,18 @@ class ListComponent<CustomComponentProps = {}> extends React.PureComponent<ListC
/>
)}
</div>
{maxCount > limit && (
<div className="list-container__pagination">
<Pagination
format="buttons"
itemsPerPage={limit}
onPageChange={this.handlePageChange}
pageCount={maxPage}
selectedPageIndex={page - 1} // index
totalItemCount={maxCount}
/>
</div>
)}
<Dialog
dialogContentProps={{
type: DialogType.normal,
Expand Down
9 changes: 9 additions & 0 deletions src/styles/pages/ListStyles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
margin-right: 5px;
}
}

&__pagination {
margin-top: 12px;
vertical-align: center;

>div>div {
margin-bottom: 8px;
}
}
}

.list-container-wrapper {
Expand Down
102 changes: 33 additions & 69 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2042,17 +2042,6 @@
dependencies:
tslib "^1.10.0"

"@fluentui/react-compose@^0.19.12":
version "0.19.12"
resolved "https://registry.yarnpkg.com/@fluentui/react-compose/-/react-compose-0.19.12.tgz#405dfc19b4ae2b5f1c86bf7091ac15a205978206"
integrity sha512-GTcZ3kd2rTk3Q7xXJB8cTPfv0Q0vOdeIrLcJ02lXfjE9h3GPTE62rV4iFzBIZyXIKL8IdR6Jh8WNIBkVMWhhxw==
dependencies:
"@types/classnames" "^2.2.9"
"@uifabric/set-version" "^7.0.23"
"@uifabric/utilities" "^7.33.2"
classnames "^2.2.6"
tslib "^1.10.0"

"@fluentui/react-focus@^7.16.17":
version "7.16.17"
resolved "https://registry.yarnpkg.com/@fluentui/react-focus/-/react-focus-7.16.17.tgz#0a6d4a5a175471874d4da2ca5718c39ffdd0d252"
Expand All @@ -2065,43 +2054,18 @@
"@uifabric/utilities" "^7.33.2"
tslib "^1.10.0"

"@fluentui/react-focus@^7.16.19":
version "7.16.19"
resolved "https://registry.yarnpkg.com/@fluentui/react-focus/-/react-focus-7.16.19.tgz#7e7be46b6a7c004b61c360f61a275004abdb0f93"
integrity sha512-BUnSJ7CRs0gfaEXVr5w9YQsZXB18J35k7H7eyB5wLLLgwdK/ogt6uYcu3p0q5ZEjju8C/wmJ2zgwFCMKiAyTUA==
"@fluentui/react-focus@^7.17.0":
version "7.17.0"
resolved "https://registry.yarnpkg.com/@fluentui/react-focus/-/react-focus-7.17.0.tgz#f0aed30c9ebc5373990e4918bbbc6886fd2f5335"
integrity sha512-xr5LExRnLW9CNyWDkcMmvOAgOXru/GBTIKcVqNahgRf7CIyHraY0m/0gFblwNtPYQOS9ltM3c+fbyYvCXBZvEw==
dependencies:
"@fluentui/keyboard-key" "^0.2.12"
"@fluentui/react-theme-provider" "^0.18.0"
"@uifabric/merge-styles" "^7.19.1"
"@uifabric/set-version" "^7.0.23"
"@uifabric/styling" "^7.16.18"
"@uifabric/utilities" "^7.33.2"
tslib "^1.10.0"

"@fluentui/react-stylesheets@^0.2.4":
version "0.2.4"
resolved "https://registry.yarnpkg.com/@fluentui/react-stylesheets/-/react-stylesheets-0.2.4.tgz#65cc6136f84ff3fd3d1c9188bed0a34b9573f589"
integrity sha512-zTyDxBsQsm5iz59SXn83+BrC3tUnwQdJc/xcPYWWVISIyPby/75URbWK5uYJ5p5Qy0GrpgKDGYAbpXZlN89SRQ==
dependencies:
"@uifabric/set-version" "^7.0.23"
tslib "^1.10.0"

"@fluentui/react-theme-provider@^0.18.0":
version "0.18.0"
resolved "https://registry.yarnpkg.com/@fluentui/react-theme-provider/-/react-theme-provider-0.18.0.tgz#72fc1809a2b0720bdb66b9ff7d0505e69e036308"
integrity sha512-dKSOZ1Sl2uVrDzjvfRtwHUluedU0MhEASukyeqGTpKTmg3ucPMYEZn+dgzFqRNpjs9trbb++N8R6Z19CWokXOw==
dependencies:
"@fluentui/react-compose" "^0.19.12"
"@fluentui/react-stylesheets" "^0.2.4"
"@fluentui/react-window-provider" "^1.0.1"
"@fluentui/theme" "^1.7.0"
"@uifabric/merge-styles" "^7.19.1"
"@uifabric/react-hooks" "^7.13.9"
"@uifabric/set-version" "^7.0.23"
"@uifabric/utilities" "^7.33.2"
classnames "^2.2.6"
tslib "^1.10.0"

"@fluentui/react-window-provider@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@fluentui/react-window-provider/-/react-window-provider-1.0.1.tgz#8ec71db8cfd57e11f00ed42c5c1377ef4dfe5f6b"
Expand Down Expand Up @@ -3251,7 +3215,7 @@
resolved "https://registry.yarnpkg.com/@types/braces/-/braces-3.0.0.tgz#7da1c0d44ff1c7eb660a36ec078ea61ba7eb42cb"
integrity sha512-TbH79tcyi9FHwbyboOKeRachRq63mSuWYXOflsNO9ZyE5ClQ/JaozNKl+aWUq87qPNsXasXxi2AbgfwIJ+8GQw==

"@types/classnames@^2.2.11", "@types/classnames@^2.2.9":
"@types/classnames@^2.2.11":
version "2.2.11"
resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.11.tgz#2521cc86f69d15c5b90664e4829d84566052c1cf"
integrity sha512-2koNhpWm3DgWRp5tpkiJ8JGc1xTn2q0l+jUNUE7oMKXUf5NpI9AIdC4kbjGNFBdHtcxBD18LAksoudAVhFKCjw==
Expand Down Expand Up @@ -3649,15 +3613,15 @@
"@typescript-eslint/types" "4.1.0"
eslint-visitor-keys "^2.0.0"

"@uifabric/azure-themes@^7.5.51":
version "7.5.51"
resolved "https://registry.yarnpkg.com/@uifabric/azure-themes/-/azure-themes-7.5.51.tgz#5c623594724b9af08f29e1d195eba21882c4de78"
integrity sha512-jocTOm+RxszxGCR94YmWfiyq9mf4CBZCl49PF+qXVhH2zVQl4tKUnD/5WgThnFmDRpcnh/WbrqdSCvVqgZ4QwA==
"@uifabric/azure-themes@^7.6.2":
version "7.6.2"
resolved "https://registry.yarnpkg.com/@uifabric/azure-themes/-/azure-themes-7.6.2.tgz#d290c53e4aaf91dcb88013ce6084d3afb28ea97a"
integrity sha512-HB5QpC5nU+x2iKrNKpE3mRRY+LH9ZfoutU4VJi51PEAfhj35PK40Z2xWR3Yg4Fim1IqE7EDBNxYiQvrr6ksiMA==
dependencies:
"@fluentui/theme" "^1.7.0"
"@uifabric/merge-styles" "^7.19.1"
"@uifabric/set-version" "^7.0.23"
office-ui-fabric-react "^7.153.4"
office-ui-fabric-react "^7.155.2"
tslib "^1.10.0"

"@uifabric/example-data@^7.1.5":
Expand All @@ -3667,28 +3631,28 @@
dependencies:
tslib "^1.10.0"

"@uifabric/experiments@^7.36.10":
version "7.36.21"
resolved "https://registry.yarnpkg.com/@uifabric/experiments/-/experiments-7.36.21.tgz#ca5c2ab058de70f8fc048430e90bd10924786244"
integrity sha512-9e5T2DrhtWZUtjefEJKQLd43vKtNfQLmMBbLqWBS4cCdXX/IRwt/mZRVYB8tWgaMITt3YjpYn+qgdL62nMJphA==
"@uifabric/experiments@^7.37.2":
version "7.37.2"
resolved "https://registry.yarnpkg.com/@uifabric/experiments/-/experiments-7.37.2.tgz#42e7290ae3280e8f6fed113b10a7dc9f25abb29a"
integrity sha512-UyQVWBLSGBIfSfXsBLzu/k1oIA6tc+Gb9Ja30DEjV97J8nqV4Rq4aVCRlQijABVw/r/K8FV1drcw1iYMcuKPWA==
dependencies:
"@fluentui/theme" "^1.7.0"
"@microsoft/load-themed-styles" "^1.10.26"
"@uifabric/azure-themes" "^7.5.51"
"@uifabric/azure-themes" "^7.6.2"
"@uifabric/example-data" "^7.1.5"
"@uifabric/file-type-icons" "^7.6.23"
"@uifabric/fluent-theme" "^7.3.48"
"@uifabric/fluent-theme" "^7.4.2"
"@uifabric/foundation" "^7.9.20"
"@uifabric/icons" "^7.5.17"
"@uifabric/merge-styles" "^7.19.1"
"@uifabric/react-hooks" "^7.13.9"
"@uifabric/set-version" "^7.0.23"
"@uifabric/styling" "^7.16.18"
"@uifabric/theme-samples" "^7.1.52"
"@uifabric/theme-samples" "^7.2.2"
"@uifabric/utilities" "^7.33.2"
"@uifabric/variants" "^7.2.31"
deep-assign "^2.0.0"
office-ui-fabric-react "^7.153.4"
office-ui-fabric-react "^7.155.2"
prop-types "^15.7.2"
tslib "^1.10.0"

Expand All @@ -3701,17 +3665,17 @@
"@uifabric/styling" "^7.16.18"
tslib "^1.10.0"

"@uifabric/fluent-theme@^7.3.48":
version "7.3.48"
resolved "https://registry.yarnpkg.com/@uifabric/fluent-theme/-/fluent-theme-7.3.48.tgz#b84571113a77b3d2947495df7129d6030f284c5a"
integrity sha512-17suU3B2zT+PmCEndxHXl0iA6Xb4soH2oijdKZ8pvKtorZioCNYpchSVuCAG6S7d49X2uK4ERaibUIQb8DmXcA==
"@uifabric/fluent-theme@^7.4.2":
version "7.4.2"
resolved "https://registry.yarnpkg.com/@uifabric/fluent-theme/-/fluent-theme-7.4.2.tgz#ef5de4afcf3bc13077f27cdc91f5e85a41462287"
integrity sha512-CkQR8SedfGlRPPzVQISqyb/xu0q6zyW2X2lJd928YuHCIawcQVBv8DGIM5/qQj75cKOKcn+7Q84s8dOR3wJb+w==
dependencies:
"@fluentui/theme" "^1.7.0"
"@uifabric/merge-styles" "^7.19.1"
"@uifabric/set-version" "^7.0.23"
"@uifabric/styling" "^7.16.18"
"@uifabric/variants" "^7.2.31"
office-ui-fabric-react "^7.153.4"
office-ui-fabric-react "^7.155.2"
tslib "^1.10.0"

"@uifabric/foundation@^7.9.19":
Expand Down Expand Up @@ -3803,15 +3767,15 @@
"@uifabric/utilities" "^7.33.2"
tslib "^1.10.0"

"@uifabric/theme-samples@^7.1.52":
version "7.1.52"
resolved "https://registry.yarnpkg.com/@uifabric/theme-samples/-/theme-samples-7.1.52.tgz#34917ece54b98023c93aafb737113cb1c80a2560"
integrity sha512-uAhhxCKXQ+XEO4uv9QtArmJ6/2f9eYYuXMxvNHteSwHC3CuevJqHzEH1VDT1JdTC3LtvLXG/8EJUlFYMEA81Sw==
"@uifabric/theme-samples@^7.2.2":
version "7.2.2"
resolved "https://registry.yarnpkg.com/@uifabric/theme-samples/-/theme-samples-7.2.2.tgz#b4bd8582631ffc55944e3be0438b5320c0dca2d7"
integrity sha512-Ee1ShzxBypWU/1HCZDBp6xftPyALkREedbUEqf96MCrPZhmCxnVYfEXCsLuoL9uTIIFihe5mDNrNE64hwr+J9g==
dependencies:
"@fluentui/theme" "^1.7.0"
"@uifabric/set-version" "^7.0.23"
"@uifabric/variants" "^7.2.31"
office-ui-fabric-react "^7.153.4"
office-ui-fabric-react "^7.155.2"
tslib "^1.10.0"

"@uifabric/utilities@^7.33.2":
Expand Down Expand Up @@ -11297,13 +11261,13 @@ office-ui-fabric-react@^7.149.4:
prop-types "^15.7.2"
tslib "^1.10.0"

office-ui-fabric-react@^7.153.4:
version "7.153.4"
resolved "https://registry.yarnpkg.com/office-ui-fabric-react/-/office-ui-fabric-react-7.153.4.tgz#7ba7833754c7390d13d1b81b5b346c6b85e2ff62"
integrity sha512-BF4eDxilcW2I6vboXECPqcz2nPYjFZtnHR7lSSY67xRWX0B1+g5xccxqUiDNO/vFmRzvTpD4j53JN70TIzJm1Q==
office-ui-fabric-react@^7.155.2:
version "7.155.2"
resolved "https://registry.yarnpkg.com/office-ui-fabric-react/-/office-ui-fabric-react-7.155.2.tgz#2da63d7ae29f3d4309ec94d51aa57a66761b2d5f"
integrity sha512-BBozI+XqnNHC7ueAUPvtGy4Fek6lbot0lAM7TfM8EiKvz+QZHxksDkwJYPcvu5Zvr53ChUFjG7ziWGFjAR5k0g==
dependencies:
"@fluentui/date-time-utilities" "^7.9.0"
"@fluentui/react-focus" "^7.16.19"
"@fluentui/react-focus" "^7.17.0"
"@fluentui/react-window-provider" "^1.0.1"
"@microsoft/load-themed-styles" "^1.10.26"
"@uifabric/foundation" "^7.9.20"
Expand Down

0 comments on commit 11e8b05

Please sign in to comment.