-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) : Adapt data sources to new schema specification and add `remo…
…te-select` Question
- Loading branch information
1 parent
6187fe1
commit 81507c6
Showing
9 changed files
with
165 additions
and
22 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
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
6 changes: 6 additions & 0 deletions
6
...ngx-formentry/src/form-entry/question-models/interfaces/remote-select-question-options.ts
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,6 @@ | ||
import { BaseOptions } from '../interfaces/base-options'; | ||
|
||
export interface RemoteSelectQuestionOptions extends BaseOptions { | ||
dataSource: string; | ||
dataSourceOptions?: Record<string, unknown>; | ||
} |
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
16 changes: 16 additions & 0 deletions
16
projects/ngx-formentry/src/form-entry/question-models/remote-select-question.ts
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,16 @@ | ||
import { QuestionBase } from './question-base'; | ||
import { AfeControlType } from '../../abstract-controls-extension/afe-control-type'; | ||
import { RemoteSelectQuestionOptions } from './interfaces/remote-select-question-options'; | ||
|
||
export class RemoteSelectQuestion extends QuestionBase { | ||
rendering: string; | ||
options: any[]; | ||
|
||
constructor(options: RemoteSelectQuestionOptions) { | ||
super(options); | ||
this.renderingType = 'select'; | ||
this.controlType = AfeControlType.AfeFormControl; | ||
this.dataSource = options.dataSource || ''; | ||
this.dataSourceOptions = options.dataSourceOptions || {}; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,17 +1,26 @@ | ||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; | ||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; | ||
import { | ||
provideHttpClient, | ||
withInterceptorsFromDi | ||
} from '@angular/common/http'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { ReactiveFormsModule } from '@angular/forms'; | ||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | ||
import { FormEntryModule } from '@openmrs/ngx-formentry'; | ||
import { AppComponent } from './app.component'; | ||
import { NgxTranslateModule } from './translate/translate.module'; | ||
|
||
@NgModule({ declarations: [AppComponent], | ||
schemas: [CUSTOM_ELEMENTS_SCHEMA], | ||
bootstrap: [AppComponent], imports: [BrowserModule, | ||
BrowserAnimationsModule, | ||
FormEntryModule, | ||
ReactiveFormsModule, | ||
NgxTranslateModule], providers: [provideHttpClient(withInterceptorsFromDi())] }) | ||
@NgModule({ | ||
declarations: [AppComponent], | ||
schemas: [CUSTOM_ELEMENTS_SCHEMA], | ||
bootstrap: [AppComponent], | ||
imports: [ | ||
BrowserModule, | ||
BrowserAnimationsModule, | ||
FormEntryModule, | ||
ReactiveFormsModule, | ||
NgxTranslateModule | ||
], | ||
providers: [provideHttpClient(withInterceptorsFromDi())] | ||
}) | ||
export class AppModule {} |