Commit 60709785 authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza
Browse files

Updated Button variant

- The `flat` variant will be removed in the next major release. `text` is equivalent and should be used instead.
parent 5b6145d8
...@@ -62,7 +62,7 @@ const InstituteForm = ({ error, handleSubmit, initialValues, wiewsCode, t }) => ...@@ -62,7 +62,7 @@ const InstituteForm = ({ error, handleSubmit, initialValues, wiewsCode, t }) =>
<div className="pt-20"> <div className="pt-20">
<Button variant="contained" type="submit">{ t('common:action.saveChanges') }</Button> <Button variant="contained" type="submit">{ t('common:action.saveChanges') }</Button>
<Link to={ `/wiews/${wiewsCode || ''}` }> <Link to={ `/wiews/${wiewsCode || ''}` }>
<Button variant="flat">{ t('common:action.backTo', { where: `${wiewsCode ? t('institutes.common.instDetails', { instCode: wiewsCode }) : t('institutes.common.instList')}` }) }</Button> <Button variant="text">{ t('common:action.backTo', { where: `${wiewsCode ? t('institutes.common.instDetails', { instCode: wiewsCode }) : t('institutes.common.instList')}` }) }</Button>
</Link> </Link>
</div> </div>
</form> </form>
......
...@@ -37,7 +37,7 @@ interface IDimensionDialogProps extends React.ClassAttributes<any> { ...@@ -37,7 +37,7 @@ interface IDimensionDialogProps extends React.ClassAttributes<any> {
dimTitle: string; dimTitle: string;
dimension: Dimension<any>; dimension: Dimension<any>;
useLink: boolean; useLink: boolean;
variant?: 'text' | 'flat' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab'; variant?: 'text' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab';
t: any; t: any;
} }
......
...@@ -33,7 +33,7 @@ interface IExecutionDialogProps extends React.ClassAttributes<any> { ...@@ -33,7 +33,7 @@ interface IExecutionDialogProps extends React.ClassAttributes<any> {
execution: Execution; execution: Execution;
buttonLabel?: string; buttonLabel?: string;
classes: any; classes: any;
variant?: 'text' | 'flat' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab'; variant?: 'text' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab';
t: any; t: any;
} }
......
...@@ -34,7 +34,7 @@ interface IParameterDialogProps extends React.ClassAttributes<any> { ...@@ -34,7 +34,7 @@ interface IParameterDialogProps extends React.ClassAttributes<any> {
useLink: boolean; useLink: boolean;
classes: any; classes: any;
parameter: KPIParameter; parameter: KPIParameter;
variant?: 'text' | 'flat' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab'; variant?: 'text' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab';
t: any; t: any;
} }
......
...@@ -31,7 +31,7 @@ interface ICreateFolderDialogProps extends React.ClassAttributes<any> { ...@@ -31,7 +31,7 @@ interface ICreateFolderDialogProps extends React.ClassAttributes<any> {
root?: string; root?: string;
path?: string; path?: string;
classes: any; classes: any;
variant?: 'text' | 'flat' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab'; variant?: 'text' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab';
t: any; t: any;
} }
......
...@@ -137,7 +137,7 @@ class RepositoryBrowser extends React.Component<IRepositoryBrowserProps, any> { ...@@ -137,7 +137,7 @@ class RepositoryBrowser extends React.Component<IRepositoryBrowserProps, any> {
{ folder.folder && folder.folder._permissions.delete && <Button onClick={ this.deleteFolder } key="deletef" variant="contained">{ t('repository.admin.p.repositoryBrowser.deleteFolder') }</Button> } { folder.folder && folder.folder._permissions.delete && <Button onClick={ this.deleteFolder } key="deletef" variant="contained">{ t('repository.admin.p.repositoryBrowser.deleteFolder') }</Button> }
{ (! folder.folder || (folder.folder && folder.folder._permissions.create)) && <CreateFolderDialog root={ root } path={ path } /> } { (! folder.folder || (folder.folder && folder.folder._permissions.create)) && <CreateFolderDialog root={ root } path={ path } /> }
{ folder.folder && folder.folder._permissions.write && <UpdateFolderDialog/> } { folder.folder && folder.folder._permissions.write && <UpdateFolderDialog/> }
{ folder.folder && folder.folder._permissions.manage && <Permissions clazz={ RepositoryFolder.clazz } id={ folder.folder.id } /> } { folder.folder && folder.folder._permissions.manage && <Permissions clazz={ RepositoryFolder.clazz } id={ folder.folder.id } variant="contained" /> }
</span> </span>
} /> } />
<PageContents className={ `container-spacing-horizontal pt-1rem` }> <PageContents className={ `container-spacing-horizontal pt-1rem` }>
......
...@@ -29,7 +29,7 @@ interface IUpdateFolderDialogProps extends React.ClassAttributes<any> { ...@@ -29,7 +29,7 @@ interface IUpdateFolderDialogProps extends React.ClassAttributes<any> {
updateFolder: (folder: RepositoryFolder) => Promise<FolderDetails>; updateFolder: (folder: RepositoryFolder) => Promise<FolderDetails>;
folder: FolderDetails; folder: FolderDetails;
classes: any; classes: any;
variant?: 'text' | 'flat' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab'; variant?: 'text' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab';
t: any; t: any;
} }
......
...@@ -111,7 +111,7 @@ const FileCard = ({file, classes, compact = false, edit = false, deleteFile, edi ...@@ -111,7 +111,7 @@ const FileCard = ({file, classes, compact = false, edit = false, deleteFile, edi
<div className={ classes.actions }> <div className={ classes.actions }>
<span><ActionButton action={ () => editFile(file.uuid) } title={ t('common:action.edit') } /></span> <span><ActionButton action={ () => editFile(file.uuid) } title={ t('common:action.edit') } /></span>
<span><ActionButton action={ () => deleteFile(file.uuid) } title={ t('common:action.delete') } /></span> <span><ActionButton action={ () => deleteFile(file.uuid) } title={ t('common:action.delete') } /></span>
{ file && file._permissions.manage && <Permissions clazz={ className } id={ file.id } /> } { file && file._permissions.manage && <Permissions clazz={ className } id={ file.id } variant="contained" /> }
</div> </div>
} }
/> />
......
...@@ -2,7 +2,7 @@ import * as React from 'react'; ...@@ -2,7 +2,7 @@ import * as React from 'react';
import Button from '@material-ui/core/Button'; import Button from '@material-ui/core/Button';
interface IActionButtonProps extends React.ClassAttributes<any> { interface IActionButtonProps extends React.ClassAttributes<any> {
variant?: 'text' | 'flat' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab'; variant?: 'text' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab';
title: string; title: string;
action: any; action: any;
style?: any; style?: any;
......
...@@ -30,6 +30,10 @@ const styles = (theme) => ({ ...@@ -30,6 +30,10 @@ const styles = (theme) => ({
}, },
menuItem: { menuItem: {
padding: '6px 0', padding: '6px 0',
'& > div, & > span': {
width: '100%',
margin: '0 !important',
},
'& button': { '& button': {
width: '100%', width: '100%',
height: '100%', height: '100%',
......
...@@ -4,7 +4,7 @@ import Button from '@material-ui/core/Button'; ...@@ -4,7 +4,7 @@ import Button from '@material-ui/core/Button';
interface IUploadButtonProps extends React.ClassAttributes<any> { interface IUploadButtonProps extends React.ClassAttributes<any> {
handleUploading: (files: File[]) => void; handleUploading: (files: File[]) => void;
variant?: 'text' | 'flat' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab'; variant?: 'text' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab';
title?: string; title?: string;
multiple?: boolean; multiple?: boolean;
style?: any; style?: any;
......
...@@ -44,7 +44,7 @@ interface IPermissionsProps extends React.ClassAttributes<any> { ...@@ -44,7 +44,7 @@ interface IPermissionsProps extends React.ClassAttributes<any> {
updateParentObject: (id: number, parentId: number) => Promise<AclObjectIdentity>; updateParentObject: (id: number, parentId: number) => Promise<AclObjectIdentity>;
change: any; change: any;
classes: any; classes: any;
variant?: 'text' | 'flat' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab'; variant?: 'text' | 'outlined' | 'contained' | 'contained' | 'fab' | 'extendedFab';
t: any; t: any;
} }
...@@ -123,7 +123,7 @@ class Permissions extends React.Component<IPermissionsProps, any> { ...@@ -123,7 +123,7 @@ class Permissions extends React.Component<IPermissionsProps, any> {
} }
public render() { public render() {
const {autocomplete, variant = 'flat', t } = this.props; const {autocomplete, variant = 'text', t } = this.props;
const {aclObjectIdentity, autocompleteObj} = this.state; const {aclObjectIdentity, autocompleteObj} = this.state;
return ( return (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment