-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: upgrade fabric version (#629)
Feature: upgrade fabric version
- Loading branch information
Showing
17 changed files
with
1,380 additions
and
922 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
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
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
61 changes: 61 additions & 0 deletions
61
src/app/views/query-runner/request/permissions/PanelList.tsx
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,61 @@ | ||
import { DetailsList, DetailsListLayoutMode, IColumn, Label, SearchBox, SelectionMode } from 'office-ui-fabric-react'; | ||
import React from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { SortOrder } from '../../../../../types/enums'; | ||
import { IPermission } from '../../../../../types/permissions'; | ||
import { dynamicSort } from '../../../../utils/dynamic-sort'; | ||
import { generatePermissionGroups } from './util'; | ||
|
||
interface IPanelList { | ||
messages: any; | ||
permissions: IPermission[]; | ||
columns: any[]; | ||
classes: any; | ||
selection: any; | ||
renderItemColumn: any; | ||
searchValueChanged: Function; | ||
} | ||
|
||
const PanelList = ({ messages, permissions, | ||
columns, classes, selection, | ||
renderItemColumn, searchValueChanged }: IPanelList) => { | ||
|
||
const groups = generatePermissionGroups(permissions); | ||
permissions = permissions.sort(dynamicSort('value', SortOrder.ASC)); | ||
|
||
return ( | ||
<> | ||
<Label className={classes.permissionText}> | ||
<FormattedMessage id='Select different permissions' /> | ||
</Label> | ||
<hr /> | ||
<SearchBox | ||
className={classes.searchBox} | ||
placeholder={messages['Search permissions']} | ||
onChange={(event?: React.ChangeEvent<HTMLInputElement>, newValue?: string) => | ||
searchValueChanged(event, newValue)} | ||
styles={{ field: { paddingLeft: 10 } }} | ||
/> | ||
<hr /> | ||
<DetailsList | ||
onShouldVirtualize={() => false} | ||
items={permissions} | ||
columns={columns} | ||
groups={groups} | ||
onRenderItemColumn={(item?: any, index?: number, column?: IColumn) => renderItemColumn(item, index, column)} | ||
selectionMode={SelectionMode.multiple} | ||
layoutMode={DetailsListLayoutMode.justified} | ||
selection={selection} | ||
compact={true} | ||
groupProps={{ | ||
showEmptyGroups: false, | ||
}} | ||
ariaLabelForSelectionColumn={messages['Toggle selection'] || 'Toggle selection'} | ||
ariaLabelForSelectAllCheckbox={messages['Toggle selection for all items'] || 'Toggle selection for all items'} | ||
checkButtonAriaLabel={messages['Row checkbox'] || 'Row checkbox'} | ||
/> | ||
</> | ||
); | ||
}; | ||
export default PanelList; |
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
Oops, something went wrong.