Skip to content

Commit

Permalink
Now uses object types without the space
Browse files Browse the repository at this point in the history
  • Loading branch information
jslane-h committed Jul 26, 2023
1 parent 3246543 commit 665191b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/app/api_to_method.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Verification Case": [
"VerificationCase": [
"case_already_in_suite",
"check_file",
"check_json_path_type",
Expand All @@ -13,7 +13,7 @@
"validate",
"validate_verification_case_structure"
],
"Data Processing": [
"DataProcessing": [
"add_parameter",
"apply_function",
"check",
Expand All @@ -27,7 +27,7 @@
"Reporting": [
"report_multiple_cases"
],
"Verification Library": [
"VerificationLibrary": [
"get_applicable_library_items_by_datapoints",
"get_library_item",
"get_library_items",
Expand Down
5 changes: 4 additions & 1 deletion src/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def initialize_ui(self, setting):
self.submit_button.setFixedSize(100, 20)
self.submit_button.clicked.connect(self.submit_form)

# self.reformat_button = QPushButton('Reformat')
# self.reformat_button.setFixedSize(100, 20)
# self.reformat_button.clicked.connect(self.validate_form)

buttons = QHBoxLayout()
buttons.addWidget(self.validate_button)
buttons.addWidget(self.submit_button)
Expand Down Expand Up @@ -252,7 +256,6 @@ def validate_form(self):
warnings.simplefilter(action="ignore", category=ResourceWarning)
validate_wf = Workflow(json_data)
valid = validate_wf.validate(verbose=True)
print(valid)
if valid:
self.submit_button.setEnabled(True)

Expand Down
6 changes: 3 additions & 3 deletions src/app/dependencies.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Verification Case": {
"VerificationCase": {
"Initialize": [
{"label": "Cases", "type": "line_edit"},
{"label": "JSON Case Path", "type": "line_edit"}
Expand All @@ -17,7 +17,7 @@
{"label": "Var Type", "type": "line_edit"}
]
},
"Data Processing": {
"DataProcessing": {
"Initialize": [
{"label": "Data Path", "type": "line_edit"},
{"label": "Data Source", "type": "line_edit"},
Expand Down Expand Up @@ -72,7 +72,7 @@
{"label": "Item Names", "type": "line_edit"}
]
},
"Verification Library": {
"VerificationLibrary": {
"Initialize": [
{"label": "Lib Path", "type": "line_edit"}
],
Expand Down
10 changes: 5 additions & 5 deletions src/app/popup_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ def load_method_ui(self, state, layout):
for p in state["Parameters"]
}
)
elif method_call in [api.replace(" ", "") for api in schema.keys()]:
object_type = re.sub(r"([a-z])([A-Z])", r"\1 \2", method_call)
elif method_call in schema.keys():
object_type = method_call
method = "Initialize"
if "Parameters" in state.keys():
parameters.update(
Expand Down Expand Up @@ -385,7 +385,7 @@ def update_form(self, custom=False):
method = self.method_combo_box.currentText()
fields = schema.get(object_type, {}).get(method, [])

if not custom and (not fields or method == "Initialize"):
if not custom and not fields:
object_type = "Verification Case"
method = "Initialize"
fields = schema.get(object_type, {}).get(method, [])
Expand Down Expand Up @@ -492,7 +492,7 @@ def save(self):
object = self.payload_combo_box.currentText()
self.form_data["MethodCall"] = f"Payloads['{object}'].{method}"

self.form_data["Parameters"] = []
self.form_data["Parameters"] = {}

for i in range(self.form_layout.count()):
item = self.form_layout.itemAt(i).widget()
Expand All @@ -513,7 +513,7 @@ def save(self):
self.form_data[parameter] = text
elif not self.current_params:
parameter = (parameter.lower()).replace(" ", "_")
self.form_data["Parameters"].append({parameter: text})
self.form_data["Parameters"][parameter] = text

self.close()

Expand Down
5 changes: 4 additions & 1 deletion src/app/workflow_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ def call_advanced_popup(self, rect=None, edit=False):
def item_clicked(self):
if self.view.itemClicked:
rect = self.view.itemClicked
self.call_popup(rect, True)
if self.setting == "basic":
self.call_popup(rect, True)
elif self.setting == "advanced":
self.call_advanced_popup(rect, True)

def read_import(self, states):
if isinstance(states, dict):
Expand Down

0 comments on commit 665191b

Please sign in to comment.