Skip to content

Commit

Permalink
Merge pull request #1088 from GSA/1086-user-story-template
Browse files Browse the repository at this point in the history
1086 user story template
  • Loading branch information
ccostino authored Jan 11, 2024
2 parents 2c1c87b + dd02ae5 commit e7cafb0
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
76 changes: 76 additions & 0 deletions .github/ISSUE_TEMPLATE/issue_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: "User Story Template"
description: "Use this template for creating user stories"
title: "User Story: [Brief description of the user story]"

labels:
- "Type: User Story"

body:
- type: markdown
attributes:
value: '**User Story:**'
- type: textarea
id: userType
attributes:
label: "As a [type of user],"
description: "Describe the type of user involved in this story."
validations:
required: true
- type: textarea
id: actionFeature
attributes:
label: "I want [an action or feature],"
description: "Describe the desired action or feature from the user's perspective."
validations:
required: true
- type: textarea
id: benefitValue
attributes:
label: "So that [benefit or value]."
description: "Describe the benefit or value the user expects from the action or feature."
validations:
required: true

- type: markdown
attributes:
value: '**Acceptance Criteria:**'
- type: textarea
id: acceptanceCriteria
attributes:
label: "Detailed condition or criteria that must be met for the user story to be considered complete."
description: "List the acceptance criteria for the user story."
validations:
required: true

- type: markdown
attributes:
value: '**Tasks:**'
- type: textarea
id: tasks
attributes:
label: "List of specific tasks or sub-tasks that need to be done to implement the user story."
description: "Outline the tasks necessary to implement the user story."
validations:
required: true

- type: markdown
attributes:
value: '**Dependencies:**'
- type: textarea
id: dependencies
attributes:
label: "List any dependencies that need to be resolved before starting or completing this user story."
description: "Specify any dependencies related to the user story."
validations:
required: false

- type: markdown
attributes:
value: '**Notes:**'
- type: textarea
id: notes
attributes:
label: "Any additional information or context that might be useful for the team."
description: "Provide any extra notes or context for the user story."
validations:
required: false
2 changes: 1 addition & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def add_template_filters(application):
format_mobile_network,
format_yes_no,
square_metres_to_square_miles,
convert_markdown_template
convert_markdown_template,
]:
application.add_template_filter(fn)

Expand Down
11 changes: 4 additions & 7 deletions app/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,28 @@


def apply_html_class(tags, html_file):

new_html = html_file

for tag in tags:

element = tag[0]
class_name = tag[1]

soup = BeautifulSoup(new_html, 'html.parser')
soup = BeautifulSoup(new_html, "html.parser")

for xtag in soup.find_all(element):
xtag['class'] = class_name
xtag["class"] = class_name

new_html = str(soup)

return new_html


def convert_markdown_template(mdf, test=False):

content_text = ""

if not test:
APP_ROOT = get_root_path('notifications-admin')
file = 'app/content/' + mdf + '.md'
APP_ROOT = get_root_path("notifications-admin")
file = "app/content/" + mdf + ".md"
md_file = os.path.join(APP_ROOT, file)
with open(md_file) as f:
content_text = f.read()
Expand Down
16 changes: 10 additions & 6 deletions app/main/views/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,20 @@ def get_started_old():
@main.route("/using-notify/get-started")
@user_is_logged_in
def get_started():
markdown = convert_markdown_template('get-started')
html_style = apply_html_class([['ol', 'usa-process-list'],
['li', 'usa-process-list__item padding-bottom-4 margin-top-2'],
['h2', 'usa-process-list__heading line-height-sans-3']],
markdown)
markdown = convert_markdown_template("get-started")
html_style = apply_html_class(
[
["ol", "usa-process-list"],
["li", "usa-process-list__item padding-bottom-4 margin-top-2"],
["h2", "usa-process-list__heading line-height-sans-3"],
],
markdown,
)

return render_template(
"views/get-started.html",
navigation_links=using_notify_nav(),
content=html_style
content=html_style,
)


Expand Down
13 changes: 10 additions & 3 deletions tests/app/main/test_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,23 @@ def test_format_delta():
def test_jinja_format(fake_jinja_template):
app = Flask("app")
with app.app_context():
assert convert_markdown_template(fake_jinja_template, test=True) == "<p>True</p>"
assert (
convert_markdown_template(fake_jinja_template, test=True) == "<p>True</p>"
)


@pytest.mark.usefixtures("fake_markdown_file")
def test_markdown_format(fake_markdown_file):
app = Flask("app")
with app.app_context():
assert convert_markdown_template(fake_markdown_file, test=True) == "<h1>Test</h1>"
assert (
convert_markdown_template(fake_markdown_file, test=True) == "<h1>Test</h1>"
)


@pytest.mark.usefixtures("fake_soup_template")
def test_soup_format(fake_soup_template):
assert apply_html_class([['h1', 'testClass']], fake_soup_template) == '<h1 class="testClass">Test</h1>'
assert (
apply_html_class([["h1", "testClass"]], fake_soup_template)
== '<h1 class="testClass">Test</h1>'
)

0 comments on commit e7cafb0

Please sign in to comment.