Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-SunbirdEd-portal-old
Commits
f991c225
Commit
f991c225
authored
2 years ago
by
5Amogh
Browse files
Options
Download
Patches
Plain Diff
Issue #RRHE-48 Customized configurable filters for VAM
parent
8ee017c5
master
dependabot/npm_and_yarn/src/app/client/decode-uri-component-0.2.2
dependabot/npm_and_yarn/src/app/decode-uri-component-0.2.2
dependabot/npm_and_yarn/src/app/express-4.17.3
dependabot/npm_and_yarn/src/app/jsonwebtoken-9.0.0
dependabot/npm_and_yarn/src/desktop/OpenRAP/decode-uri-component-0.2.2
dependabot/npm_and_yarn/src/desktop/OpenRAP/express-4.17.3
dependabot/npm_and_yarn/src/desktop/OpenRAP/jsonwebtoken-9.0.0
dependabot/npm_and_yarn/src/desktop/OpenRAP/qs-6.5.3
dependabot/npm_and_yarn/src/desktop/decode-uri-component-0.2.2
dependabot/npm_and_yarn/src/desktop/express-4.17.3
dependabot/npm_and_yarn/src/desktop/jsonwebtoken-9.0.0
dependabot/npm_and_yarn/src/desktop/qs-6.10.3
filters_5.1.1
gcp_test
release-5.0.0
release-5.0.0.1
release-5.0.0.2
release-5.0.0.3
release-5.0.1
release-5.0.2
release-5.1.0
release-5.1.1
sharathkashyap-patch-1
Tags unavailable
No related merge requests found
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
src/app/client/src/app/modules/program-dashboard/components/program-datasets/program-datasets.component.html
+3
-0
...mponents/program-datasets/program-datasets.component.html
src/app/client/src/app/modules/program-dashboard/components/program-datasets/program-datasets.component.ts
+41
-1
...components/program-datasets/program-datasets.component.ts
src/app/client/src/app/modules/program-dashboard/program-dashboard.module.ts
+7
-1
...app/modules/program-dashboard/program-dashboard.module.ts
src/app/client/src/app/modules/program-dashboard/shared/pd-filters/pd-filters.component.html
+22
-0
...ram-dashboard/shared/pd-filters/pd-filters.component.html
src/app/client/src/app/modules/program-dashboard/shared/pd-filters/pd-filters.component.scss
+0
-0
...ram-dashboard/shared/pd-filters/pd-filters.component.scss
src/app/client/src/app/modules/program-dashboard/shared/pd-filters/pd-filters.component.spec.ts
+25
-0
...-dashboard/shared/pd-filters/pd-filters.component.spec.ts
src/app/client/src/app/modules/program-dashboard/shared/pd-filters/pd-filters.component.ts
+33
-0
...ogram-dashboard/shared/pd-filters/pd-filters.component.ts
with
131 additions
and
2 deletions
+131
-2
src/app/client/src/app/modules/program-dashboard/components/program-datasets/program-datasets.component.html
+
3
−
0
View file @
f991c225
...
@@ -121,6 +121,9 @@
...
@@ -121,6 +121,9 @@
<mat-datepicker
#picker
></mat-datepicker>
<mat-datepicker
#picker
></mat-datepicker>
</mat-form-field>
</mat-form-field>
</div>
</div>
<ng-container
*ngFor=
"let filter of pdFilters"
>
<app-pd-filters
[pdFilter]=
"filter"
(filterChanged)=
"filterChanged($event)"
></app-pd-filters>
</ng-container>
<div
class=
"d-flex flex-dc ml-auto mt-12"
>
<div
class=
"d-flex flex-dc ml-auto mt-12"
>
<button
type=
"button"
class=
"sb-field sb-btn sb-btn-normal sb-btn-primary reset-filter flex-as-flex-end"
(click)=
"resetFilter()"
>
{{resourceService?.frmelmnts?.btn?.resetFilters}}
</button>
<button
type=
"button"
class=
"sb-field sb-btn sb-btn-normal sb-btn-primary reset-filter flex-as-flex-end"
(click)=
"resetFilter()"
>
{{resourceService?.frmelmnts?.btn?.resetFilters}}
</button>
<mat-form-field
*ngIf=
"!noResult && (tabIndex == 1)"
appearance=
"fill"
class=
"sb-mat__dropdown custom_mat_dd"
>
<mat-form-field
*ngIf=
"!noResult && (tabIndex == 1)"
appearance=
"fill"
class=
"sb-mat__dropdown custom_mat_dd"
>
...
...
This diff is collapsed.
Click to expand it.
src/app/client/src/app/modules/program-dashboard/components/program-datasets/program-datasets.component.ts
+
41
−
1
View file @
f991c225
...
@@ -94,6 +94,29 @@ export class DatasetsComponent implements OnInit, OnDestroy {
...
@@ -94,6 +94,29 @@ export class DatasetsComponent implements OnInit, OnDestroy {
maxStartDate
:
any
;
//Start date - has to be one day less than end date
maxStartDate
:
any
;
//Start date - has to be one day less than end date
displayFilters
:
any
=
{};
displayFilters
:
any
=
{};
loadash
=
_
;
loadash
=
_
;
pdFilters
=
[{
'
label
'
:
'
Minimum no. of tasks in the project
'
,
'
placeholder
'
:
'
Minimum no. of tasks in the project
'
,
'
controlType
'
:
'
number
'
,
'
reference
'
:
'
minTaskNumber
'
,
'
defaultValue
'
:
'
5
'
,
},
{
'
label
'
:
'
Minimum no. of task evidence
'
,
'
placeholder
'
:
'
Minimum no. of task evidence
'
,
'
controlType
'
:
'
number
'
,
'
reference
'
:
'
minTaskEvidence
'
,
'
defaultValue
'
:
'
2
'
,
},
{
'
label
'
:
'
Minimum no. of project evidence
'
,
'
placeholder
'
:
'
Minimum no. of project evidence
'
,
'
controlType
'
:
'
number
'
,
'
reference
'
:
'
minProjectEvidence
'
,
'
defaultValue
'
:
'
1
'
,
}
]
configuredFilters
:
any
=
{}
constructor
(
constructor
(
activatedRoute
:
ActivatedRoute
,
activatedRoute
:
ActivatedRoute
,
public
layoutService
:
LayoutService
,
public
layoutService
:
LayoutService
,
...
@@ -545,6 +568,22 @@ export class DatasetsComponent implements OnInit, OnDestroy {
...
@@ -545,6 +568,22 @@ export class DatasetsComponent implements OnInit, OnDestroy {
reportChanged
(
selectedReportData
)
{
reportChanged
(
selectedReportData
)
{
this
.
selectedReport
=
selectedReportData
;
this
.
selectedReport
=
selectedReportData
;
}
}
filterChanged
(
$event
){
//this event will conatain data emitted by pd-filter method and will have only one property thus there will be only one key and value
let
reference
:
string
|
unknown
=
Object
.
keys
(
$event
);
let
value
:
number
|
unknown
=
Object
.
values
(
$event
);
this
.
configuredFilters
[
`
${
reference
[
0
]}
`
]
=
value
[
0
]
-
1
;
// if(this.reportForm.contains(`${reference[0]}`)){
// let updateControl = {};
// updateControl[`${reference[0]}`] = value[0]-1
// this.reportForm.patchValue(updateControl);
// }else{
// this.reportForm.addControl(`${reference[0]}`, new FormControl(value[0]-1))
// }
console
.
log
(
'
from event emitter
'
,
Object
.
keys
(
$event
),
Object
.
values
(
$event
))
console
.
log
(
'
configuredFilters
'
,
this
.
configuredFilters
)
}
addFilters
()
{
addFilters
()
{
let
filterKeysObj
=
{
let
filterKeysObj
=
{
program_id
:
_
.
get
(
this
.
reportForm
,
'
controls.programName.value
'
),
program_id
:
_
.
get
(
this
.
reportForm
,
'
controls.programName.value
'
),
...
@@ -552,7 +591,8 @@ export class DatasetsComponent implements OnInit, OnDestroy {
...
@@ -552,7 +591,8 @@ export class DatasetsComponent implements OnInit, OnDestroy {
programId
:
_
.
get
(
this
.
reportForm
,
'
controls.programName.value
'
),
programId
:
_
.
get
(
this
.
reportForm
,
'
controls.programName.value
'
),
solutionId
:
_
.
get
(
this
.
reportForm
,
'
controls.solution.value
'
),
solutionId
:
_
.
get
(
this
.
reportForm
,
'
controls.solution.value
'
),
district_externalId
:
_
.
get
(
this
.
reportForm
,
'
controls.districtName.value
'
)
||
undefined
,
district_externalId
:
_
.
get
(
this
.
reportForm
,
'
controls.districtName.value
'
)
||
undefined
,
organisation_id
:
_
.
get
(
this
.
reportForm
,
'
controls.organisationName.value
'
)
||
undefined
organisation_id
:
_
.
get
(
this
.
reportForm
,
'
controls.organisationName.value
'
)
||
undefined
,
...
this
.
configuredFilters
}
}
let
keys
=
Object
.
keys
(
filterKeysObj
);
let
keys
=
Object
.
keys
(
filterKeysObj
);
this
.
selectedReport
[
'
filters
'
].
map
(
data
=>
{
this
.
selectedReport
[
'
filters
'
].
map
(
data
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/app/client/src/app/modules/program-dashboard/program-dashboard.module.ts
+
7
−
1
View file @
f991c225
...
@@ -25,6 +25,9 @@ import { MatDatepickerModule } from '@angular/material/datepicker';
...
@@ -25,6 +25,9 @@ import { MatDatepickerModule } from '@angular/material/datepicker';
import
{
SbBignumberComponent
}
from
'
./shared/sb-bignumber/sb-bignumber.component
'
;
import
{
SbBignumberComponent
}
from
'
./shared/sb-bignumber/sb-bignumber.component
'
;
import
{
SbTableComponent
}
from
'
./shared/sb-table/sb-table.component
'
;
import
{
SbTableComponent
}
from
'
./shared/sb-table/sb-table.component
'
;
import
{
MomentDateAdapter
}
from
'
@angular/material-moment-adapter
'
;
import
{
MomentDateAdapter
}
from
'
@angular/material-moment-adapter
'
;
import
{
PdFiltersComponent
}
from
'
./shared/pd-filters/pd-filters.component
'
;
import
{
MatFormFieldModule
}
from
'
@angular/material/form-field
'
;
import
{
MatInputModule
}
from
'
@angular/material/input
'
;
const
TIME_RANGE_DATE_FORMAT
=
{
const
TIME_RANGE_DATE_FORMAT
=
{
parse
:
{
parse
:
{
...
@@ -45,7 +48,8 @@ const TIME_RANGE_DATE_FORMAT = {
...
@@ -45,7 +48,8 @@ const TIME_RANGE_DATE_FORMAT = {
SbChartComponent
,
SbChartComponent
,
FilterChartPipe
,
FilterChartPipe
,
SbBignumberComponent
,
SbBignumberComponent
,
SbTableComponent
SbTableComponent
,
PdFiltersComponent
],
],
imports
:
[
imports
:
[
CommonModule
,
CommonModule
,
...
@@ -56,6 +60,8 @@ const TIME_RANGE_DATE_FORMAT = {
...
@@ -56,6 +60,8 @@ const TIME_RANGE_DATE_FORMAT = {
TelemetryModule
,
TelemetryModule
,
FormsModule
,
FormsModule
,
ReactiveFormsModule
,
ReactiveFormsModule
,
MatFormFieldModule
,
MatInputModule
,
programDashboardRoutingModule
,
programDashboardRoutingModule
,
MatCheckboxModule
,
MatCheckboxModule
,
MatTabsModule
,
MatTabsModule
,
...
...
This diff is collapsed.
Click to expand it.
src/app/client/src/app/modules/program-dashboard/shared/pd-filters/pd-filters.component.html
0 → 100644
+
22
−
0
View file @
f991c225
<form
class=
"d-flex flex-dr"
[formGroup]=
"pdFiltersFormGroup"
>
<!-- <ng-container *ngFor="let filter of pdFilters"> -->
<div
class=
"d-flex flex-dc"
>
<label>
{{ pdFilter.label }}
</label>
<ng-container
*ngIf=
"pdFilter.controlType === 'number'"
>
<mat-form-field
appearance=
"fill"
class=
"sb-mat__dropdown custom_mat_dd"
>
<input
matInput
type=
"number"
[formControlName]=
"pdFilter.reference"
[placeholder]=
"pdFilter.placeholder"
[value]=
"pdFilter.defaultValue"
(input)=
"inputChange()"
/>
</mat-form-field>
</ng-container>
</div>
<!-- </ng-container> -->
</form>
This diff is collapsed.
Click to expand it.
src/app/client/src/app/modules/program-dashboard/shared/pd-filters/pd-filters.component.scss
0 → 100644
+
0
−
0
View file @
f991c225
This diff is collapsed.
Click to expand it.
src/app/client/src/app/modules/program-dashboard/shared/pd-filters/pd-filters.component.spec.ts
0 → 100644
+
25
−
0
View file @
f991c225
import
{
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
PdFiltersComponent
}
from
'
./pd-filters.component
'
;
describe
(
'
PdFiltersComponent
'
,
()
=>
{
let
component
:
PdFiltersComponent
;
let
fixture
:
ComponentFixture
<
PdFiltersComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
PdFiltersComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
PdFiltersComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
This diff is collapsed.
Click to expand it.
src/app/client/src/app/modules/program-dashboard/shared/pd-filters/pd-filters.component.ts
0 → 100644
+
33
−
0
View file @
f991c225
import
{
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
}
from
"
@angular/core
"
;
import
{
FormBuilder
,
FormGroup
}
from
"
@angular/forms
"
;
import
*
as
_
from
"
lodash-es
"
;
@
Component
({
selector
:
"
app-pd-filters
"
,
templateUrl
:
"
./pd-filters.component.html
"
,
styleUrls
:
[
"
./pd-filters.component.scss
"
],
})
export
class
PdFiltersComponent
implements
OnInit
{
@
Input
()
pdFilter
:
any
;
@
Output
()
filterChanged
=
new
EventEmitter
();
pdFiltersFormGroup
:
FormGroup
;
constructor
(
public
fb
:
FormBuilder
)
{}
ngOnInit
():
void
{
this
.
generateForm
();
}
generateForm
()
{
this
.
pdFiltersFormGroup
=
this
.
fb
.
group
({});
this
.
pdFiltersFormGroup
.
addControl
(
_
.
get
(
this
.
pdFilter
,
"
reference
"
),
this
.
fb
.
control
(
""
)
);
}
inputChange
()
{
this
.
filterChanged
.
emit
(
this
.
pdFiltersFormGroup
.
value
)
console
.
log
(
'
filter group values
'
,
this
.
pdFiltersFormGroup
.
value
)
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets