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

Improve Request list #673

Merged
merged 6 commits into from
Sep 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
squash requet table
  • Loading branch information
a-belhadj committed Sep 19, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit fdbbf281334969c68f541e433eda5175a9086c31
9 changes: 3 additions & 6 deletions service_catalog/tables/request_tables.py
Original file line number Diff line number Diff line change
@@ -21,20 +21,17 @@ class Meta:
model = Request
attrs = {"id": "request_table", "class": "table squest-pagination-tables"}
fields = ("selection", "id", "user__username", "instance__quota_scope__name",
"instance__service", "operation", "operation__type", "state", "instance", "date_submitted",
"instance__service", "operation", "state", "instance", "date_submitted",
"last_updated")

def render_operation__type(self, value, record):
def render_operation(self, value, record):
from service_catalog.views import map_operation_type
return format_html(
f'<strong class="text-{map_operation_type(record.operation.type)}">{record.operation.type}</strong>')
f'<strong class="text-{map_operation_type(record.operation.type)}">{value.name}</strong>')

def render_id(self, value, record):
return format_html(f'<a title={value} href="{record.get_absolute_url()}">{record}</a>')

def render_operation(self, value, record):
return value.name

def render_state(self, record, value):
from service_catalog.views import map_request_state
if record.approval_workflow_state is not None and record.approval_workflow_state.current_step is not None: