Pharmacy - Pharmaceuticals part 1#221
Pharmacy - Pharmaceuticals part 1#221aldaprile wants to merge 48 commits intoinformatici:developfrom
Conversation
First implementation of - Main Component showing pharmaceuticals - Component for creating a new medical
* CSS changes in navigation menu in AppHeader component * deleted commented code from AppHeader.tsx * Delete package-lock.json
Creazione component EditMedical e correzione prima bozza dell'action relativa a updateMedical Presenti issues in comunicazione con API per l'effettivo update, in attesa di meeting con ISF
Implementazione di Cancel in MedicalDataForm, adattamento del routing da Redirect a history.push
…into aldaprile-develop
* Fix: Removed double column crit. level * Add: Function to export table into .csv file * Merge branch 'develop' into Omar Fork develop Co-authored-by: OmarAvanade <omar.sobrino@avanade.com>
* Search bar UI: red icon, unified, outer outline. * SearchIcon resizing Co-authored-by: Natália Veras <natalia.veras.campos@avanade.com>
GUI version
Fix: Pharmaceuticals page propagations
First tranche of fixes regarding ISF feedback (tnsgong)
|
@aldaprile please is your pull request https://github.com/informatici/openhospital-ui/pull/221 reviewable? Please give me a response as soon as possible. |
| <PrivateRoute path="/details/:id"> | ||
| <PatientDetailsActivity /> | ||
| </PrivateRoute> | ||
| <PrivateRoute path="/Pharmacy"> |
There was a problem hiding this comment.
I think the route path should start with lower case. In your case it should be "/pharmacy". Please apply that in the whole file.
| <div className="medicalsGrid_main"> | ||
| <Paper> | ||
| <TableContainer> | ||
| <Table aria-label="simple table" size="small"> |
There was a problem hiding this comment.
Please use the custom table component in order to simplify the code. That path is here: \accessories\table\Table.tsx
| }; | ||
|
|
||
| //method to prepare .csv export | ||
| const csvDownload = (props: MedicalDTO[] | undefined): any => { |
There was a problem hiding this comment.
Please declare that function in libraries package in formatUtils directory, in order to simplify your code.
|
|
||
| const infoBoxRef = useRef<HTMLDivElement>(null); | ||
|
|
||
| const initialValues : TValues = {critical: undefined, desc: undefined, nameSorted: undefined, type: undefined } |
There was a problem hiding this comment.
Please declare initialValues in a consts.ts file in order to simplify your code.
| } | ||
| }; | ||
|
|
||
| const [options, setOptions] = useState(medicalTypesOptions); |
There was a problem hiding this comment.
Please remove this state options and all its logic. The place where you use options instead use medicalTypesOptions directly and you will get the same result with few code.
| } | ||
| }; | ||
|
|
||
| const mapStateToProps = (state: IState): IStateProps => ({ |
There was a problem hiding this comment.
I suggest to use hooks to handle the state logic. Please take a look on BillRecords for example to see how you can use hooks to handle your state logic. Also you should know that when you choose to use hooks to handle your state logic yoiu should not use mapStateToProps any more. Hooks are alternatives for that. I inivte you to apply that suggestion in all your components.
| isValid={true} | ||
| errorText={""} | ||
| onBlur={onBlurSelect} | ||
| options={options || []} |
There was a problem hiding this comment.
Following the comment above you should use medicalTypesOptions variable here.
| </div> | ||
| </div> | ||
| {/* Search bar */} | ||
| <form className="medicals__panel" onSubmit={formik.handleSubmit}> |
There was a problem hiding this comment.
According to me, we should keep things as simple as possible. Just add a filter form plus a filter button (or search button) in order to filter the table. Also I suggest to disjoint select field and textfield so one can add more filter item easily. What do you think? The filter form should be more expandable if we do that.
|
Hello guys, first of all thanks in advance for your work regarding the Pharmacy section. Let me introduce @almeida1492, @tsognong and me that we are the current dev team of this project. I want to point out few things in order to make your code compliant with the Open Hospital standards. In the past few weeks we reviewed your work and we point out some things that you should change, in particular:
Furthermore, I want to submit to you some giudeline references: https://openhospital.atlassian.net/wiki/spaces/OH/pages/6946820/Contribution+Guidelines For any other suggestion we are at your disposal, just write here. |
|
Hello all, has anyone in his/her hand this work? Is it possible to resume/continue it? Thanks! |
|
@SteveGT96 I think this work will be replaced by a new one, am I right? If so, please close this PR. Thanks a lot! |
No description provided.