Skip to content

Commit 78ea66d

Browse files
authored
Merge pull request #2516 from AkshataKatwal16/feat-lead-mapping-new
Issue feat:Add 'Board' filter for SCP CCTA and SCTAs and filter out retired boards from form
2 parents 5f9389c + 605431b commit 78ea66d

File tree

9 files changed

+102
-15
lines changed

9 files changed

+102
-15
lines changed

apps/admin-app-repo/src/constant/Forms/ContentCreatorSearch.js

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,40 @@ export const ContentCreatorSearchSchema = {
2525
isMultiSelect: true,
2626
maxSelection: 1000,
2727
},
28+
board: {
29+
"type": "array",
30+
"title": "BOARD",
31+
"coreField": 0,
32+
"fieldId": "f93c0ac3-f827-4794-9457-441fa1057b42",
33+
"field_type": "drop_down",
34+
"maxSelection": 10000,
35+
"isMultiSelect": true,
36+
"uniqueItems": true,
37+
"isRequired": true,
38+
"items": {
39+
"type": "string",
40+
"enum": [
41+
"Select"
42+
],
43+
"enumNames": [
44+
"Select"
45+
]
46+
},
47+
"api": {
48+
"url": "/api/dynamic-form/get-framework",
49+
"method": "POST",
50+
"options": {
51+
"label": "label",
52+
"value": "value",
53+
"optionObj": "options"
54+
},
55+
"payload": {
56+
"code": "board",
57+
"fetchUrl": `${process.env.NEXT_PUBLIC_MIDDLEWARE_URL}/api/framework/v1/read/scp-framework`
58+
},
59+
"callType": "initial"
60+
}
61+
},
2862
name: {
2963
type: 'string',
3064
title: 'Search Content Creator',
@@ -54,7 +88,14 @@ export const ContentCreatorUISchema = {
5488
uniqueItems: true,
5589
},
5690
},
57-
91+
board: {
92+
"ui:widget": "AutoCompleteMultiSelectWidget",
93+
"ui:options": {
94+
"multiple": true,
95+
"uniqueItems": true,
96+
"hideError": false
97+
}
98+
},
5899
firstName: {
59100
'ui:widget': 'SearchTextFieldWidget',
60101
},

apps/admin-app-repo/src/constant/Forms/ContentReviewerSearch.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,40 @@ export const ContentReviewerSearchSchema = {
2525
isMultiSelect: true,
2626
maxSelection: 1000,
2727
},
28+
board: {
29+
"type": "array",
30+
"title": "BOARD",
31+
"coreField": 0,
32+
"fieldId": "f93c0ac3-f827-4794-9457-441fa1057b42",
33+
"field_type": "drop_down",
34+
"maxSelection": 10000,
35+
"isMultiSelect": true,
36+
"uniqueItems": true,
37+
"isRequired": true,
38+
"items": {
39+
"type": "string",
40+
"enum": [
41+
"Select"
42+
],
43+
"enumNames": [
44+
"Select"
45+
]
46+
},
47+
"api": {
48+
"url": "/api/dynamic-form/get-framework",
49+
"method": "POST",
50+
"options": {
51+
"label": "label",
52+
"value": "value",
53+
"optionObj": "options"
54+
},
55+
"payload": {
56+
"code": "board",
57+
"fetchUrl": `${process.env.NEXT_PUBLIC_MIDDLEWARE_URL}/api/framework/v1/read/scp-framework`
58+
},
59+
"callType": "initial"
60+
}
61+
},
2862
name: {
2963
type: 'string',
3064
title: 'Search Content Reviewer',
@@ -54,6 +88,14 @@ export const ContentReviewerUISchema = {
5488
uniqueItems: true,
5589
},
5690
},
91+
board: {
92+
"ui:widget": "AutoCompleteMultiSelectWidget",
93+
"ui:options": {
94+
"multiple": true,
95+
"uniqueItems": true,
96+
"hideError": false
97+
}
98+
},
5799

58100
firstName: {
59101
'ui:widget': 'SearchTextFieldWidget',

apps/admin-app-repo/src/pages/api/dynamic-form/get-framework.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ export default function handler(req, res) {
5656
} else if (selectedvalue != '') {
5757
// Transform terms into options
5858
// console.log('in initial state');
59-
options = categories?.terms.map((term) => ({
60-
label: term.name,
61-
value: term.name,
62-
}));
59+
options = categories?.terms
60+
.filter((term) => term.status !== "Retired") // Filter out retired boards
61+
.map((term) => ({
62+
label: term.name,
63+
value: term.name,
64+
}));
6365
}
6466
// console.log('option', options);
6567
}

apps/teachers/src/pages/api/dynamic-form/get-framework.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ export default function handler(req, res) {
5656
} else if (selectedvalue != '') {
5757
// Transform terms into options
5858
// console.log('in initial state');
59-
options = categories?.terms.map((term) => ({
60-
label: term.name,
61-
value: term.name,
62-
}));
59+
options = categories?.terms
60+
.filter((term) => term.status !== "Retired") // Filter out retired boards
61+
.map((term) => ({
62+
label: term.name,
63+
value: term.name,
64+
}));
6365
}
6466
// console.log('option', options);
6567
}

libs/shared-lib-v2/src/DynamicForm/utils/Helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ export const getOptionsByCategory = (frameworks: any, categoryCode: string) => {
651651

652652
// Return the mapped terms
653653
return category?.terms?.filter((term: any) => {
654-
if (term.status === 'Live') {
654+
if (term.status === 'Live' && term.status !== "Retired") {
655655
return {
656656
name: term?.name,
657657
code: term?.code,

mfes/editors/src/utils/Helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const getOptionsByCategory = (frameworks: any, categoryCode: string) => {
5656
);
5757

5858
// Return the mapped terms
59-
return category.terms.map((term: any) => ({
59+
return category.terms.filter((term: any) => term.status !== "Retired").map((term: any) => ({
6060
name: term.name,
6161
code: term.code,
6262
associations: term.associations,

mfes/players/src/components/utils/Helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const getOptionsByCategory = (frameworks: any, categoryCode: string) => {
5656
);
5757

5858
// Return the mapped terms
59-
return category.terms.map((term: any) => ({
59+
return category.terms.filter((term: any) => term.status !== "Retired").map((term: any) => ({
6060
name: term.name,
6161
code: term.code,
6262
associations: term.associations,

mfes/workspace/src/components/ActionIcon.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const ActionIcon: React.FC<ActionCellProps> = ({
6262
</Box>
6363
</Tooltip>
6464

65-
{/* {rowData?.status === 'Live' && getLocalStoredUserRole()!==Role.SCTA&& (
65+
{rowData?.status === 'Live' && getLocalStoredUserRole()!==Role.SCTA&& (
6666
<Tooltip title="Unpublish">
6767
<Box
6868
onClick={() => {
@@ -102,7 +102,7 @@ const ActionIcon: React.FC<ActionCellProps> = ({
102102
<PublishIcon sx={{ color: 'green' }} />
103103
</Box>
104104
</Tooltip>
105-
)} */}
105+
)}
106106

107107
<DeleteConfirmation
108108
open={open}

mfes/workspace/src/utils/Helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const getOptionsByCategory = (frameworks: any, categoryCode: string) => {
5656
);
5757

5858
// Return the mapped terms
59-
return category.terms.map((term: any) => ({
59+
return category.terms.filter((term: any) => term.status !== "Retired").map((term: any) => ({
6060
name: term.name,
6161
code: term.code,
6262
associations: term.associations,

0 commit comments

Comments
 (0)