Update app.py
Browse files
app.py
CHANGED
@@ -125,26 +125,34 @@ with gr.Blocks(title="Salesforce B2B Commerce Migration Assistant") as app:
|
|
125 |
)
|
126 |
|
127 |
with gr.Tab("Apex Trigger Correction"):
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
|
149 |
with gr.Tab("CloudCraze Object Conversion"):
|
150 |
gr.Markdown("### CloudCraze to B2B LEx Object Conversion")
|
@@ -158,15 +166,20 @@ with gr.Blocks(title="Salesforce B2B Commerce Migration Assistant") as app:
|
|
158 |
|
159 |
object_output = gr.Textbox(
|
160 |
lines=20,
|
161 |
-
label="Converted B2B LEx Object"
|
|
|
162 |
)
|
163 |
|
164 |
object_button = gr.Button("Convert Object")
|
165 |
object_button.click(
|
166 |
fn=convert_cc_object,
|
167 |
inputs=[model_dropdown, object_input],
|
168 |
-
outputs=object_output
|
|
|
169 |
)
|
|
|
|
|
|
|
170 |
|
171 |
gr.Markdown("### About This Tool")
|
172 |
gr.Markdown("""
|
|
|
125 |
)
|
126 |
|
127 |
with gr.Tab("Apex Trigger Correction"):
|
128 |
+
gr.Markdown("### Apex Trigger Correction")
|
129 |
+
gr.Markdown("Paste your Apex Trigger code below to correct issues for B2B LEx compatibility")
|
130 |
+
|
131 |
+
trigger_input = gr.Textbox(
|
132 |
+
lines=15,
|
133 |
+
placeholder="Paste your Apex Trigger code here...",
|
134 |
+
label="Apex Trigger Code"
|
135 |
+
)
|
136 |
+
|
137 |
+
# Make output multiline, interactive (allow scroll)
|
138 |
+
trigger_output = gr.Textbox(
|
139 |
+
lines=20,
|
140 |
+
label="Corrected Apex Trigger",
|
141 |
+
interactive=True # allows user to select/copy text easily
|
142 |
+
)
|
143 |
+
|
144 |
+
# Add the Correct button with loading indicator
|
145 |
+
trigger_button = gr.Button("Correct Apex Trigger")
|
146 |
+
trigger_button.click(
|
147 |
+
fn=correct_apex_trigger,
|
148 |
+
inputs=[model_dropdown, trigger_input],
|
149 |
+
outputs=trigger_output,
|
150 |
+
show_progress=True # this enables loading spinner on button
|
151 |
+
)
|
152 |
+
|
153 |
+
# Add a Clear button to reset the output textbox
|
154 |
+
trigger_clear = gr.Button("Clear")
|
155 |
+
trigger_clear.click(lambda: "", [], trigger_output)
|
156 |
|
157 |
with gr.Tab("CloudCraze Object Conversion"):
|
158 |
gr.Markdown("### CloudCraze to B2B LEx Object Conversion")
|
|
|
166 |
|
167 |
object_output = gr.Textbox(
|
168 |
lines=20,
|
169 |
+
label="Converted B2B LEx Object",
|
170 |
+
interactive=True
|
171 |
)
|
172 |
|
173 |
object_button = gr.Button("Convert Object")
|
174 |
object_button.click(
|
175 |
fn=convert_cc_object,
|
176 |
inputs=[model_dropdown, object_input],
|
177 |
+
outputs=object_output,
|
178 |
+
show_progress=True
|
179 |
)
|
180 |
+
|
181 |
+
object_clear = gr.Button("Clear")
|
182 |
+
object_clear.click(lambda: "", [], object_output)
|
183 |
|
184 |
gr.Markdown("### About This Tool")
|
185 |
gr.Markdown("""
|