Skip to content

Commit 6e2428d

Browse files
committed
Making copy and paste possible again. Shared consent card. Link to
metrics from User
1 parent 45b2418 commit 6e2428d

22 files changed

Lines changed: 308 additions & 678 deletions

File tree

apps/api-manager/src/lib/components/ConsentCard.svelte

Lines changed: 0 additions & 265 deletions
This file was deleted.

apps/api-manager/src/lib/components/metrics/AggregateMetricsQueryForm.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@
167167
font-size: 0.8rem;
168168
font-weight: 500;
169169
white-space: nowrap;
170-
user-select: none;
171170
}
172171
173172
:global([data-mode="dark"]) .qf-inline span {

apps/api-manager/src/lib/components/metrics/MetricsQueryForm.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@
221221
font-size: 0.8rem;
222222
font-weight: 500;
223223
white-space: nowrap;
224-
user-select: none;
225224
}
226225
227226
:global([data-mode="dark"]) .qf-inline span {

apps/api-manager/src/routes/(protected)/metrics/+page.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,6 @@
10871087
font-size: 0.8rem;
10881088
font-weight: 500;
10891089
white-space: nowrap;
1090-
user-select: none;
10911090
}
10921091
10931092
:global([data-mode="dark"]) .hf span {

apps/api-manager/src/routes/(protected)/user/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { Accordion } from "@skeletonlabs/skeleton-svelte";
33
import { type SessionData } from "svelte-kit-sessions";
4-
import ConsentCard from "$lib/components/ConsentCard.svelte";
4+
import { ConsentCard } from "@obp/shared/components";
55
import { toast } from "$lib/utils/toastService.js";
66
import { Clock } from "@lucide/svelte";
77
import { userPreferences, DATE_FORMAT_OPTIONS, THEME_OPTIONS, type DateFormat, type Theme } from "$lib/stores/userPreferences.svelte";

apps/api-manager/src/routes/(protected)/user/consents/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import ConsentCard from "$lib/components/ConsentCard.svelte";
2+
import { ConsentCard } from "@obp/shared/components";
33
44
let { data } = $props();
55

apps/api-manager/src/routes/(protected)/users/[user_id]/+page.svelte

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
let hasApiAccess = $derived(data.hasApiAccess);
1212
let pageError = $derived(data.error);
1313
14+
// from_date for the "View API Metrics" link: one week ago, in the
15+
// datetime-local format (yyyy-MM-ddTHH:mm) the metrics query form expects.
16+
const metricsFromDate = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000)
17+
.toISOString()
18+
.slice(0, 16);
19+
1420
$effect(() => {
1521
if (user) {
1622
const entitlements = user.entitlements?.length || 0;
@@ -71,7 +77,20 @@
7177
<div class="info-grid">
7278
<div class="info-item">
7379
<div class="info-label">User ID</div>
74-
<div class="info-value font-mono">{user.user_id || "N/A"}</div>
80+
<div class="info-value">
81+
<span class="font-mono">{user.user_id || "N/A"}</span>
82+
{#if user.user_id}
83+
<a
84+
href="/metrics?user_id={encodeURIComponent(
85+
user.user_id,
86+
)}&from_date={encodeURIComponent(metricsFromDate)}"
87+
class="action-link"
88+
data-testid="user-metrics-link"
89+
>
90+
View API Metrics
91+
</a>
92+
{/if}
93+
</div>
7594
</div>
7695
<div class="info-item">
7796
<div class="info-label">Email</div>

apps/api-manager/src/routes/site-map/+page.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,15 @@
357357
.search-box input {
358358
flex: 1;
359359
border: none;
360-
outline: none;
361360
background: transparent;
362361
font-size: 0.875rem;
363362
color: #111827;
364363
}
365364
365+
.search-box:focus-within {
366+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
367+
}
368+
366369
:global([data-mode="dark"]) .search-box input {
367370
color: var(--color-surface-100);
368371
}

0 commit comments

Comments
 (0)