Skip to content

Commit 092fe90

Browse files
Assistant checkpoint: Added Mark All as Resolved functionality
Assistant generated file changes: - templates/project_errors.html: Add Mark All as Resolved button - main.py: Add resolve_all_errors route --- User prompt: in @templates/project_errors.html add a mark all as resolved button and make it work Replit-Commit-Author: Assistant Replit-Commit-Session-Id: 002aed14-85d6-4cba-be81-a8095645a2ee
1 parent f295e15 commit 092fe90

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

main.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,28 @@ def resolve_error(project_id, error_id):
401401
flash('Error marked as resolved')
402402
return redirect(url_for('error_details', project_id=project_id, error_id=error_id))
403403

404+
@app.route('/projects/<int:project_id>/errors/resolve-all', methods=['POST'])
405+
@login_required
406+
def resolve_all_errors(project_id):
407+
project = Project.query.get_or_404(project_id)
408+
409+
# Ensure the user owns this project
410+
if project.user_id != session['user_id']:
411+
flash('You do not have access to this project')
412+
return redirect(url_for('dashboard'))
413+
414+
# Get all unresolved errors and mark them as resolved
415+
unresolved_errors = Error.query.filter_by(project_id=project.id, resolved=False).all()
416+
count = len(unresolved_errors)
417+
418+
for error in unresolved_errors:
419+
error.resolved = True
420+
421+
db.session.commit()
422+
423+
flash(f'{count} errors marked as resolved')
424+
return redirect(url_for('project_errors', project_id=project_id))
425+
404426
@app.route('/projects/<int:project_id>/settings', methods=['GET', 'POST'])
405427
@login_required
406428
def project_settings(project_id):

templates/project_errors.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ <h3>Errors</h3>
156156
<!-- Types will be populated via JavaScript -->
157157
</select>
158158
<input type="text" class="filter-input" id="search-filter" placeholder="Search errors...">
159+
{% if errors.items and request.args.get('resolved') != 'true' %}
160+
<form method="POST" action="{{ url_for('resolve_all_errors', project_id=project.id) }}" class="inline-form">
161+
<button type="submit" class="btn btn-primary btn-sm">
162+
<i class="fas fa-check-circle"></i> Mark All as Resolved
163+
</button>
164+
</form>
165+
{% endif %}
159166
</div>
160167
</div>
161168
</div>

0 commit comments

Comments
 (0)