Skip to content

Commit

Permalink
Merge pull request #73 from issue-ops/ncalteen/72
Browse files Browse the repository at this point in the history
Default to template field ID for parsed issue body key
  • Loading branch information
ncalteen authored Aug 29, 2024
2 parents b928926 + 602b9f7 commit b573c08
Show file tree
Hide file tree
Showing 31 changed files with 645 additions and 202 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ extends:
- plugin:prettier/recommended

rules:
'@typescript-eslint/no-explicit-any': off
camelcase: off
eslint-comments/no-use: off
eslint-comments/no-unused-disable: off
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Thumbs.db

# Extra
tmp/
.env
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ node_modules/
*.scss
dist/
coverage/
__fixtures__/
__fixtures__/**/*.md
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

Convert issue form responses to JSON

> [!IMPORTANT]
>
> As of version `v2.0.0`, this action has been converted to ESM.
## About

This action is designed to be used in conjunction with
Expand Down
6 changes: 5 additions & 1 deletion __fixtures__/blank/parsed-template.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"the_name_of_the_thing": { "type": "input", "required": true }
"name": {
"label": "The Name of the Thing",
"type": "input",
"required": true
}
}
28 changes: 14 additions & 14 deletions __fixtures__/example/parsed-issue.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"the_name_of_the_thing": "this-thing",
"the_nickname_of_the_thing": "thing",
"the_color_of_the_thing": ["blue"],
"the_shape_of_the_thing": ["square"],
"the_sounds_of_the_thing": ["re", "mi"],
"the_topics_about_the_thing": [],
"the_description_of_the_thing": "This is a description.\n\nIt has multiple lines.\n\nIt's pretty cool!",
"the_notes_about_the_thing": "- Note\n- Another note\n- Lots of notes",
"the_code_of_the_thing": "const thing = new Thing()\nthing.doThing()",
"the_string_method_of_the_code_of_the_thing": "thing.toString()",
"is_the_thing_a_thing": {
"name": "this-thing",
"nickname": "thing",
"color": ["blue"],
"shape": ["square"],
"sounds": ["re", "mi"],
"topics": [],
"description": "This is a description.\n\nIt has multiple lines.\n\nIt's pretty cool!",
"notes": "- Note\n- Another note\n- Lots of notes",
"code": "const thing = new Thing()\nthing.doThing()",
"code-string": "thing.toString()",
"is-thing": {
"selected": ["Yes"],
"unselected": ["No"]
},
"is_the_thing_useful": {
"is-thing-useful": {
"selected": ["Sometimes"],
"unselected": ["Yes", "No"]
},
"read_team": "IssueOps-Demo-Readers",
"write_team": "IssueOps-Demo-Writers"
"read-team": "IssueOps-Demo-Readers",
"write-team": "IssueOps-Demo-Writers"
}
55 changes: 41 additions & 14 deletions __fixtures__/example/parsed-template.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{
"the_name_of_the_thing": { "type": "input", "required": true },
"the_nickname_of_the_thing": { "type": "input", "required": false },
"the_color_of_the_thing": {
"name": {
"label": "The Name of the Thing",
"type": "input",
"required": true
},
"nickname": {
"label": "The Nickname of the Thing",
"type": "input",
"required": false
},
"color": {
"label": "The Color of the Thing",
"type": "dropdown",
"required": true,
"multiple": false,
Expand All @@ -16,40 +25,58 @@
"yellow"
]
},
"the_shape_of_the_thing": {
"shape": {
"label": "The Shape of the Thing",
"type": "dropdown",
"required": false,
"multiple": false,
"options": ["circle", "square", "triangle"]
},
"the_sounds_of_the_thing": {
"sounds": {
"label": "The Sounds of the Thing",
"type": "dropdown",
"required": true,
"multiple": true,
"options": ["do", "re", "mi", "fa", "so", "la", "ti"]
},
"the_topics_about_the_thing": {
"topics": {
"label": "The Topics About the Thing",
"type": "dropdown",
"required": false,
"multiple": true,
"options": ["cool", "fun", "interesting", "neat"]
},
"the_description_of_the_thing": { "type": "textarea", "required": true },
"the_notes_about_the_thing": { "type": "textarea", "required": false },
"the_code_of_the_thing": { "type": "textarea", "required": true },
"the_string_method_of_the_code_of_the_thing": {
"description": {
"label": "The Description of the Thing",
"type": "textarea",
"required": true
},
"notes": {
"label": "The Notes About the Thing",
"type": "textarea",
"required": false
},
"code": {
"label": "The Code of the Thing",
"type": "textarea",
"required": true
},
"code-string": {
"label": "The String Method of the Code of the Thing",
"type": "textarea",
"required": false
},
"is_the_thing_a_thing": {
"is-thing": {
"label": "Is the Thing a Thing?",
"type": "checkboxes",
"required": false,
"options": [
{ "label": "Yes", "required": true },
{ "label": "No", "required": false }
]
},
"is_the_thing_useful": {
"is-thing-useful": {
"label": "Is the Thing Useful?",
"type": "checkboxes",
"required": false,
"options": [
Expand All @@ -58,6 +85,6 @@
{ "label": "No", "required": false }
]
},
"read_team": { "type": "input", "required": true },
"write_team": { "type": "input", "required": true }
"read-team": { "label": "Read Team", "type": "input", "required": true },
"write-team": { "label": "Write Team", "type": "input", "required": true }
}
4 changes: 2 additions & 2 deletions __fixtures__/extra/parsed-issue.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"model_description": "who's molecule is this? (we don't know)",
"ersilia_id": [],
"description": "who's molecule is this? (we don't know)",
"id": [],
"code": []
}
15 changes: 11 additions & 4 deletions __fixtures__/extra/parsed-template.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
{
"model_name": { "type": "input", "required": true },
"model_description": { "type": "input", "required": false },
"ersilia_id": {
"name": { "label": "Model Name", "type": "input", "required": true },
"description": {
"label": "Model Description",
"type": "input",
"required": false
},
"id": {
"label": "Ersilia ID",
"type": "dropdown",
"required": true,
"multiple": false,
"options": ["abc123", "def456"]
},
"publication": {
"label": "Publication",
"type": "textarea",
"required": false
},
"code": {
"label": "Code",
"type": "dropdown",
"required": true,
"multiple": false,
"options": ["123abc", "456def"]
},
"license": { "type": "input", "required": true }
"license": { "label": "License", "type": "input", "required": true }
}
6 changes: 5 additions & 1 deletion __fixtures__/header/parsed-template.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"the_name_of_the_thing": { "type": "input", "required": true }
"name": {
"label": "The Name of the Thing",
"type": "input",
"required": true
}
}
8 changes: 6 additions & 2 deletions __fixtures__/invalid/parsed-template.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"this_isnt_a_good_issue": { "type": "input", "required": true },
"empty_header": { "type": "input", "required": false }
"bad": {
"label": "This isn't a good issue",
"type": "input",
"required": true
},
"empty": { "label": "Empty header", "type": "input", "required": false }
}
4 changes: 2 additions & 2 deletions __fixtures__/missing/parsed-issue.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"model_description": "who's molecule is this? (we don't know)",
"ersilia_id": [],
"description": "who's molecule is this? (we don't know)",
"id": [],
"publication": "The following link is just an example:\n\n`www.example.com`",
"code": []
}
15 changes: 11 additions & 4 deletions __fixtures__/missing/parsed-template.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
{
"model_name": { "type": "input", "required": true },
"model_description": { "type": "input", "required": false },
"ersilia_id": {
"name": { "label": "Model Name", "type": "input", "required": true },
"description": {
"label": "Model Description",
"type": "input",
"required": false
},
"id": {
"label": "Ersilia ID",
"type": "dropdown",
"required": true,
"multiple": false,
"options": ["abc123", "def456"]
},
"publication": {
"label": "Publication",
"type": "textarea",
"required": false
},
"code": {
"label": "Code",
"type": "dropdown",
"required": true,
"multiple": false,
"options": ["123abc", "456def"]
},
"license": { "type": "input", "required": true }
"license": { "label": "License", "type": "input", "required": true }
}
65 changes: 65 additions & 0 deletions __fixtures__/no-ids/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
### The Name of the Thing

this-thing

### The Nickname of the Thing

thing

### The Color of the Thing

blue

### The Shape of the Thing

square

### The Sounds of the Thing

re, mi

### The Topics About the Thing

_No response_

### The Description of the Thing

This is a description.

It has multiple lines.

It's pretty cool!

### The Notes About the Thing

- Note
- Another note
- Lots of notes

### The Code of the Thing

const thing = new Thing()
thing.doThing()

### The String Method of the Code of the Thing

thing.toString()

### Is the Thing a Thing?

- [x] Yes
- [ ] No

### Is the Thing Useful?

- [ ] Yes
- [x] Sometimes
- [ ] No

### Read Team

IssueOps-Demo-Readers

### Write Team

IssueOps-Demo-Writers
22 changes: 22 additions & 0 deletions __fixtures__/no-ids/parsed-issue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"the_name_of_the_thing": "this-thing",
"the_nickname_of_the_thing": "thing",
"the_color_of_the_thing": ["blue"],
"the_shape_of_the_thing": ["square"],
"the_sounds_of_the_thing": ["re", "mi"],
"the_topics_about_the_thing": [],
"the_description_of_the_thing": "This is a description.\n\nIt has multiple lines.\n\nIt's pretty cool!",
"the_notes_about_the_thing": "- Note\n- Another note\n- Lots of notes",
"the_code_of_the_thing": "const thing = new Thing()\nthing.doThing()",
"the_string_method_of_the_code_of_the_thing": "thing.toString()",
"is_the_thing_a_thing": {
"selected": ["Yes"],
"unselected": ["No"]
},
"is_the_thing_useful": {
"selected": ["Sometimes"],
"unselected": ["Yes", "No"]
},
"read_team": "IssueOps-Demo-Readers",
"write_team": "IssueOps-Demo-Writers"
}
Loading

0 comments on commit b573c08

Please sign in to comment.