Skip to content

Commit

Permalink
Merge bd5c1e4 into 8a9e6ad
Browse files Browse the repository at this point in the history
  • Loading branch information
muhozi committed Oct 23, 2018
2 parents 8a9e6ad + bd5c1e4 commit 3130cfc
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 61 deletions.
2 changes: 1 addition & 1 deletion src/components/bulkConcepts/component/ActionButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import PreviewCard from './PreviewCard';
export class ActionButtons extends Component {
static propTypes = {
previewConcept: PropTypes.func.isRequired,
id: PropTypes.number.isRequired,
id: PropTypes.string.isRequired,
params: PropTypes.shape({
type: PropTypes.string,
typeName: PropTypes.string,
Expand Down
7 changes: 4 additions & 3 deletions src/components/bulkConcepts/component/PreviewCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ PreviewCard.propTypes = {
closeModal: PropTypes.func.isRequired,
addConcept: PropTypes.func.isRequired,
concept: PropTypes.shape({
display_name: PropTypes.string.isRequired,
descriptions: PropTypes.array.isRequired,
display_name: PropTypes.string,
descriptions: PropTypes.array,
mappings: PropTypes.any,
display_locale: PropTypes.string.isRequired,
display_locale: PropTypes.string,
}).isRequired,
};


export default PreviewCard;
8 changes: 5 additions & 3 deletions src/components/bulkConcepts/container/BulkConceptsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class BulkConceptsPage extends Component {
preview: PropTypes.shape({
url: PropTypes.string,
display_name: PropTypes.string,
}).isRequired,
}),
addConcept: PropTypes.func.isRequired,
datatypes: PropTypes.array.isRequired,
previewConcept: PropTypes.func.isRequired,
Expand All @@ -39,7 +39,9 @@ export class BulkConceptsPage extends Component {
}).isRequired,
}).isRequired,
};

static defaultProps = {
preview: {},
}
constructor(props) {
super(props);
this.state = {
Expand Down Expand Up @@ -129,7 +131,7 @@ export class BulkConceptsPage extends Component {
<SearchBar
handleSearch={this.handleSearch}
handleChange={this.handleChange}
inputValue={searchInput}
searchInput={searchInput}
/>
<Paginations
concepts={lastConcept}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export class DictionaryOverview extends Component {
typeName: propTypes.string,
}),
}).isRequired,
dictionary: propTypes.objectOf(propTypes.shape({
dictionaryName: propTypes.string,
})).isRequired,
dictionary: propTypes.object.isRequired,
dictionaryConcepts: propTypes.array.isRequired,
versions: propTypes.array.isRequired,
fetchDictionary: propTypes.func.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ const DictionaryDetailCard = (props) => {
openVersionModal,
handleCreateVersion,
handleChange,
versionId,
versionDescription,
inputLength,
download,
} = props;
Expand Down Expand Up @@ -83,8 +81,8 @@ const DictionaryDetailCard = (props) => {
<b>Public Access</b>: {public_access}
</p>
{description ? (
<p id="desc">
<b>Description</b>: {description}
<p id="desc">
<b>Description</b>: {description}
</p>
) : (
<p><b>Description</b>: No Description</p>
Expand All @@ -104,8 +102,6 @@ const DictionaryDetailCard = (props) => {
id="editB"
to="#"
onClick={showEditModal}
versionId={versionId}
versionDescription={versionDescription}
>
Edit
</Link>
Expand Down Expand Up @@ -161,30 +157,32 @@ const DictionaryDetailCard = (props) => {
<legend>Released Version</legend>
<div className="card" id="versionCard">
<table>
<tr>
<th>Version</th>
<th>Date</th>
<th>Actions</th>
</tr>
{releasedVersions.length >= 1 ? (
releasedVersions.map(version => (
<DictionaryVersionsTable
version={version}
key={version.id}
hide={hideSubModal}
showSubModal={showSubModal}
show={subModal}
url={subUrl}
download={download}
/>
))
) : (
<tr>
<td className="version-msg" colSpan="4">
No released Versions
</td>
</tr>
)}
<tbody>
<tr>
<th>Version</th>
<th>Date</th>
<th>Actions</th>
</tr>
{releasedVersions.length >= 1 ? (
releasedVersions.map(version => (
<DictionaryVersionsTable
version={version}
key={version.id}
hide={hideSubModal}
showSubModal={showSubModal}
show={subModal}
url={subUrl}
download={download}
/>
))
) : (
<tr>
<td className="version-msg" colSpan="4">
No released Versions
</td>
</tr>
)}
</tbody>
</table>
</div>
</fieldset>
Expand Down Expand Up @@ -223,8 +221,6 @@ DictionaryDetailCard.propTypes = {
openVersionModal: PropTypes.bool.isRequired,
handleCreateVersion: PropTypes.func.isRequired,
handleChange: PropTypes.func.isRequired,
versionId: PropTypes.string.isRequired,
versionDescription: PropTypes.string.isRequired,
inputLength: PropTypes.number.isRequired,
download: PropTypes.func.isRequired,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ const DictionaryVersionsTable = (version) => {
<td>{id}</td>
<td>{ (new Date(updated_on)).toLocaleDateString('en-US', DATE_OPTIONS)}</td>
<td><a href={version_url}>Browse in OCL</a> <Link className="downloadConcepts" onClick={download} to="#">Download</Link> <Link className="subscription-link" onClick={() => { showSubModal(version_url); }} to="#">Subscription URL</Link></td>
<SubscriptionModal
show={show}
click={hide}
url={url}
/>
<td className="d-none">
<SubscriptionModal
show={show}
click={hide}
url={url}
/>
</td>
</tr>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class EditDictionary extends React.Component {
constructor(props) {
super(props);
this.state = {
defaultLocaleOption: '',
defaultLocaleOption: {},
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ export class DictionaryModal extends React.Component {
<Select
id="copy_dictionary"
closeMenuOnSelect={false}
isLoading={this.props.isLoadingDictionaries}
options={[...this.props.userDictionaries, ...this.props.dictionaries]}
onChange={val => this.handleCopyDictionary(val)}
onInputChange={val => this.searchInputValues(val)}
Expand Down Expand Up @@ -402,21 +401,24 @@ DictionaryModal.propTypes = {
submit: PropTypes.func.isRequired,
organizations: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.string,
})).isRequired,
dictionary: PropTypes.object.isRequired,
})),
dictionary: PropTypes.object,
modalhide: PropTypes.func.isRequired,
defaultLocaleOption: PropTypes.object.isRequired,
isEditingDictionary: PropTypes.object.isRequired,
defaultLocaleOption: PropTypes.object,
isEditingDictionary: PropTypes.bool,
searchDictionaries: PropTypes.func.isRequired,
dictionaries: PropTypes.array.isRequired,
userDictionaries: PropTypes.array.isRequired,
isLoadingDictionaries: PropTypes.array.isRequired,
};

DictionaryModal.defaultProps = {
title: 'Add Dictionary',
show: false,
buttonname: 'Add Dictionary',
organizations: [],
dictionary: {},
isEditingDictionary: false,
defaultLocaleOption: {},
};

function mapStateToProps(state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,14 @@ ReleaseVersionModal.propTypes = {
click: PropTypes.func.isRequired,
handleCreateVersion: PropTypes.func.isRequired,
handleChange: PropTypes.func.isRequired,
versionId: PropTypes.string.isRequired,
versionDescription: PropTypes.string.isRequired,
versionId: PropTypes.string,
versionDescription: PropTypes.string,
inputLength: PropTypes.number.isRequired,
};

ReleaseVersionModal.defaultProps = {
versionId: '',
versionDescription: '',
};

export default ReleaseVersionModal;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ const InlineError = ({ text }) => (
<div><span id="inline-error"> {text} </span></div>
);
InlineError.propTypes = {
text: PropTypes.string.isRequired,
text: PropTypes.string,
};
InlineError.defaultProps = {
text: '',
};

export default InlineError;
7 changes: 3 additions & 4 deletions src/components/login/container/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ export class Login extends Component {
<Title title="Login" />
<div className="row form-container">
<div className="col-lg-5 col-md-9 col-sm-12">
<p className="paragraphs">
<h1 className="login-title">Open Concept Lab</h1>
<h4 className="low-title">for OpenMRS</h4>
</p>
<h1 className="login-title">Open Concept Lab</h1>
<h4 className="low-title">for OpenMRS</h4>
<h6 className="low-title-msg">
Use the shared Open Concept Lab to create OpenMRS dictionaries by mixing
expert-defined content with your own custom concepts.
Expand All @@ -72,6 +70,7 @@ export class Login extends Component {
value={username.trim()}
onChange={this.handleInput}
/>

</div>
<div className="form-group">
<label htmlFor="password">Password</label>
Expand Down

0 comments on commit 3130cfc

Please sign in to comment.