Commit 6131fc2d authored by Matija Obreza's avatar Matija Obreza
Browse files

Fix: material-ui Button variant 'raised' renamed to 'contained'

- Also https://material-ui.com/style/typography/#migration-to-typography-v2
parent 38b63c9e
...@@ -364,7 +364,7 @@ class DetailInfo extends React.Component<IDetailInfoProps, any> { ...@@ -364,7 +364,7 @@ class DetailInfo extends React.Component<IDetailInfoProps, any> {
dataset.repositoryFiles && dataset.repositoryFiles.map((e: RepositoryFile) => ( dataset.repositoryFiles && dataset.repositoryFiles.map((e: RepositoryFile) => (
<PropertiesItem key={ e.uuid } title={ <PropertiesItem key={ e.uuid } title={
<a href={ `/proxy/api/v0/repository/download/${e.uuid}` }> <a href={ `/proxy/api/v0/repository/download/${e.uuid}` }>
<Button variant="raised" component="span" className={ `${classes.buttonGreen} ${classes.button}` }> <Button variant="contained" component="span" className={ `${classes.buttonGreen} ${classes.button}` }>
{ t('common:action.download') } { t('common:action.download') }
</Button> </Button>
</a> </a>
......
...@@ -151,7 +151,7 @@ class DatasetCreatorForm extends React.Component<IDatasetCreatorFormProps, any> ...@@ -151,7 +151,7 @@ class DatasetCreatorForm extends React.Component<IDatasetCreatorFormProps, any>
<FieldArray name="creators" classes={ this.props.classes } component={ this.renderCreators }/> <FieldArray name="creators" classes={ this.props.classes } component={ this.renderCreators }/>
</form> </form>
<Grid item xs={ 12 } className="back-white"> <Grid item xs={ 12 } className="back-white">
<Button variant="raised" type="button" onClick={ this.createCreator } style={ { margin: '20px' } }> <Button variant="contained" type="button" onClick={ this.createCreator } style={ { margin: '20px' } }>
{ t('datasets.dashboard.p.stepper.creators.add') } { t('datasets.dashboard.p.stepper.creators.add') }
</Button> </Button>
</Grid> </Grid>
......
...@@ -111,7 +111,7 @@ class FilesForm extends React.Component<IFilesFormProps, any> { ...@@ -111,7 +111,7 @@ class FilesForm extends React.Component<IFilesFormProps, any> {
onChange={ this.upload } onChange={ this.upload }
/> />
<label htmlFor="file"> <label htmlFor="file">
<Button variant="raised" component="span"> <Button variant="contained" component="span">
{ t('datasets.dashboard.p.stepper.attachments.upload') } { t('datasets.dashboard.p.stepper.attachments.upload') }
</Button> </Button>
</label> </label>
......
...@@ -199,7 +199,7 @@ class LocationForm extends React.Component<ILocationFormProps, any> { ...@@ -199,7 +199,7 @@ class LocationForm extends React.Component<ILocationFormProps, any> {
)) } )) }
<div className="back-white m-20"> <div className="back-white m-20">
<Button <Button
variant="raised" variant="contained"
type="button" type="button"
onClick={ this.createLocation } onClick={ this.createLocation }
>{ t('datasets.dashboard.p.stepper.location.add') }</Button> >{ t('datasets.dashboard.p.stepper.location.add') }</Button>
......
...@@ -102,7 +102,7 @@ const SuggestionsForm = ({ classes, t, suggestions, onReset, handleSubmit, initi ...@@ -102,7 +102,7 @@ const SuggestionsForm = ({ classes, t, suggestions, onReset, handleSubmit, initi
</Grid> </Grid>
} }
<div className={ `pt-20 pb-20 pl-20 ${classes.submitButtonWrapper}` }> <div className={ `pt-20 pb-20 pl-20 ${classes.submitButtonWrapper}` }>
<Button variant="raised" onClick={ processSubmit } <Button variant="contained" onClick={ processSubmit }
className={ `${classes.btnGreen} ${classes.submitButton}` } className={ `${classes.btnGreen} ${classes.submitButton}` }
type="submit">{ t('datasets.public.c.suggestionsForm.apply') } type="submit">{ t('datasets.public.c.suggestionsForm.apply') }
</Button> </Button>
......
...@@ -83,7 +83,7 @@ class Extras extends React.Component<IExtras, any> { ...@@ -83,7 +83,7 @@ class Extras extends React.Component<IExtras, any> {
<Input multiline error={ this.state.jsonError && true } placeholder="" onChange={ this.updateJson } value={ this.state.extras[DescriptorListExtra.JSON_MAPPING] }/> <Input multiline error={ this.state.jsonError && true } placeholder="" onChange={ this.updateJson } value={ this.state.extras[DescriptorListExtra.JSON_MAPPING] }/>
</FormControl> </FormControl>
<Button variant="raised" type="button" disabled={ (this.state.jsonError) && true } onClick={ this.saveExtras }>{ t('descriptorlists.public.c.extras.save') }</Button> <Button variant="contained" type="button" disabled={ (this.state.jsonError) && true } onClick={ this.saveExtras }>{ t('descriptorlists.public.c.extras.save') }</Button>
<Button type="button" onClick={ this.getDefaults }>{ t('descriptorlists.public.c.extras.defaults') }</Button> <Button type="button" onClick={ this.getDefaults }>{ t('descriptorlists.public.c.extras.defaults') }</Button>
</Paper> </Paper>
</div> </div>
......
...@@ -213,7 +213,7 @@ const DescriptorCard = ({ complete = true, compact, descriptor, classes, classNa ...@@ -213,7 +213,7 @@ const DescriptorCard = ({ complete = true, compact, descriptor, classes, classNa
<CardActions className={ classes.action }> <CardActions className={ classes.action }>
{ selectedProps && selectedProps.selectable && ( { selectedProps && selectedProps.selectable && (
<Button <Button
variant="raised" variant="contained"
onClick={ onClick(true) } onClick={ onClick(true) }
className={ classes.btnBlue } className={ classes.btnBlue }
disabled={ selectedProps.disabled } disabled={ selectedProps.disabled }
...@@ -224,7 +224,7 @@ const DescriptorCard = ({ complete = true, compact, descriptor, classes, classNa ...@@ -224,7 +224,7 @@ const DescriptorCard = ({ complete = true, compact, descriptor, classes, classNa
{ selectedProps && !selectedProps.selectable && ( { selectedProps && !selectedProps.selectable && (
<Button <Button
variant="raised" variant="contained"
onClick={ onClick(false) } onClick={ onClick(false) }
disabled={ selectedProps.disabled } disabled={ selectedProps.disabled }
className={ classes.btnDefault } className={ classes.btnDefault }
......
...@@ -37,7 +37,7 @@ class DescriptorFilterForm extends React.Component<IDescriptorFilterFormProps, a ...@@ -37,7 +37,7 @@ class DescriptorFilterForm extends React.Component<IDescriptorFilterFormProps, a
<DescriptorFilters/> <DescriptorFilters/>
</form> </form>
<div className="pt-20 pb-20 pl-20"> <div className="pt-20 pb-20 pl-20">
<Button variant="raised" onClick={ handleSubmit } className={ classes.btnGreen }> <Button variant="contained" onClick={ handleSubmit } className={ classes.btnGreen }>
{ t('descriptors.public.c.descriptorFilterForm.apply') } { t('descriptors.public.c.descriptorFilterForm.apply') }
</Button> </Button>
<Button onClick={ reset } className={ classes.btnReset }> <Button onClick={ reset } className={ classes.btnReset }>
......
...@@ -104,7 +104,7 @@ class VocabularyForm extends React.Component<any, any> { ...@@ -104,7 +104,7 @@ class VocabularyForm extends React.Component<any, any> {
/> />
<div>{ error && <strong>{ error }</strong> }</div> <div>{ error && <strong>{ error }</strong> }</div>
<Button variant="raised" type="submit">{ t('common:action.saveChanges') }</Button> <Button variant="contained" type="submit">{ t('common:action.saveChanges') }</Button>
</form> </form>
</div> </div>
); );
......
...@@ -268,7 +268,7 @@ class DescriptorForm extends React.Component<any, any> { ...@@ -268,7 +268,7 @@ class DescriptorForm extends React.Component<any, any> {
) } ) }
<div>{ error && <strong>{ error }</strong> }</div> <div>{ error && <strong>{ error }</strong> }</div>
<Button variant="raised" type="submit" disabled={ submitting || invalid }>{ t('common:action.saveChanges') }</Button> <Button variant="contained" type="submit" disabled={ submitting || invalid }>{ t('common:action.saveChanges') }</Button>
{ (initialValues && initialValues.id > 0 && !initialValues.published) && { (initialValues && initialValues.id > 0 && !initialValues.published) &&
<Button disabled={ anyTouched } type="button" onClick={ onPublish }> <Button disabled={ anyTouched } type="button" onClick={ onPublish }>
{ t(`descriptors.admin.c.form.approvePublish`) } { t(`descriptors.admin.c.form.approvePublish`) }
......
...@@ -96,7 +96,7 @@ class PartnerForm extends React.Component<any, void> { ...@@ -96,7 +96,7 @@ class PartnerForm extends React.Component<any, void> {
<ItemsEditor name="countryCodes" itemLabel="Country code" addItem={ this.onAddString } removeItem={ this.onRemoveString } component={ stringField }/> <ItemsEditor name="countryCodes" itemLabel="Country code" addItem={ this.onAddString } removeItem={ this.onRemoveString } component={ stringField }/>
<div>{ error && <strong>{ error }</strong> }</div> <div>{ error && <strong>{ error }</strong> }</div>
<Button variant="raised" type="submit" disabled={ submitting || invalid }>{ t('common:action.saveChanges') }</Button> <Button variant="contained" type="submit" disabled={ submitting || invalid }>{ t('common:action.saveChanges') }</Button>
<PartnerLink to={ initialValues }><Button type="button">{ t('common:action.cancel') }</Button></PartnerLink> <PartnerLink to={ initialValues }><Button type="button">{ t('common:action.cancel') }</Button></PartnerLink>
</form> </form>
); );
......
...@@ -292,7 +292,7 @@ class SearchMenu extends React.Component<ISearchMenuProps, any> { ...@@ -292,7 +292,7 @@ class SearchMenu extends React.Component<ISearchMenuProps, any> {
/> />
</ListItem> </ListItem>
<div className={ classes.applyReset }> <div className={ classes.applyReset }>
<Button variant="raised" onClick={ this.apply } className={ classes.greenButton }> <Button variant="contained" onClick={ this.apply } className={ classes.greenButton }>
Apply Apply
</Button> </Button>
<div className={ classes.flexGrow }/> <div className={ classes.flexGrow }/>
...@@ -351,7 +351,7 @@ class SearchMenu extends React.Component<ISearchMenuProps, any> { ...@@ -351,7 +351,7 @@ class SearchMenu extends React.Component<ISearchMenuProps, any> {
)) ))
} }
<div className={ classes.applyReset }> <div className={ classes.applyReset }>
<Button variant="raised" onClick={ this.apply } className={ classes.greenButton }> <Button variant="contained" onClick={ this.apply } className={ classes.greenButton }>
Apply Apply
</Button> </Button>
<div className={ classes.flexGrow }/> <div className={ classes.flexGrow }/>
......
...@@ -40,15 +40,15 @@ class DashboardActionsArea extends React.Component<IDasboardActionsAreaProps, an ...@@ -40,15 +40,15 @@ class DashboardActionsArea extends React.Component<IDasboardActionsAreaProps, an
const { mainButtonTitle, cancelButtonTitle, actions, classes, isEditMode, t } = this.props; const { mainButtonTitle, cancelButtonTitle, actions, classes, isEditMode, t } = this.props;
return ( return (
<div> <div>
<Button variant="raised" className={ isEditMode ? classes.hidden : '' } onClick={ this.onShowClick }> { mainButtonTitle || t('common:action.show') } </Button> <Button variant="contained" className={ isEditMode ? classes.hidden : '' } onClick={ this.onShowClick }> { mainButtonTitle || t('common:action.show') } </Button>
{ actions && actions.map((action, i) => ( { actions && actions.map((action, i) => (
!action.admin ? !action.admin ?
<Button key={ `${i}-${action.title}` } variant="raised" className={ !isEditMode ? classes.hidden : '' } onClick={ action.action }>{ action.title }</Button> <Button key={ `${i}-${action.title}` } variant="contained" className={ !isEditMode ? classes.hidden : '' } onClick={ action.action }>{ action.title }</Button>
: <Authorize key={ `${i}-${action.title}` } role="ROLE_ADMINISTRATOR"> : <Authorize key={ `${i}-${action.title}` } role="ROLE_ADMINISTRATOR">
<Button variant="raised" className={ !isEditMode ? classes.hidden : '' } onClick={ action.action }>{ action.title }</Button> <Button variant="contained" className={ !isEditMode ? classes.hidden : '' } onClick={ action.action }>{ action.title }</Button>
</Authorize> </Authorize>
)) } )) }
<Button variant="raised" className={ !isEditMode ? classes.hidden : '' } onClick={ this.onShowClick }> { cancelButtonTitle || t('common:action.cancel') } </Button> <Button variant="contained" className={ !isEditMode ? classes.hidden : '' } onClick={ this.onShowClick }> { cancelButtonTitle || t('common:action.cancel') } </Button>
</div> </div>
); );
} }
......
...@@ -76,7 +76,7 @@ class DashboardTableRow extends React.Component<any> { ...@@ -76,7 +76,7 @@ class DashboardTableRow extends React.Component<any> {
<StatusCell t={ t } publishState={ row.state }/> <StatusCell t={ t } publishState={ row.state }/>
<TableCell style={ { fontSize: '1rem' } }> <TableCell style={ { fontSize: '1rem' } }>
<DataLink tab={ tab } row={ row }> <DataLink tab={ tab } row={ row }>
<Button variant="raised">{ row.state === PublishState.DRAFT && row._permissions.write ? t('common:action.edit') : t('common:action.view') }</Button> <Button variant="contained">{ row.state === PublishState.DRAFT && row._permissions.write ? t('common:action.edit') : t('common:action.view') }</Button>
</DataLink> </DataLink>
{ row._permissions.manage && <Permissions clazz={ dataClassName } id={ row.id }/> } { row._permissions.manage && <Permissions clazz={ dataClassName } id={ row.id }/> }
</TableCell> </TableCell>
......
...@@ -69,10 +69,10 @@ class BrowsePage extends BrowsePageTemplate<Vocabulary> { ...@@ -69,10 +69,10 @@ class BrowsePage extends BrowsePageTemplate<Vocabulary> {
title={ t('vocabulary.admin.p.browse.title') } title={ t('vocabulary.admin.p.browse.title') }
buttons={ buttons={
<div> <div>
<Button className={ classes.updateButton } variant="raised" onClick={ this.autoUpdateVocabularies }> <Button className={ classes.updateButton } variant="contained" onClick={ this.autoUpdateVocabularies }>
{ t('vocabulary.admin.p.browse.update') } { t('vocabulary.admin.p.browse.update') }
</Button> </Button>
<Button variant="raised" onClick={ createVocabulary }> <Button variant="contained" onClick={ createVocabulary }>
{ t('vocabulary.admin.p.browse.create') } { t('vocabulary.admin.p.browse.create') }
</Button> </Button>
</div> </div>
......
...@@ -123,7 +123,7 @@ class VocabularyForm extends React.Component<any, any> { ...@@ -123,7 +123,7 @@ class VocabularyForm extends React.Component<any, any> {
<div className="error">{ error }</div> <div className="error">{ error }</div>
) } ) }
<Button variant="raised" type="submit" disabled={ submitting || invalid }> <Button variant="contained" type="submit" disabled={ submitting || invalid }>
{ t('common:action.saveChanges') } { t('common:action.saveChanges') }
</Button> </Button>
{ (initialValues._permissions && initialValues._permissions.delete) && { (initialValues._permissions && initialValues._permissions.delete) &&
......
Supports Markdown
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