Open wanggxa opened 4 months ago
I'm sorry, but it looks like an error has occurred due to a planning failure. Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://discord.gg/sweep.
For bonus GPT-4 tickets, please report this bug on Discord (tracking ID: 38cdf37a2b
).
Please look at the generated plan. If something looks wrong, please add more details to your issue.
File Path | Proposed Changes |
---|---|
templates/integrations/add_wechat.html |
Create templates/integrations/add_wechat.html with contents: {% extends "base.html" %} {% load humanize static hc_extras %} {% block title %}WeChat Integration - {{ site_name }}{% endblock %} {% block content %} Get notifications in WeChat when a check goes down.
{% endblock %} |
templates/front/channels.html |
Modify templates/front/channels.html with contents: In the "Add More" integrations list, add a new list item for WeChat: <img src="{% static 'img/integrations/wechat.png' %}" class="icon" alt="WeChat icon" /> Get notifications in WeChat when a check goes down. Add Integration |
hc/front/views.py |
Modify hc/front/views.py with contents: At the end of the file, add a new view function for the WeChat integration page:br/><br/>@login_required<br/def add_wechat(request: AuthenticatedHttpRequest, code: UUID) -> HttpResponse: project = _get_rw_project_for_user(request, code) if request.method == "POST": form = forms.AddUrlForm(request.POST) if form.is_valid(): channel = Channel(project=project, kind="wechat") channel.value = form.cleaned_data["value"] channel.save() channel.assign_all_checks() return redirect("hc-channels", project.code) else: form = forms.AddUrlForm() ctx = {"page": "channels", "project": project, "form": form} return render(request, "integrations/add_wechat.html", ctx) |
hc/front/urls.py |
Modify hc/front/urls.py with contents: In the project_urls list, add a new URL route for the WeChat integration page: path("add_wechat/", views.add_wechat, name="hc-add-wechat"), |
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
I'm sorry, but it looks like an error has occurred due to a planning failure. Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://discord.gg/sweep.
For bonus GPT-4 tickets, please report this bug on Discord (tracking ID: e5b9fb20be
).
Please look at the generated plan. If something looks wrong, please add more details to your issue.
File Path | Proposed Changes |
---|---|
templates/integrations/add_wechat.html |
Create templates/integrations/add_wechat.html with contents: Create a new file templates/integrations/add_wechat.html. Use templates/integrations/add_apprise.html as a reference: - Copy the overall HTML structure - Update the page heading to "WeChat" - Update the integration icon to an appropriate WeChat icon - Update the description text to provide an overview of the WeChat integration - Update the integration instructions to be specific to setting up WeChat - Ensure the form's action attribute submits to the correct URL |
templates/front/channels.html |
Modify templates/front/channels.html with contents: In the "Add More" section, add a new list item for WeChat: - Add a new - Include an for a WeChat icon. Add the icon file to /static/img/integrations/ and reference it here. - Add an heading with text "WeChat" |
hc/front/views.py |
Modify hc/front/views.py with contents: Add a new view function to render the add_wechat.html template:br/><br/>@login_required<br/def add_wechat(request, code): project = _get_rw_project_for_user(request, code) ctx = {"page": "channels", "project": project} return render(request, "integrations/add_wechat.html", ctx) |
hc/front/urls.py |
Modify hc/front/urls.py with contents: In the project_urls list, add a new path to map the hc-add-wechat URL to the new add_wechat view: path("add_wechat/", views.add_wechat, name="hc-add-wechat"), |
💡 To recreate the pull request edit the issue title or description.
We have an integration page to guide user how to integrate 3rd party applications, and we’d like to add a new html file "add_wechat.html" to guide user how to integrate "WeChat". Use the file add_apprise.html as a reference. Remember to update related Django views and urls to show the content of add_wechat.html when "Add Integrations" link is clicked.
Checklist
- [X] Create `templates/integrations/add_wechat.html` ✗ [Edit](https://github.com/wanggxa/healthchecks/edit/sweep/create_a_new_html_file_add_wechat_that_w_d41d1/templates/integrations/add_wechat.html) - [X] Modify `templates/front/channels.html` ! No changes made [Edit](https://github.com/wanggxa/healthchecks/edit/sweep/create_a_new_html_file_add_wechat_that_w_d41d1/templates/front/channels.html) - [X] Modify `hc/front/views.py` ! No changes made [Edit](https://github.com/wanggxa/healthchecks/edit/sweep/create_a_new_html_file_add_wechat_that_w_d41d1/hc/front/views.py) - [X] Modify `hc/front/urls.py` ! No changes made [Edit](https://github.com/wanggxa/healthchecks/edit/sweep/create_a_new_html_file_add_wechat_that_w_d41d1/hc/front/urls.py)