@@ -12,6 +12,14 @@ import IntegrationStepThree from '../IntegrationHelpers/IntegrationStepThree'
1212import ACPTAuthorization from './ACPTAuthorization'
1313import { checkMappedFields } from './ACPTCommonFunc'
1414import ACPTIntegLayout from './ACPTIntegLayout'
15+ import {
16+ cptFields ,
17+ cptLabels ,
18+ modules ,
19+ optionPageFields ,
20+ taxonomyFields ,
21+ taxonomyLabels
22+ } from './staticData'
1523
1624function ACPT ( { formFields, setFlow, flow, allIntegURL } ) {
1725 const navigate = useNavigate ( )
@@ -31,6 +39,7 @@ function ACPT({ formFields, setFlow, flow, allIntegURL }) {
3139 acptFields : [ ] ,
3240 acptLabels : [ ] ,
3341 utilities : { } ,
42+ icon : 'dashboard' ,
3443 module : '' ,
3544 cptFields,
3645 cptLabels,
@@ -58,18 +67,16 @@ function ACPT({ formFields, setFlow, flow, allIntegURL }) {
5867 document . getElementById ( 'btcd-settings-wrp' ) . scrollTop = 0
5968 } , 300 )
6069
61- if ( acptConf . module != 'update_license' && ! checkMappedFields ( acptConf ) ) {
70+ if ( ! checkMappedFields ( acptConf ) ) {
6271 toast . error ( __ ( 'Please map mandatory fields' , 'bit-integrations' ) )
6372 return
6473 }
6574
66- if ( acptConf . module === 'create_license' && ! acptConf ?. selectedStatus ) {
67- toast . error ( __ ( 'Please select Status' , 'bit-integrations' ) )
68- return
69- }
70-
71- if ( acptConf . module === 'update_license' && ! acptConf ?. selectedLicense ) {
72- toast . error ( __ ( 'Please select Status' , 'bit-integrations' ) )
75+ if (
76+ ( acptConf . module === 'create_cpt' || acptConf . module === 'create_option_page' ) &&
77+ ! acptConf ?. icon
78+ ) {
79+ toast . error ( __ ( 'Please select Icon' , 'bit-integrations' ) )
7380 return
7481 }
7582
@@ -138,126 +145,3 @@ function ACPT({ formFields, setFlow, flow, allIntegURL }) {
138145}
139146
140147export default ACPT
141-
142- const modules = [
143- { name : 'create_cpt' , label : __ ( 'Create CPT' , 'bit-integrations' ) , is_pro : false } ,
144- { name : 'update_cpt' , label : __ ( 'Update CPT' , 'bit-integrations' ) , is_pro : true } ,
145- { name : 'delete_cpt' , label : __ ( 'Delete CPT' , 'bit-integrations' ) , is_pro : true } ,
146- { name : 'create_taxonomy' , label : __ ( 'Create Taxonomy' , 'bit-integrations' ) , is_pro : true } ,
147- { name : 'update_taxonomy' , label : __ ( 'Update Taxonomy' , 'bit-integrations' ) , is_pro : true } ,
148- { name : 'delete_taxonomy' , label : __ ( 'Delete Taxonomy' , 'bit-integrations' ) , is_pro : true } ,
149- {
150- name : 'associate_taxonomy_to_cpt' ,
151- label : __ ( 'Associate Taxonomy To CPT' , 'bit-integrations' ) ,
152- is_pro : true
153- } ,
154- { name : 'create_option_page' , label : __ ( 'Create Option Page' , 'bit-integrations' ) , is_pro : true } ,
155- { name : 'update_option_page' , label : __ ( 'Update Option Page' , 'bit-integrations' ) , is_pro : true } ,
156- { name : 'delete_option_page' , label : __ ( 'Delete Option Page' , 'bit-integrations' ) , is_pro : true } ,
157- { name : 'delete_meta_group' , label : __ ( 'Delete Meta Field Group' , 'bit-integrations' ) , is_pro : true } ,
158- { name : 'delete_dynamic_block' , label : __ ( 'Delete Dynamic Block' , 'bit-integrations' ) , is_pro : true }
159- ]
160-
161- const cptFields = [
162- { label : __ ( 'Post Name' , 'bit-integrations' ) , key : 'post_name' , required : true } ,
163- { label : __ ( 'Singular Label' , 'bit-integrations' ) , key : 'singular_label' , required : true } ,
164- { label : __ ( 'Plural Label' , 'bit-integrations' ) , key : 'plural_label' , required : true } ,
165- { label : __ ( 'Icon' , 'bit-integrations' ) , key : 'icon' , required : true } ,
166- { label : __ ( 'REST API base slug' , 'bit-integrations' ) , key : 'rest_base' , required : false } ,
167- { label : __ ( 'Menu position' , 'bit-integrations' ) , key : 'menu_position' , required : false } ,
168- { label : __ ( 'Capability type' , 'bit-integrations' ) , key : 'capability_type' , required : false } ,
169- { label : __ ( 'Custom rewrite rules' , 'bit-integrations' ) , key : 'custom_rewrite' , required : false } ,
170- { label : __ ( 'Custom query var' , 'bit-integrations' ) , key : 'custom_query_var' , required : false }
171- ]
172-
173- const cptLabels = [
174- { label : __ ( 'Menu Name' , 'bit-integrations' ) , key : 'menu_name' } ,
175- { label : __ ( 'All Items' , 'bit-integrations' ) , key : 'all_items' } ,
176- { label : __ ( 'Add New' , 'bit-integrations' ) , key : 'add_new' } ,
177- { label : __ ( 'Add New Item' , 'bit-integrations' ) , key : 'add_new_item' } ,
178- { label : __ ( 'Edit Item' , 'bit-integrations' ) , key : 'edit_item' } ,
179- { label : __ ( 'New Item' , 'bit-integrations' ) , key : 'new_item' } ,
180- { label : __ ( 'View Item' , 'bit-integrations' ) , key : 'view_item' } ,
181- { label : __ ( 'View Items' , 'bit-integrations' ) , key : 'view_items' } ,
182- { label : __ ( 'Search Item' , 'bit-integrations' ) , key : 'search_item' } ,
183- { label : __ ( 'Not Found' , 'bit-integrations' ) , key : 'not_found' } ,
184- { label : __ ( 'Not Found in Trash' , 'bit-integrations' ) , key : 'not_found_in_trash' } ,
185- { label : __ ( 'Parent Item Colon' , 'bit-integrations' ) , key : 'parent_item_colon' } ,
186- { label : __ ( 'Featured Image' , 'bit-integrations' ) , key : 'featured_image' } ,
187- { label : __ ( 'Set Featured Image' , 'bit-integrations' ) , key : 'set_featured_image' } ,
188- { label : __ ( 'Remove Featured Image' , 'bit-integrations' ) , key : 'remove_featured_image' } ,
189- { label : __ ( 'Use Featured Image' , 'bit-integrations' ) , key : 'use_featured_image' } ,
190- { label : __ ( 'Archives' , 'bit-integrations' ) , key : 'archives' } ,
191- { label : __ ( 'Insert into Item' , 'bit-integrations' ) , key : 'insert_into_item' } ,
192- { label : __ ( 'Uploaded to This Item' , 'bit-integrations' ) , key : 'uploaded_to_this_item' } ,
193- { label : __ ( 'Filter Items List' , 'bit-integrations' ) , key : 'filter_items_list' } ,
194- { label : __ ( 'Items List Navigation' , 'bit-integrations' ) , key : 'items_list_navigation' } ,
195- { label : __ ( 'Items List' , 'bit-integrations' ) , key : 'items_list' } ,
196- { label : __ ( 'Filter by Date' , 'bit-integrations' ) , key : 'filter_by_date' } ,
197- { label : __ ( 'Item Published' , 'bit-integrations' ) , key : 'item_published' } ,
198- { label : __ ( 'Item Published Privately' , 'bit-integrations' ) , key : 'item_published_privately' } ,
199- { label : __ ( 'Item Reverted to Draft' , 'bit-integrations' ) , key : 'item_reverted_to_draft' } ,
200- { label : __ ( 'Item Scheduled' , 'bit-integrations' ) , key : 'item_scheduled' } ,
201- { label : __ ( 'Item Updated' , 'bit-integrations' ) , key : 'item_updated' }
202- ]
203-
204- const taxonomyLabels = [
205- { label : __ ( 'Menu Name' , 'bit-integrations' ) , key : 'name' } ,
206- { label : __ ( 'Singular name' , 'bit-integrations' ) , key : 'singular_name' } ,
207- { label : __ ( 'Search Items' , 'bit-integrations' ) , key : 'search_items' } ,
208- { label : __ ( 'Popular Items' , 'bit-integrations' ) , key : 'popular_items' } ,
209- { label : __ ( 'All Items' , 'bit-integrations' ) , key : 'all_items' } ,
210- { label : __ ( 'Parent Item' , 'bit-integrations' ) , key : 'parent_item' } ,
211- { label : __ ( 'Parent Item Colon' , 'bit-integrations' ) , key : 'parent_item_colon' } ,
212- { label : __ ( 'Edit Item' , 'bit-integrations' ) , key : 'edit_item' } ,
213- { label : __ ( 'View Item' , 'bit-integrations' ) , key : 'view_item' } ,
214- { label : __ ( 'Update Item' , 'bit-integrations' ) , key : 'update_item' } ,
215- { label : __ ( 'Add New Item' , 'bit-integrations' ) , key : 'add_new_item' } ,
216- { label : __ ( 'New Item Name' , 'bit-integrations' ) , key : 'new_item_name' } ,
217- {
218- label : __ ( 'Separate Items With Commas' , 'bit-integrations' ) ,
219- key : 'separate_items_with_commas'
220- } ,
221- { label : __ ( 'Add or Remove Items' , 'bit-integrations' ) , key : 'add_or_remove_items' } ,
222- {
223- label : __ ( 'Choose From Most Used' , 'bit-integrations' ) ,
224- key : 'choose_from_most_used'
225- } ,
226- { label : __ ( 'Not Found' , 'bit-integrations' ) , key : 'not_found' } ,
227- { label : __ ( 'No Terms' , 'bit-integrations' ) , key : 'no_terms' } ,
228- { label : __ ( 'Filter By Item' , 'bit-integrations' ) , key : 'filter_by_item' } ,
229- {
230- label : __ ( 'Items List Navigation' , 'bit-integrations' ) ,
231- key : 'items_list_navigation'
232- } ,
233- { label : __ ( 'Items List' , 'bit-integrations' ) , key : 'items_list' } ,
234- { label : __ ( 'Most Used' , 'bit-integrations' ) , key : 'most_used' } ,
235- { label : __ ( 'Back To Items' , 'bit-integrations' ) , key : 'back_to_items' }
236- ]
237-
238- const taxonomyFields = [
239- { label : __ ( 'Slug' , 'bit-integrations' ) , key : 'slug' , required : true } ,
240- { label : __ ( 'Singular Label' , 'bit-integrations' ) , key : 'singular_label' , required : true } ,
241- { label : __ ( 'Plural Label' , 'bit-integrations' ) , key : 'plural_label' , required : true } ,
242- { label : __ ( 'REST API base slug' , 'bit-integrations' ) , key : 'rest_base' , required : false } ,
243- {
244- label : __ ( 'REST API Controller Class' , 'bit-integrations' ) ,
245- key : 'rest_controller_class' ,
246- required : false
247- } ,
248- { label : __ ( 'Menu position' , 'bit-integrations' ) , key : 'menu_position' , required : false } ,
249- { label : __ ( 'Capability type' , 'bit-integrations' ) , key : 'capability_type' , required : false } ,
250- { label : __ ( 'Custom rewrite rules' , 'bit-integrations' ) , key : 'custom_rewrite' , required : false } ,
251- { label : __ ( 'Custom query var' , 'bit-integrations' ) , key : 'custom_query_var' , required : false } ,
252- { label : __ ( 'Default Term' , 'bit-integrations' ) , key : 'default_term' , required : false }
253- ]
254-
255- const optionPageFields = [
256- { label : __ ( 'Page Title' , 'bit-integrations' ) , key : 'pageTitle' , required : true } ,
257- { label : __ ( 'Menu Title' , 'bit-integrations' ) , key : 'menuTitle' , required : true } ,
258- { label : __ ( 'Menu Slug' , 'bit-integrations' ) , key : 'menuSlug' , required : true } ,
259- { label : __ ( 'Menu Icon' , 'bit-integrations' ) , key : 'icon' , required : true } ,
260- { label : __ ( 'Menu Position' , 'bit-integrations' ) , key : 'position' , required : true } ,
261- { label : __ ( 'Capability' , 'bit-integrations' ) , key : 'capability' , required : true } ,
262- { label : __ ( 'Page Description' , 'bit-integrations' ) , key : 'description' , required : false }
263- ]
0 commit comments