-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UIORGS-391: add initial routing config and components
- Loading branch information
1 parent
d5d736d
commit 2b8e839
Showing
8 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React, { Component } from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { stripesShape } from '@folio/stripes/core'; | ||
import { ControlledVocab } from '@folio/stripes/smart-components'; | ||
import { getControlledVocabTranslations } from '@folio/stripes-acq-components'; | ||
|
||
class AccountTypeSettings extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.connectedControlledVocab = props.stripes.connect(ControlledVocab); | ||
} | ||
|
||
render() { | ||
const { stripes } = this.props; | ||
const columnMapping = { | ||
value: <FormattedMessage id="ui-organizations.settings.name" />, | ||
action: <FormattedMessage id="ui-organizations.settings.action" />, | ||
}; | ||
|
||
const hasEditPerms = stripes.hasPerm('ui-organizations.settings'); | ||
const actionSuppressor = { | ||
edit: () => !hasEditPerms, | ||
delete: () => !hasEditPerms, | ||
}; | ||
|
||
const ConnectedComponent = this.connectedControlledVocab; | ||
|
||
return ( | ||
<ConnectedComponent | ||
actionSuppressor={actionSuppressor} | ||
canCreate={hasEditPerms} | ||
stripes={stripes} | ||
baseUrl="organizations-storage/categories" | ||
records="categories" | ||
label={<FormattedMessage id="ui-organizations.settings.accountTypes" />} | ||
translations={getControlledVocabTranslations('ui-organizations.settings.accountTypes')} | ||
objectLabel="Categories" | ||
visibleFields={['value']} | ||
columnMapping={columnMapping} | ||
hiddenFields={['lastUpdated', 'numberOfObjects']} | ||
nameKey="categories" | ||
id="categories" | ||
sortby="value" | ||
/> | ||
); | ||
} | ||
} | ||
|
||
AccountTypeSettings.propTypes = { | ||
stripes: stripesShape.isRequired, | ||
}; | ||
|
||
export default AccountTypeSettings; |
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 @@ | ||
export { default as AccountTypeSettings } from './AccountTypeSettings'; |
64 changes: 64 additions & 0 deletions
64
src/Settings/BankingInformationSettings/BankingInformationSettings.js
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,64 @@ | ||
import { FormattedMessage } from 'react-intl'; | ||
import { Field, Form } from 'react-final-form'; | ||
|
||
import { | ||
Button, | ||
Checkbox, | ||
Col, | ||
Headline, | ||
Pane, | ||
RadioButton, | ||
RadioButtonGroup, | ||
Row, | ||
} from '@folio/stripes/components'; | ||
|
||
const BankingInformationSettings = () => { | ||
const onSubmit = (values) => { | ||
console.log(values); | ||
}; | ||
|
||
return ( | ||
<Pane | ||
defaultWidth="fill" | ||
dismissible | ||
id="banking-information" | ||
paneTitle={<FormattedMessage id="ui-organizations.settings.bankingInformation" />} | ||
> | ||
<Row> | ||
<Col xs={12}> | ||
<Headline margin="none"> | ||
<FormattedMessage id="ui-organizations.settings.bankingInformation" /> | ||
</Headline> | ||
</Col> | ||
<Col xs={12}> | ||
<Form | ||
onSubmit={onSubmit} | ||
initialValues={{ enabled: false }} | ||
render={({ handleSubmit }) => ( | ||
<form onSubmit={handleSubmit}> | ||
<Field | ||
name="enabled" | ||
component={RadioButtonGroup} | ||
> | ||
<RadioButton | ||
label={<FormattedMessage id="ui-organizations.settings.bankingInformation.enabled" />} | ||
id="enabled" | ||
value="true" | ||
/> | ||
<RadioButton | ||
label={<FormattedMessage id="ui-organizations.settings.bankingInformation.disabled" />} | ||
id="disabled" | ||
value="false" | ||
/> | ||
</Field> | ||
<Button type="submit" buttonStyle="primary">Save</Button> | ||
</form> | ||
)} | ||
/> | ||
</Col> | ||
</Row> | ||
</Pane> | ||
); | ||
}; | ||
|
||
export default BankingInformationSettings; |
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,4 @@ | ||
export const typeStatus = [ | ||
{ value: 'Active' }, | ||
{ value: 'Inactive' }, | ||
]; |
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 @@ | ||
export { default as BankingInformationSettings } from './BankingInformationSettings'; |
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