Skip to content

Commit

Permalink
(fix) KH-141: Remote Select dropdown at the end of the form content s…
Browse files Browse the repository at this point in the history
…hould display above all content. (#46)
  • Loading branch information
hadijahkyampeire authored Apr 25, 2023
1 parent da1c2bc commit de06193
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,28 @@ Which is should be fine if your are not working on custom components (Make sure

`$ yarn run build:lib`

### Linking ngx-formentry with form-entry-app in patient chart
While you have your patient chart and ngx-formentry repo open locally,
Build the ngx-formentry project by
running `$yarn run build:lib`

Then cd into the `dist/ngx-formentry` directory created from the previous step.
Run `$ pwd | pbcopy` to copy that path.

On the patient chart repo cd into `esm-form-entry-app`

While there, run `yarn link` + the path you copied earlier e.g `/Users/hadijahkyampeire/Desktop/openmrs-ngx-formentry/dist/ngx-formentry`.

The above command should install the local copy of the form entry library into the `esm-form-entry-app` package. You can check that this worked by opening the `package.json` manifest file entry for `@openmrs/ngx-formentry`.

When you start the form entry app, it should now be using the local copy of `openmrs-ngx-formentry`

The key thing to note is that an override for the form entry import map URL is already set up on the dev server.

Launch the patient chart and then you will be able to test your local changes.

Refer to this doc for detailed information [Ampath Forms docs](https://ampath-forms.vercel.app/docs/developer-guide/run-form-engine-in-openmrs3)

### Usage

`app.component.ts`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ import {
OnInit,
Input,
forwardRef,
ViewChild,
Output,
EventEmitter,
Renderer2
Renderer2,
} from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { concat, Observable, of, Subject } from 'rxjs';
import {
catchError,
debounceTime,
distinctUntilChanged,
switchMap,
tap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
typeToSearchText="Please enter 2 or more characters"
[typeahead]="remoteOptionInput$"
[(ngModel)]="selectedRemoteOptions"
[appendTo]="'form'"
(ngModelChange)="selected($event)"
>
</ng-select>
Expand Down
5 changes: 5 additions & 0 deletions projects/ngx-formentry/styles/ngx-formentry.css
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,15 @@
}

.ng-dropdown-panel {
margin-top: -1rem;
background: #fff;
left: 0;
}

.ng-select > .ng-dropdown-panel {
margin-top: 0;
}

.ng-dropdown-panel.ng-select-bottom {
top: calc(100% - 1.25em);
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
Expand Down

0 comments on commit de06193

Please sign in to comment.