-
Notifications
You must be signed in to change notification settings - Fork 0
Add HTMX co-owner invitation management endpoints #100
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
Open
beriman
wants to merge
1
commit into
main
Choose a base branch
from
codex/add-cancel_co_owner_invite-method-and-endpoints
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+255
−42
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
src/app/web/templates/components/brand/team_pending_column.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| <div | ||
| id="brand-team-pending" | ||
| class="team-column" | ||
| hx-target="this" | ||
| hx-swap="outerHTML" | ||
| > | ||
| <h3>Menunggu Persetujuan</h3> | ||
| <p | ||
| class="team-feedback{% if feedback_type %} team-feedback--{{ feedback_type }}{% endif %}" | ||
| aria-live="polite" | ||
| role="status" | ||
| > | ||
| {% if feedback_message %}{{ feedback_message }}{% endif %} | ||
| </p> | ||
| {% if pending_members %} | ||
| <ul class="team-list"> | ||
| {% for member in pending_members %} | ||
| <li class="team-card glass-panel team-card--pending"> | ||
| {% if member.avatar_url %} | ||
| <img src="{{ member.avatar_url }}" alt="{{ member.full_name }}" loading="lazy" /> | ||
| {% endif %} | ||
| <div> | ||
| <p class="team-name">{{ member.full_name }}</p> | ||
| <p class="team-role">{{ member.role|replace('-', ' ')|title }}</p> | ||
| <p class="team-expertise">{{ member.expertise or 'Menunggu konfirmasi peran' }}</p> | ||
| {% if member.invited_by %} | ||
| <p class="team-invited">Diundang oleh {{ member.invited_by }}</p> | ||
| {% endif %} | ||
| </div> | ||
| <div class="team-actions"> | ||
| <form | ||
| method="post" | ||
| hx-post="{{ request.url_for('approve_brand_co_owner', slug=brand.slug, profile_id=member.profile_id) }}" | ||
| hx-target="#brand-team-pending" | ||
| hx-swap="outerHTML" | ||
| > | ||
| <button type="submit" class="button button-small">Setujui</button> | ||
| </form> | ||
| <form | ||
| method="post" | ||
| hx-delete="{{ request.url_for('cancel_brand_co_owner', slug=brand.slug, profile_id=member.profile_id) }}" | ||
| hx-target="#brand-team-pending" | ||
| hx-swap="outerHTML" | ||
| > | ||
| <button type="submit" class="button button-ghost button-small">Batalkan</button> | ||
| </form> | ||
| </div> | ||
| </li> | ||
| {% endfor %} | ||
| </ul> | ||
| {% else %} | ||
| <p class="empty-state">Belum ada undangan co-owner yang menunggu persetujuan.</p> | ||
| {% endif %} | ||
| <form | ||
| class="invite-form glass-panel" | ||
| aria-label="Form undang co-owner" | ||
| method="post" | ||
| hx-post="{{ request.url_for('invite_brand_co_owner', slug=brand.slug) }}" | ||
| hx-target="#brand-team-pending" | ||
| hx-swap="outerHTML" | ||
| > | ||
| <h4>Undang Co-owner</h4> | ||
| <p>Masukkan username komunitas untuk meminta persetujuan mereka sebagai co-owner.</p> | ||
| <label> | ||
| <span>Username</span> | ||
| <input | ||
| type="text" | ||
| name="username" | ||
| placeholder="contoh: chandra-pratama" | ||
| value="{{ form_state.username }}" | ||
| required | ||
| /> | ||
| </label> | ||
| <label> | ||
| <span>Catatan</span> | ||
| <textarea | ||
| name="note" | ||
| rows="3" | ||
| placeholder="Jelaskan peran atau kontribusi yang diharapkan" | ||
| >{{ form_state.note }}</textarea> | ||
| </label> | ||
| <button type="submit" class="button button-secondary">Kirim Undangan</button> | ||
| </form> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The helper used by the invite/approve/cancel endpoints calls
brand_service.get_team_partial_context(brand_slug)without guarding againstBrandNotFound. Those routes catchBrandErrorand try to render this partial even when the slug is invalid, so a POST like/brands/unknown/co-ownersresults in an uncaughtBrandNotFoundand a 500 response instead of a 404 or a friendly error partial. Please return a proper error when the brand is missing before attempting to re-render the partial.Useful? React with 👍 / 👎.