Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep: create a new html file "add_wechat" that will be used by integrations page #1

Open
4 tasks done
wanggxa opened this issue Apr 25, 2024 · 2 comments
Open
4 tasks done
Labels
sweep Sweep your software chores

Comments

@wanggxa
Copy link
Owner

wanggxa commented Apr 25, 2024

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
  • Create templates/integrations/add_wechat.htmlEdit
  • Modify templates/front/channels.html ! No changes made Edit
  • Modify hc/front/views.py ! No changes made Edit
  • Modify hc/front/urls.py ! No changes made Edit
@sweep-ai sweep-ai bot added the sweep Sweep your software chores label Apr 25, 2024
Copy link

sweep-ai bot commented Apr 25, 2024

Sweeping

50%


Actions (click)

  • ↻ Restart Sweep

❌ Unable to Complete PR

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 %}


WeChat



Get notifications in WeChat when a check goes down.




Integration Settings




{% csrf_token %}

WeChat ID

<input
id="url"
type="text"
class="form-control"
name="url"
placeholder="Enter your WeChat ID">




Save Integration





{% 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" />

    WeChat


    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:

    @login_required
    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"),

    🎉 Latest improvements to Sweep:
    • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
    • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
    • Use the GitHub issues extension for creating Sweep issues directly from your editor.

    💡 To recreate the pull request edit the issue title or description.

    This is an automated message generated by Sweep AI.

    Copy link

    sweep-ai bot commented Apr 25, 2024

    Sweeping

    50%


    Actions (click)

    • ↻ Restart Sweep

    ❌ Unable to Complete PR

    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
  • element
    - Include an for a WeChat icon. Add the icon file to /static/img/integrations/ and reference it here.
    - Add an

    heading with text "WeChat"
    - Add a

    with a brief description of the WeChat integration
    - Add an link with class "btn btn-primary" and text "Add Integration"
    - Set the href to "{% url 'hc-add-wechat' project.code %}" to link it to the new view

  • hc/front/views.py Modify hc/front/views.py with contents:
    Add a new view function to render the add_wechat.html template:

    @login_required
    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"),

    🎉 Latest improvements to Sweep:
    • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
    • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
    • Use the GitHub issues extension for creating Sweep issues directly from your editor.

    💡 To recreate the pull request edit the issue title or description.

    @wanggxa wanggxa changed the title Sweep: create a new html file "add_wechat" that will be used by integrations page Sweep: create a new html file "add_wechat" that will be used by integrations page Apr 25, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    sweep Sweep your software chores
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant