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
d9582fec
Commit
d9582fec
authored
2 years ago
by
5Amogh
Browse files
Options
Download
Patches
Plain Diff
Issue #RRHE-48 feat:Customized configurable filters for filtered task detail report type
parent
f991c225
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
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/app/client/src/app/modules/program-dashboard/components/program-datasets/program-datasets.component.html
+5
-2
...mponents/program-datasets/program-datasets.component.html
src/app/client/src/app/modules/program-dashboard/components/program-datasets/program-datasets.component.ts
+19
-35
...components/program-datasets/program-datasets.component.ts
src/app/client/src/app/modules/program-dashboard/shared/pd-filters/pd-filters.component.html
+0
-3
...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.ts
+1
-2
...ogram-dashboard/shared/pd-filters/pd-filters.component.ts
with
25 additions
and
42 deletions
+25
-42
src/app/client/src/app/modules/program-dashboard/components/program-datasets/program-datasets.component.html
+
5
−
2
View file @
d9582fec
...
@@ -121,9 +121,12 @@
...
@@ -121,9 +121,12 @@
<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"
>
<ng-container
*ngIf=
"pdFilters.length"
>
<app-pd-filters
[pdFilter]=
"filter"
(filterChanged)=
"filterChanged($event)"
></app-pd-filters>
<ng-container
*ngFor=
"let filter of pdFilters"
>
<app-pd-filters
[pdFilter]=
"filter"
(filterChanged)=
"pdFilterChanged($event)"
></app-pd-filters>
</ng-container>
</ng-container>
</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
+
19
−
35
View file @
d9582fec
...
@@ -13,6 +13,7 @@ import * as moment from 'moment';
...
@@ -13,6 +13,7 @@ import * as moment from 'moment';
import
html2canvas
from
'
html2canvas
'
;
import
html2canvas
from
'
html2canvas
'
;
import
*
as
jspdf
from
'
jspdf
'
;
import
*
as
jspdf
from
'
jspdf
'
;
const
PRE_DEFINED_PARAMETERS
=
[
'
$slug
'
,
'
hawk-eye
'
];
const
PRE_DEFINED_PARAMETERS
=
[
'
$slug
'
,
'
hawk-eye
'
];
@
Component
({
@
Component
({
selector
:
'
app-datasets
'
,
selector
:
'
app-datasets
'
,
templateUrl
:
'
./program-datasets.component.html
'
,
templateUrl
:
'
./program-datasets.component.html
'
,
...
@@ -94,28 +95,7 @@ export class DatasetsComponent implements OnInit, OnDestroy {
...
@@ -94,28 +95,7 @@ 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
=
[{
pdFilters
:
object
[]
=
[];
'
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
=
{}
configuredFilters
:
any
=
{}
constructor
(
constructor
(
activatedRoute
:
ActivatedRoute
,
activatedRoute
:
ActivatedRoute
,
...
@@ -567,23 +547,22 @@ export class DatasetsComponent implements OnInit, OnDestroy {
...
@@ -567,23 +547,22 @@ export class DatasetsComponent implements OnInit, OnDestroy {
reportChanged
(
selectedReportData
)
{
reportChanged
(
selectedReportData
)
{
this
.
selectedReport
=
selectedReportData
;
this
.
selectedReport
=
selectedReportData
;
console
.
log
(
'
Selected report
'
,
this
.
selectedReport
)
if
(
this
.
selectedReport
.
configurableFilters
){
this
.
pdFilters
=
this
.
selectedReport
.
uiFilters
;
this
.
pdFilters
.
map
(
filter
=>
{
this
.
configuredFilters
[
filter
[
'
reference
'
]]
=
filter
[
'
defaultValue
'
]
as
number
-
1
})
}
}
}
filterChanged
(
$event
){
pdFilterChanged
(
$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
const
[
reference
,
value
]
=
[
Object
.
keys
(
$event
),
Object
.
values
(
$event
)]
;
let
reference
:
string
|
unknown
=
Object
.
keys
(
$event
);
this
.
configuredFilters
[
reference
[
0
]]
=
[
0
,
null
].
includes
(
value
[
0
]
as
number
)
?
0
:
value
[
0
]
as
number
-
1
;
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
(
'
from event emitter
'
,
Object
.
keys
(
$event
),
Object
.
values
(
$event
))
console
.
log
(
'
configuredFilters
'
,
this
.
configuredFilters
)
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
'
),
...
@@ -594,7 +573,10 @@ export class DatasetsComponent implements OnInit, OnDestroy {
...
@@ -594,7 +573,10 @@ export class DatasetsComponent implements OnInit, OnDestroy {
organisation_id
:
_
.
get
(
this
.
reportForm
,
'
controls.organisationName.value
'
)
||
undefined
,
organisation_id
:
_
.
get
(
this
.
reportForm
,
'
controls.organisationName.value
'
)
||
undefined
,
...
this
.
configuredFilters
...
this
.
configuredFilters
}
}
let
keys
=
Object
.
keys
(
filterKeysObj
);
let
keys
=
Object
.
keys
(
filterKeysObj
);
console
.
log
(
'
filterKeysObj
'
,
'
keys
'
,
filterKeysObj
,
keys
)
this
.
selectedReport
[
'
filters
'
].
map
(
data
=>
{
this
.
selectedReport
[
'
filters
'
].
map
(
data
=>
{
keys
.
filter
(
key
=>
{
keys
.
filter
(
key
=>
{
return
data
.
dimension
==
key
&&
(
data
.
value
=
filterKeysObj
[
key
]);
return
data
.
dimension
==
key
&&
(
data
.
value
=
filterKeysObj
[
key
]);
...
@@ -603,6 +585,7 @@ export class DatasetsComponent implements OnInit, OnDestroy {
...
@@ -603,6 +585,7 @@ export class DatasetsComponent implements OnInit, OnDestroy {
this
.
filter
.
push
(
data
);
this
.
filter
.
push
(
data
);
}
}
});
});
console
.
log
(
'
Filters to be sent
'
,
this
.
filter
);
}
}
submitRequest
()
{
submitRequest
()
{
this
.
addFilters
();
this
.
addFilters
();
...
@@ -700,6 +683,7 @@ export class DatasetsComponent implements OnInit, OnDestroy {
...
@@ -700,6 +683,7 @@ export class DatasetsComponent implements OnInit, OnDestroy {
this
.
formService
.
getFormConfig
(
formServiceInputParams
).
subscribe
((
formData
)
=>
{
this
.
formService
.
getFormConfig
(
formServiceInputParams
).
subscribe
((
formData
)
=>
{
if
(
formData
)
{
if
(
formData
)
{
this
.
formData
=
formData
;
this
.
formData
=
formData
;
console
.
log
(
'
Form Data
'
,
this
.
formData
)
}
}
},
error
=>
{
},
error
=>
{
this
.
toasterService
.
error
(
this
.
resourceService
.
messages
.
emsg
.
m0005
);
this
.
toasterService
.
error
(
this
.
resourceService
.
messages
.
emsg
.
m0005
);
...
...
This diff is collapsed.
Click to expand it.
src/app/client/src/app/modules/program-dashboard/shared/pd-filters/pd-filters.component.html
+
0
−
3
View file @
d9582fec
<form
class=
"d-flex flex-dr"
[formGroup]=
"pdFiltersFormGroup"
>
<form
class=
"d-flex flex-dr"
[formGroup]=
"pdFiltersFormGroup"
>
<!-- <ng-container *ngFor="let filter of pdFilters"> -->
<div
class=
"d-flex flex-dc"
>
<div
class=
"d-flex flex-dc"
>
<label>
{{ pdFilter.label }}
</label>
<label>
{{ pdFilter.label }}
</label>
<ng-container
*ngIf=
"pdFilter.controlType === 'number'"
>
<ng-container
*ngIf=
"pdFilter.controlType === 'number'"
>
...
@@ -11,12 +10,10 @@
...
@@ -11,12 +10,10 @@
matInput
matInput
type=
"number"
type=
"number"
[formControlName]=
"pdFilter.reference"
[formControlName]=
"pdFilter.reference"
[placeholder]=
"pdFilter.placeholder"
[value]=
"pdFilter.defaultValue"
[value]=
"pdFilter.defaultValue"
(input)=
"inputChange()"
(input)=
"inputChange()"
/>
/>
</mat-form-field>
</mat-form-field>
</ng-container>
</ng-container>
</div>
</div>
<!-- </ng-container> -->
</form>
</form>
This diff is collapsed.
Click to expand it.
src/app/client/src/app/modules/program-dashboard/shared/pd-filters/pd-filters.component.scss
deleted
100644 → 0
+
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.ts
+
1
−
2
View file @
d9582fec
...
@@ -4,8 +4,7 @@ import * as _ from "lodash-es";
...
@@ -4,8 +4,7 @@ import * as _ from "lodash-es";
@
Component
({
@
Component
({
selector
:
"
app-pd-filters
"
,
selector
:
"
app-pd-filters
"
,
templateUrl
:
"
./pd-filters.component.html
"
,
templateUrl
:
"
./pd-filters.component.html
"
styleUrls
:
[
"
./pd-filters.component.scss
"
],
})
})
export
class
PdFiltersComponent
implements
OnInit
{
export
class
PdFiltersComponent
implements
OnInit
{
@
Input
()
pdFilter
:
any
;
@
Input
()
pdFilter
:
any
;
...
...
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