Skip to content

Commit

Permalink
Add available seats in About CISO Assistant modal
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Oct 4, 2024
1 parent c078273 commit c0b3b8b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions enterprise/backend/enterprise_core/views.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import mimetypes
import magic

import structlog
from core.views import BaseModelViewSet
from django.http import HttpResponse
from rest_framework import status
from rest_framework.permissions import AllowAny
from rest_framework.decorators import (
Expand All @@ -16,6 +13,9 @@

from django.conf import settings

from core.views import BaseModelViewSet
from iam.models import User

from .models import ClientSettings
from .serializers import ClientSettingsReadSerializer

Expand Down Expand Up @@ -145,6 +145,7 @@ def get_build(request):
"version": VERSION,
"build": BUILD,
"license_seats": LICENSE_SEATS,
"available_seats": LICENSE_SEATS - len(User.get_editors()),
"license_expiration": LICENSE_EXPIRATION,
}
)
3 changes: 2 additions & 1 deletion frontend/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -751,5 +751,6 @@
"ShowAllNodesMessage": "Show all",
"ShowOnlyAssessable": "Only assessable",
"NoPreviewMessage": "No preview available.",
"errorLicenseSeatsExceeded": "The number of license seats is exceeded, you will not be able to grant editing rights to this user. Please contact your administrator."
"errorLicenseSeatsExceeded": "The number of license seats is exceeded, you will not be able to grant editing rights to this user. Please contact your administrator.",
"availableSeats": "Available seats"
}
3 changes: 2 additions & 1 deletion frontend/src/lib/components/Modals/DisplayJSONModal.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { safeTranslate } from '$lib/utils/i18n';
// Props
/** Exposes parent props to this component. */
// export let parent: any;
Expand All @@ -24,7 +25,7 @@
<div data-testid="key-value">
{#each Object.entries(JSON.parse(body)) as [key, value]}
<div>
<div data-testid="{key}-key" class="font-bold capitalize">{key}:</div>
<div data-testid="{key}-key" class="font-bold">{safeTranslate(key)}:</div>
<div data-testid="{key}-value">{value}</div>
</div>
{/each}
Expand Down

0 comments on commit c0b3b8b

Please sign in to comment.