From 93afb90b56a19e5bc55e159cf17d5f26a21d2d73 Mon Sep 17 00:00:00 2001 From: juancarmore Date: Mon, 26 Oct 2026 14:30:35 +0100 Subject: [PATCH] openvidu-dashboard: the UI library groups its files by component and concern Components with a template or style file get a folder of their own, related small ones share one (badges, feedback, lock, search, tiles, zone); core services split into auth, http, state, refresh, preferences and ui; the login and settings pages join features and the locked page joins lock. The public API is unchanged. --- .../dashboard-ce/frontend/AGENTS.md | 10 +- .../src/lib/charts/breakdown-chart.ts | 4 +- .../src/lib/charts/chart-colors.ts | 2 +- .../src/lib/charts/charts.spec.ts | 2 +- .../time-series-chart.html | 0 .../time-series-chart.ts | 16 +- .../components/{ => badges}/badges.spec.ts | 10 +- .../lib/components/{ => badges}/kind-badge.ts | 2 +- .../lib/components/{ => badges}/live-chip.ts | 6 +- .../lib/components/{ => badges}/room-chip.ts | 4 +- .../{ => badges}/source-icon.spec.ts | 0 .../components/{ => badges}/source-icon.ts | 0 .../components/{ => badges}/status-badge.ts | 2 +- .../{ => copy-button}/copy-button.spec.ts | 2 +- .../{ => copy-button}/copy-button.ts | 4 +- .../{ => data-table}/cursor-paginator.ts | 6 +- .../{ => data-table}/data-table.html | 0 .../{ => data-table}/data-table.scss | 0 .../{ => data-table}/data-table.spec.ts | 8 +- .../components/{ => data-table}/data-table.ts | 12 +- .../date-time-range-picker.html | 0 .../date-time-range-picker.scss | 0 .../date-time-range-picker.spec.ts | 8 +- .../date-time-range-picker.ts | 12 +- .../{ => duration}/duration.spec.ts | 0 .../lib/components/{ => duration}/duration.ts | 4 +- .../{ => external-link}/external-link.ts | 0 .../components/{ => feedback}/empty-state.ts | 0 .../components/{ => feedback}/error-banner.ts | 2 +- .../components/{ => feedback}/notice.spec.ts | 2 +- .../lib/components/{ => feedback}/notice.ts | 0 .../lib/components/{ => feedback}/skeleton.ts | 0 .../{ => info-tip}/info-tip.spec.ts | 2 +- .../lib/components/{ => info-tip}/info-tip.ts | 0 .../lib/components/{ => lock}/feature-gate.ts | 2 +- .../src/lib/components/{ => lock}/features.ts | 0 .../lib/components/{ => lock}/lock.spec.ts | 18 +- .../lib/components/lock/locked-page.spec.ts | 76 ++++++ .../{pages => components/lock}/locked-page.ts | 16 +- .../components/{ => lock}/pro-lock-overlay.ts | 2 +- .../refresh-control.spec.ts | 2 +- .../{ => refresh-control}/refresh-control.ts | 6 +- .../{ => search}/global-search.spec.ts | 2 +- .../components/{ => search}/global-search.ts | 10 +- .../{ => search}/list-search.spec.ts | 2 +- .../components/{ => search}/list-search.ts | 6 +- .../components/{ => tiles}/kpi-tile.spec.ts | 4 +- .../lib/components/{ => tiles}/kpi-tile.ts | 4 +- .../components/{ => tiles}/section-card.ts | 6 +- .../components/{ => tiles}/tile-row.spec.ts | 0 .../lib/components/{ => tiles}/tile-row.ts | 0 .../components/{ => zone}/zone-chip.spec.ts | 8 +- .../lib/components/{ => zone}/zone-chip.ts | 4 +- .../lib/components/{ => zone}/zone-select.ts | 2 +- .../src/lib/core/{ => auth}/auth.spec.ts | 4 +- .../src/lib/core/{ => auth}/auth.ts | 2 +- .../src/lib/core/{ => http}/api-error.ts | 0 .../src/lib/core/{ => http}/connectivity.ts | 0 .../src/lib/core/{ => http}/http.spec.ts | 0 .../src/lib/core/{ => http}/http.ts | 0 .../dashboard-ui/src/lib/core/info.spec.ts | 2 +- .../dashboard-ui/src/lib/core/info.ts | 6 +- .../{ => preferences}/preferences.spec.ts | 0 .../lib/core/{ => preferences}/preferences.ts | 2 +- .../src/lib/core/{ => preferences}/storage.ts | 0 .../lib/core/{ => preferences}/theme.spec.ts | 2 +- .../src/lib/core/{ => preferences}/theme.ts | 0 .../dashboard-ui/src/lib/core/providers.ts | 6 +- .../src/lib/core/{ => refresh}/list-loader.ts | 0 .../lib/core/{ => refresh}/live-counters.ts | 0 .../lib/core/{ => refresh}/refresh.spec.ts | 2 +- .../src/lib/core/{ => refresh}/refresh.ts | 2 +- .../core/{ => refresh}/server-status.spec.ts | 6 +- .../lib/core/{ => refresh}/server-status.ts | 4 +- .../src/lib/core/{ => refresh}/ticker.ts | 0 .../lib/core/{ => state}/entity-preview.ts | 0 .../src/lib/core/{ => state}/list-state.ts | 2 +- .../lib/core/{ => state}/query-state.spec.ts | 2 +- .../src/lib/core/{ => state}/query-state.ts | 4 +- .../src/lib/core/{ => state}/ranked-sort.ts | 2 +- .../core/{ => state}/relative-time.spec.ts | 0 .../src/lib/core/{ => state}/relative-time.ts | 0 .../src/lib/core/{ => state}/route-state.ts | 0 .../src/lib/core/{ => state}/section-state.ts | 0 .../src/lib/core/{ => state}/session-zone.ts | 0 .../src/lib/core/{ => ui}/breakpoints.ts | 0 .../src/lib/core/{ => ui}/clipboard.ts | 0 .../src/lib/core/{ => ui}/focus.spec.ts | 0 .../src/lib/core/{ => ui}/focus.ts | 0 .../src/lib/core/{ => ui}/toast.spec.ts | 0 .../src/lib/core/{ => ui}/toast.ts | 0 .../lib/features/agents/agents-page.spec.ts | 2 +- .../src/lib/features/agents/agents-page.ts | 42 ++-- .../lib/features/analytics/analytics-card.ts | 10 +- .../lib/features/analytics/analytics-data.ts | 4 +- .../features/analytics/analytics-page.spec.ts | 6 +- .../lib/features/analytics/analytics-page.ts | 26 +- .../src/lib/features/egress/egress-data.ts | 4 +- .../src/lib/features/egress/egress-display.ts | 2 +- .../lib/features/egress/egress-locked-page.ts | 6 +- .../lib/features/egress/egress-page.spec.ts | 4 +- .../src/lib/features/egress/egress-page.ts | 40 ++-- .../src/lib/features/ingress/ingress-data.ts | 4 +- .../lib/features/ingress/ingress-display.ts | 2 +- .../features/ingress/ingress-locked-page.ts | 6 +- .../lib/features/ingress/ingress-page.spec.ts | 2 +- .../src/lib/features/ingress/ingress-page.ts | 36 +-- .../{pages => features/login}/login-page.html | 0 .../{pages => features/login}/login-page.scss | 0 .../src/lib/features/login/login-page.spec.ts | 191 +++++++++++++++ .../{pages => features/login}/login-page.ts | 12 +- .../lib/features/overview/overview-data.ts | 8 +- .../features/overview/overview-page.spec.ts | 6 +- .../lib/features/overview/overview-page.ts | 34 +-- .../participants/participant-display.ts | 4 +- .../participants/participant-locked-page.ts | 6 +- .../participants/participants-data.ts | 4 +- .../participants/participants-page.spec.ts | 4 +- .../participants/participants-page.ts | 40 ++-- .../src/lib/features/rooms/room-display.ts | 2 +- .../lib/features/rooms/room-locked-page.ts | 6 +- .../src/lib/features/rooms/rooms-data.ts | 6 +- .../src/lib/features/rooms/rooms-page.spec.ts | 8 +- .../src/lib/features/rooms/rooms-page.ts | 36 +-- .../settings}/about-tab.html | 0 .../settings}/about-tab.scss | 0 .../{pages => features/settings}/about-tab.ts | 14 +- .../settings}/preferences-tab.ts | 12 +- .../settings/settings-page.spec.ts} | 225 +----------------- .../settings}/settings-page.ts | 2 +- .../projects/dashboard-ui/src/lib/routes.ts | 9 +- .../src/lib/routing/breadcrumbs.spec.ts | 4 +- .../src/lib/routing/breadcrumbs.ts | 4 +- .../src/lib/routing/compose-routes.ts | 2 +- .../dashboard-ui/src/lib/shell/banner-slot.ts | 4 +- .../lib/{components => shell}/breadcrumbs.ts | 2 +- .../dashboard-shell.html | 0 .../dashboard-shell.scss | 0 .../{ => dashboard-shell}/dashboard-shell.ts | 20 +- .../src/lib/shell/{ => header}/header.html | 0 .../src/lib/shell/{ => header}/header.scss | 0 .../src/lib/shell/{ => header}/header.ts | 24 +- .../dashboard-ui/src/lib/shell/layout.ts | 2 +- .../src/lib/shell/navigation-list.ts | 2 +- .../dashboard-ui/src/lib/shell/shell.spec.ts | 12 +- .../src/lib/shell/sidenav-footer.ts | 2 +- .../src/lib/shell/theme-toggle.ts | 2 +- .../projects/dashboard-ui/src/public-api.ts | 110 ++++----- .../dashboard-ui/src/testing/analytics.ts | 2 +- 149 files changed, 712 insertions(+), 643 deletions(-) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/{ => time-series-chart}/time-series-chart.html (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/{ => time-series-chart}/time-series-chart.ts (92%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => badges}/badges.spec.ts (95%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => badges}/kind-badge.ts (94%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => badges}/live-chip.ts (94%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => badges}/room-chip.ts (90%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => badges}/source-icon.spec.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => badges}/source-icon.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => badges}/status-badge.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => copy-button}/copy-button.spec.ts (97%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => copy-button}/copy-button.ts (94%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => data-table}/cursor-paginator.ts (94%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => data-table}/data-table.html (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => data-table}/data-table.scss (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => data-table}/data-table.spec.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => data-table}/data-table.ts (95%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => date-time-range-picker}/date-time-range-picker.html (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => date-time-range-picker}/date-time-range-picker.scss (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => date-time-range-picker}/date-time-range-picker.spec.ts (96%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => date-time-range-picker}/date-time-range-picker.ts (95%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => duration}/duration.spec.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => duration}/duration.ts (95%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => external-link}/external-link.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => feedback}/empty-state.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => feedback}/error-banner.ts (95%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => feedback}/notice.spec.ts (97%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => feedback}/notice.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => feedback}/skeleton.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => info-tip}/info-tip.spec.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => info-tip}/info-tip.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => lock}/feature-gate.ts (96%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => lock}/features.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => lock}/lock.spec.ts (91%) create mode 100644 openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/locked-page.spec.ts rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/{pages => components/lock}/locked-page.ts (87%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => lock}/pro-lock-overlay.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => refresh-control}/refresh-control.spec.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => refresh-control}/refresh-control.ts (96%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => search}/global-search.spec.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => search}/global-search.ts (96%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => search}/list-search.spec.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => search}/list-search.ts (95%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => tiles}/kpi-tile.spec.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => tiles}/kpi-tile.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => tiles}/section-card.ts (95%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => tiles}/tile-row.spec.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => tiles}/tile-row.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => zone}/zone-chip.spec.ts (91%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => zone}/zone-chip.ts (95%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/{ => zone}/zone-select.ts (97%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => auth}/auth.spec.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => auth}/auth.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => http}/api-error.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => http}/connectivity.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => http}/http.spec.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => http}/http.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => preferences}/preferences.spec.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => preferences}/preferences.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => preferences}/storage.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => preferences}/theme.spec.ts (94%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => preferences}/theme.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => refresh}/list-loader.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => refresh}/live-counters.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => refresh}/refresh.spec.ts (99%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => refresh}/refresh.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => refresh}/server-status.spec.ts (97%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => refresh}/server-status.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => refresh}/ticker.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => state}/entity-preview.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => state}/list-state.ts (98%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => state}/query-state.spec.ts (99%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => state}/query-state.ts (97%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => state}/ranked-sort.ts (97%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => state}/relative-time.spec.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => state}/relative-time.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => state}/route-state.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => state}/section-state.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => state}/session-zone.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => ui}/breakpoints.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => ui}/clipboard.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => ui}/focus.spec.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => ui}/focus.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => ui}/toast.spec.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/{ => ui}/toast.ts (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/{pages => features/login}/login-page.html (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/{pages => features/login}/login-page.scss (100%) create mode 100644 openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/login/login-page.spec.ts rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/{pages => features/login}/login-page.ts (91%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/{pages => features/settings}/about-tab.html (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/{pages => features/settings}/about-tab.scss (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/{pages => features/settings}/about-tab.ts (90%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/{pages => features/settings}/preferences-tab.ts (91%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/{pages/pages.spec.ts => features/settings/settings-page.spec.ts} (60%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/{pages => features/settings}/settings-page.ts (95%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/{components => shell}/breadcrumbs.ts (96%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/{ => dashboard-shell}/dashboard-shell.html (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/{ => dashboard-shell}/dashboard-shell.scss (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/{ => dashboard-shell}/dashboard-shell.ts (73%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/{ => header}/header.html (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/{ => header}/header.scss (100%) rename openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/{ => header}/header.ts (79%) diff --git a/openvidu-dashboard/dashboard-ce/frontend/AGENTS.md b/openvidu-dashboard/dashboard-ce/frontend/AGENTS.md index 2e19522cd..10f7541fe 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/AGENTS.md +++ b/openvidu-dashboard/dashboard-ce/frontend/AGENTS.md @@ -2,9 +2,13 @@ Angular 22 standalone, zoneless and signals: OnPush is the default (do not set it), `inject()` instead of constructor injection, `@Service()` for root services, Signal Forms for forms. All UI lives in the library -`projects/dashboard-ui` (`src/lib/`: `core/` services, `shell/`, `components/` building blocks, `charts/`, `format/`, -`features//` data services, helpers and pages, `routes.ts`); its README describes composition and the -extension points. Behaviour is specified in `openspec/specs/ui-*` and the `*-ui` specs. +`projects/dashboard-ui` (`src/lib/`: `core/` services by concern (`auth/`, `http/`, `state/`, `refresh/`, +`preferences/`, `ui/`), `shell/`, `components/` building blocks, `charts/`, `format/`, `routing/`, `features//` +pages with their data services and helpers, `routes.ts`); its README describes composition and the extension points. +Behaviour is specified in `openspec/specs/ui-*` and the `*-ui` specs. + +A component with a template or style file has a folder of its own, named after it; small components that belong +together (badges, feedback, locks, search, tiles, zone) share a folder and its spec. ## Routes and pages diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/breakdown-chart.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/breakdown-chart.ts index 883aa3333..dbb074bd3 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/breakdown-chart.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/breakdown-chart.ts @@ -2,11 +2,11 @@ import { Component, computed, DOCUMENT, inject, input, signal } from '@angular/c import { MatButton } from '@angular/material/button'; import { NgxEchartsDirective } from 'ngx-echarts'; -import { ChartColorsService } from './chart-colors.js'; +import { InfoTip } from '../components/info-tip/info-tip.js'; import { formatPercent } from '../format/formatters.js'; +import { ChartColorsService } from './chart-colors.js'; import { type BreakdownEntry, breakdownOption, formatValue, type ValueFormat } from './chart-options.js'; import { bindChartOptions, injectEchartsReady, provideLazyEcharts } from './echarts-provider.js'; -import { InfoTip } from '../components/info-tip.js'; /** A donut or horizontal bar with direct labels and a fixed colour per entity; more than eight fold into "Other". */ @Component({ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/chart-colors.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/chart-colors.ts index d79214640..738671253 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/chart-colors.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/chart-colors.ts @@ -1,6 +1,6 @@ import { computed, DOCUMENT, inject, Service, type Signal } from '@angular/core'; -import { ThemeService } from '../core/theme.js'; +import { ThemeService } from '../core/preferences/theme.js'; export const CHART_SLOTS = 8; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/charts.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/charts.spec.ts index b2a9937c4..74d776749 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/charts.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/charts.spec.ts @@ -23,7 +23,7 @@ import { timeSeriesOption } from './chart-options.js'; import { bindChartOptions } from './echarts-provider.js'; -import { TimeSeriesChart } from './time-series-chart.js'; +import { TimeSeriesChart } from './time-series-chart/time-series-chart.js'; const COLORS: ChartColors = { slots: ['#0088aa', '#eb6834', '#1baf7a', '#eda100', '#e87ba4', '#2f4b7c', '#6250d6', '#e34948'], diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/time-series-chart.html b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/time-series-chart/time-series-chart.html similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/time-series-chart.html rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/time-series-chart/time-series-chart.html diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/time-series-chart.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/time-series-chart/time-series-chart.ts similarity index 92% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/time-series-chart.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/time-series-chart/time-series-chart.ts index 5ce01f665..84f59d9af 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/time-series-chart.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/charts/time-series-chart/time-series-chart.ts @@ -4,9 +4,9 @@ import { MatIcon } from '@angular/material/icon'; import type { ECharts } from 'echarts/core'; import { NgxEchartsDirective } from 'ngx-echarts'; -import { QueryStateService } from '../core/query-state.js'; -import { formatTimestamp } from '../format/formatters.js'; -import { ChartColorsService } from './chart-colors.js'; +import { QueryStateService } from '../../core/state/query-state.js'; +import { formatTimestamp } from '../../format/formatters.js'; +import { ChartColorsService } from '../chart-colors.js'; import { brushRange, CHART_GROUP, @@ -18,9 +18,9 @@ import { type SeriesKind, timeSeriesOption, type ValueFormat -} from './chart-options.js'; -import { bindChartOptions, injectEchartsReady, provideLazyEcharts } from './echarts-provider.js'; -import { InfoTip } from '../components/info-tip.js'; +} from '../chart-options.js'; +import { InfoTip } from '../../components/info-tip/info-tip.js'; +import { bindChartOptions, injectEchartsReady, provideLazyEcharts } from '../echarts-provider.js'; interface BrushEndEvent { areas?: { coordRange?: [number, number] }[]; @@ -36,7 +36,7 @@ interface BrushEndEvent { imports: [InfoTip, MatButton, MatIcon, NgxEchartsDirective], providers: [provideLazyEcharts()], templateUrl: './time-series-chart.html', - styleUrl: './chart.scss' + styleUrl: '../chart.scss' }) export class TimeSeriesChart { private readonly query = inject(QueryStateService); @@ -119,7 +119,7 @@ export class TimeSeriesChart { this.chartOptions.attach(chart); chart.group = CHART_GROUP; - const { echarts } = await import('./echarts-setup.js'); + const { echarts } = await import('../echarts-setup.js'); echarts.connect(CHART_GROUP); diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/badges.spec.ts similarity index 95% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/badges.spec.ts index 3fe3e4154..34a2241b5 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/badges.spec.ts @@ -6,11 +6,11 @@ import { MatTooltip } from '@angular/material/tooltip'; import { By } from '@angular/platform-browser'; import { beforeEach, describe, expect, it } from 'vitest'; -import { statusResponse } from '../../testing/fixtures.js'; -import { iconNames } from '../../testing/icons.js'; -import { PreferencesService } from '../core/preferences.js'; -import { RefreshRegistry, RefreshScheduler } from '../core/refresh.js'; -import { ServerStatusService } from '../core/server-status.js'; +import { statusResponse } from '../../../testing/fixtures.js'; +import { iconNames } from '../../../testing/icons.js'; +import { PreferencesService } from '../../core/preferences/preferences.js'; +import { RefreshRegistry, RefreshScheduler } from '../../core/refresh/refresh.js'; +import { ServerStatusService } from '../../core/refresh/server-status.js'; import { KindBadge } from './kind-badge.js'; import { LiveChip } from './live-chip.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/kind-badge.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/kind-badge.ts similarity index 94% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/kind-badge.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/kind-badge.ts index 01a7cc53b..bda448b7d 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/kind-badge.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/kind-badge.ts @@ -1,6 +1,6 @@ import { Component, computed, input } from '@angular/core'; -import { EGRESS_TYPE_LABELS, enumLabel, INGRESS_INPUT_LABELS, PARTICIPANT_KIND_LABELS } from '../format/labels.js'; +import { EGRESS_TYPE_LABELS, enumLabel, INGRESS_INPUT_LABELS, PARTICIPANT_KIND_LABELS } from '../../format/labels.js'; /** Labels of the three vocabularies, whose values never collide. */ const KIND_LABELS: Readonly> = { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/live-chip.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/live-chip.ts similarity index 94% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/live-chip.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/live-chip.ts index 0bdb9c792..4a14c10a4 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/live-chip.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/live-chip.ts @@ -2,9 +2,9 @@ import { booleanAttribute, Component, computed, inject, input } from '@angular/c import { MatIcon } from '@angular/material/icon'; import { MatTooltip } from '@angular/material/tooltip'; -import { RefreshRegistry } from '../core/refresh.js'; -import { ServerStatusService } from '../core/server-status.js'; -import { formatTimestamp } from '../format/formatters.js'; +import { RefreshRegistry } from '../../core/refresh/refresh.js'; +import { ServerStatusService } from '../../core/refresh/server-status.js'; +import { formatTimestamp } from '../../format/formatters.js'; /** * "LIVE" with a pulsing dot; "paused" while the page's auto-refresh is off; "stale" with a clock when the page reports diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/room-chip.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/room-chip.ts similarity index 90% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/room-chip.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/room-chip.ts index 457b2dcec..0757119a9 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/room-chip.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/room-chip.ts @@ -3,8 +3,8 @@ import { MatChip, MatChipRemove } from '@angular/material/chips'; import { MatIcon } from '@angular/material/icon'; import { RouterLink } from '@angular/router'; -import { EntityPreviewService } from '../core/entity-preview.js'; -import { QueryStateService } from '../core/query-state.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { QueryStateService } from '../../core/state/query-state.js'; /** The `room` filter of a list: "Room: " (the SID until the name is known), linked to the room, removable. */ @Component({ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/source-icon.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/source-icon.spec.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/source-icon.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/source-icon.spec.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/source-icon.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/source-icon.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/source-icon.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/source-icon.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/status-badge.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/status-badge.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/status-badge.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/status-badge.ts index 8949c548b..3d350f548 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/status-badge.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/badges/status-badge.ts @@ -2,7 +2,7 @@ import { booleanAttribute, Component, computed, inject, InjectionToken, input, t import { MatIcon } from '@angular/material/icon'; import { MatTooltip } from '@angular/material/tooltip'; -import { RECONCILER_ESTIMATE } from '../format/labels.js'; +import { RECONCILER_ESTIMATE } from '../../format/labels.js'; /** The CE status domains; an edition registers more with {@link provideStatusStyles}. */ export type StatusDomain = 'room' | 'participant' | 'egress' | 'ingress'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button/copy-button.spec.ts similarity index 97% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button/copy-button.spec.ts index df91d6da7..546d1c6b5 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button/copy-button.spec.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import { ToastService } from '../core/toast.js'; +import { ToastService } from '../../core/ui/toast.js'; import { CopyButton } from './copy-button.js'; @Component({ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button/copy-button.ts similarity index 94% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button/copy-button.ts index e6f27008d..fb4ca10b4 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/copy-button/copy-button.ts @@ -3,8 +3,8 @@ import { MatIconButton } from '@angular/material/button'; import { MatIcon } from '@angular/material/icon'; import { MatTooltip } from '@angular/material/tooltip'; -import { ClipboardService } from '../core/clipboard.js'; -import { ToastService } from '../core/toast.js'; +import { ClipboardService } from '../../core/ui/clipboard.js'; +import { ToastService } from '../../core/ui/toast.js'; export const COPIED_ICON_MS = 1_000; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/cursor-paginator.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/cursor-paginator.ts similarity index 94% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/cursor-paginator.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/cursor-paginator.ts index 66d8649f3..05a863ebf 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/cursor-paginator.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/cursor-paginator.ts @@ -5,9 +5,9 @@ import { MatIcon } from '@angular/material/icon'; import { MatOption, MatSelect } from '@angular/material/select'; import { PAGE_SIZES, type PageSize } from '@openvidu-dashboard/typings'; -import { PreferencesService } from '../core/preferences.js'; -import { QueryStateService } from '../core/query-state.js'; -import { formatNumber } from '../format/formatters.js'; +import { PreferencesService } from '../../core/preferences/preferences.js'; +import { QueryStateService } from '../../core/state/query-state.js'; +import { formatNumber } from '../../format/formatters.js'; /** "Showing x–y of total", or "Showing x–y" when the total is unknown. */ export function shownRange(rangeStart: number, rowCount: number, total?: number): string { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table.html b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/data-table.html similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table.html rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/data-table.html diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table.scss b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/data-table.scss similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table.scss rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/data-table.scss diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/data-table.spec.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/data-table.spec.ts index fa91a7aca..cbaa1e717 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/data-table.spec.ts @@ -4,12 +4,12 @@ import { provideRouter, Router } from '@angular/router'; import { RouterTestingHarness } from '@angular/router/testing'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import { childComponent, routeElement } from '../../testing/harness.js'; -import { BreakpointService, type ScreenSize } from '../core/breakpoints.js'; -import { PreferencesService } from '../core/preferences.js'; +import { childComponent, routeElement } from '../../../testing/harness.js'; +import { PreferencesService } from '../../core/preferences/preferences.js'; +import { BreakpointService, type ScreenSize } from '../../core/ui/breakpoints.js'; +import { SectionCard } from '../tiles/section-card.js'; import { CursorPaginator, shownRange } from './cursor-paginator.js'; import { DataTable, type SortChange, TableCell, type TableColumn } from './data-table.js'; -import { SectionCard } from './section-card.js'; interface Room { sid: string; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/data-table.ts similarity index 95% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/data-table.ts index b63e874c2..27583fa80 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/data-table/data-table.ts @@ -21,12 +21,12 @@ import { MatOption, MatSelect } from '@angular/material/select'; import { MatTooltip } from '@angular/material/tooltip'; import type { SortOrder } from '@openvidu-dashboard/typings'; -import { BreakpointService } from '../core/breakpoints.js'; -import { PreferencesService } from '../core/preferences.js'; -import { ErrorBanner } from './error-banner.js'; -import { InfoTip } from './info-tip.js'; -import { SectionHeaderActions } from './section-card.js'; -import { Skeleton } from './skeleton.js'; +import { PreferencesService } from '../../core/preferences/preferences.js'; +import { BreakpointService } from '../../core/ui/breakpoints.js'; +import { ErrorBanner } from '../feedback/error-banner.js'; +import { Skeleton } from '../feedback/skeleton.js'; +import { InfoTip } from '../info-tip/info-tip.js'; +import { SectionHeaderActions } from '../tiles/section-card.js'; export interface TableColumn { key: string; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker.html b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker/date-time-range-picker.html similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker.html rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker/date-time-range-picker.html diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker.scss b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker/date-time-range-picker.scss similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker.scss rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker/date-time-range-picker.scss diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker/date-time-range-picker.spec.ts similarity index 96% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker/date-time-range-picker.spec.ts index e7d0246b5..b1d9ae6a2 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker/date-time-range-picker.spec.ts @@ -5,10 +5,10 @@ import { RouterTestingHarness } from '@angular/router/testing'; import { RANGE_PRESET_FROM, type RangePreset } from '@openvidu-dashboard/typings'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import { childComponent, routeElement } from '../../testing/harness.js'; -import { ListStateService } from '../core/list-state.js'; -import { PreferencesService } from '../core/preferences.js'; -import { SessionZoneService } from '../core/session-zone.js'; +import { childComponent, routeElement } from '../../../testing/harness.js'; +import { PreferencesService } from '../../core/preferences/preferences.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { SessionZoneService } from '../../core/state/session-zone.js'; import { DateTimeRangePicker, instantToWallClock, diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker/date-time-range-picker.ts similarity index 95% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker/date-time-range-picker.ts index adf45ca69..6f0d7ece6 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/date-time-range-picker/date-time-range-picker.ts @@ -26,12 +26,12 @@ import { formatRetentionLength, RANGE_PRESET_FROM, type RangePreset } from '@ope import { format } from 'date-fns'; import { enUS } from 'date-fns/locale/en-US'; -import { ListStateService } from '../core/list-state.js'; -import { browserTimeZone } from '../core/preferences.js'; -import { QueryStateService, type RangeParams } from '../core/query-state.js'; -import { resolveRange } from '../core/relative-time.js'; -import { formatNumber } from '../format/formatters.js'; -import { ZoneSelect } from './zone-select.js'; +import { browserTimeZone } from '../../core/preferences/preferences.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { QueryStateService, type RangeParams } from '../../core/state/query-state.js'; +import { resolveRange } from '../../core/state/relative-time.js'; +import { formatNumber } from '../../format/formatters.js'; +import { ZoneSelect } from '../zone/zone-select.js'; /** Opens the range picker of the header from a page, e.g. its "Widen range" action. */ @Service() diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/duration.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/duration/duration.spec.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/duration.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/duration/duration.spec.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/duration.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/duration/duration.ts similarity index 95% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/duration.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/duration/duration.ts index eb5493447..3e908b3c7 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/duration.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/duration/duration.ts @@ -1,7 +1,7 @@ import { Component, computed, input } from '@angular/core'; -import { injectTicker } from '../core/ticker.js'; -import { formatDuration } from '../format/formatters.js'; +import { injectTicker } from '../../core/refresh/ticker.js'; +import { formatDuration } from '../../format/formatters.js'; export interface LiveDuration { start?: string | Date | null | undefined; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/external-link.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/external-link/external-link.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/external-link.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/external-link/external-link.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/empty-state.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/empty-state.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/empty-state.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/empty-state.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/error-banner.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/error-banner.ts similarity index 95% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/error-banner.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/error-banner.ts index df7800062..58cb9ff31 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/error-banner.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/error-banner.ts @@ -1,5 +1,5 @@ import { Component, computed, input, output } from '@angular/core'; -import { ApiRequestError, toApiRequestError } from '../core/api-error.js'; +import { ApiRequestError, toApiRequestError } from '../../core/http/api-error.js'; import { Notice } from './notice.js'; /** Text for an error code; the server message stays for logs. */ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/notice.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/notice.spec.ts similarity index 97% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/notice.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/notice.spec.ts index 7d270a997..62654d7c7 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/notice.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/notice.spec.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { describe, expect, it } from 'vitest'; -import { ApiRequestError } from '../core/api-error.js'; +import { ApiRequestError } from '../../core/http/api-error.js'; import { ErrorBanner } from './error-banner.js'; import { Notice } from './notice.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/notice.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/notice.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/notice.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/notice.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/skeleton.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/skeleton.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/skeleton.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feedback/skeleton.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/info-tip.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/info-tip/info-tip.spec.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/info-tip.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/info-tip/info-tip.spec.ts index 390e57a3f..b4f1106c0 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/info-tip.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/info-tip/info-tip.spec.ts @@ -4,7 +4,7 @@ import { By } from '@angular/platform-browser'; import { MatTooltip } from '@angular/material/tooltip'; import { describe, expect, it } from 'vitest'; -import { settle } from '../../testing/fixtures.js'; +import { settle } from '../../../testing/fixtures.js'; import { InfoTip } from './info-tip.js'; @Component({ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/info-tip.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/info-tip/info-tip.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/info-tip.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/info-tip/info-tip.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feature-gate.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/feature-gate.ts similarity index 96% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feature-gate.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/feature-gate.ts index 865f4d685..768debd05 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/feature-gate.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/feature-gate.ts @@ -2,7 +2,7 @@ import { NgTemplateOutlet } from '@angular/common'; import { Component, computed, contentChild, Directive, inject, input, TemplateRef } from '@angular/core'; import type { FeatureKey } from '@openvidu-dashboard/typings'; -import { FeatureService } from '../core/info.js'; +import { FeatureService } from '../../core/info.js'; import { ProLockOverlay } from './pro-lock-overlay.js'; /** Content of a feature gate, instantiated only when the feature is enabled: ``. */ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/features.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/features.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/features.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/features.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/lock.spec.ts similarity index 91% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/lock.spec.ts index 9fd8ecce4..feec40ca7 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/lock.spec.ts @@ -6,16 +6,16 @@ import { provideRouter } from '@angular/router'; import { RouterTestingHarness } from '@angular/router/testing'; import { describe, expect, it } from 'vitest'; -import { routeElement } from '../../testing/harness.js'; -import { infoResponse } from '../../testing/fixtures.js'; -import { HttpService } from '../core/http.js'; -import { InfoService } from '../core/info.js'; -import { EntityPreviewService } from '../core/entity-preview.js'; -import { ListStateService } from '../core/list-state.js'; -import { LockedPage } from '../pages/locked-page.js'; -import { BreadcrumbService } from '../routing/breadcrumbs.js'; -import { Breadcrumbs } from './breadcrumbs.js'; +import { infoResponse } from '../../../testing/fixtures.js'; +import { routeElement } from '../../../testing/harness.js'; +import { HttpService } from '../../core/http/http.js'; +import { InfoService } from '../../core/info.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { BreadcrumbService } from '../../routing/breadcrumbs.js'; +import { Breadcrumbs } from '../../shell/breadcrumbs.js'; import { FeatureContent, FeatureGate } from './feature-gate.js'; +import { LockedPage } from './locked-page.js'; @Component({ selector: 'ovd-quality-card', template: 'real quality card' }) class QualityCard implements OnInit { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/locked-page.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/locked-page.spec.ts new file mode 100644 index 000000000..43f6799ba --- /dev/null +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/locked-page.spec.ts @@ -0,0 +1,76 @@ +import { provideHttpClient } from '@angular/common/http'; +import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { TestBed } from '@angular/core/testing'; +import { provideRouter } from '@angular/router'; +import { RouterTestingHarness } from '@angular/router/testing'; +import type { InfoResponse } from '@openvidu-dashboard/typings'; +import { describe, expect, it, vi } from 'vitest'; + +import { infoResponse, settle, signIn, statusResponse } from '../../../testing/fixtures.js'; +import { AuthService } from '../../core/auth/auth.js'; +import { InfoService } from '../../core/info.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ToastService } from '../../core/ui/toast.js'; +import { DASHBOARD_ROUTES } from '../../routes.js'; +import { composeRoutes } from '../../routing/compose-routes.js'; + +function setup(): HttpTestingController { + TestBed.configureTestingModule({ + providers: [ + provideRouter(composeRoutes(DASHBOARD_ROUTES)), + provideHttpClient(), + provideHttpClientTesting(), + { provide: ToastService, useValue: { show: vi.fn() } } + ] + }); + + return TestBed.inject(HttpTestingController); +} + +async function loadInfo(http: HttpTestingController, info: InfoResponse): Promise { + const load = TestBed.inject(InfoService).load(); + + http.expectOne('api/v1/info').flush(info); + await load; +} + +describe('LockedPage', () => { + it('shows the entity header from list data, the lock and a link back to the list with the range', async () => { + const http = setup(); + + await signIn(TestBed.inject(AuthService), http); + await loadInfo(http, infoResponse()); + TestBed.inject(EntityPreviewService).set('room', 'RM_ab12cd', { + name: 'demo-room', + status: 'active', + startedAt: '2026-10-13T12:31:05Z' + }); + + const harness = await RouterTestingHarness.create('/rooms?from=now-6h&to=now&tz=UTC'); + + await settle(); + + for (const request of http.match((req) => req.url.startsWith('api/v1/rooms'))) { + request.flush({}); + } + + await harness.navigateByUrl('/rooms/RM_ab12cd'); + + const element = harness.fixture.nativeElement as HTMLElement; + + expect(element.querySelector('h1')?.textContent).toBe('demo-room'); + expect(element.querySelector('ovd-locked-page .title ovd-copy-button button')?.getAttribute('aria-label')).toBe( + 'Copy room name' + ); + expect(element.querySelector('ovd-locked-page ovd-copy-chip')).toBeNull(); + expect(element.querySelector('ovd-locked-page ovd-status-badge')?.textContent).toContain('active'); + expect(element.querySelector('ovd-pro-lock-overlay')?.textContent).toContain( + 'Room detail is available in OpenVidu PRO' + ); + expect(element.querySelector('ovd-pro-lock-overlay a[href^="/rooms"]')?.getAttribute('href')).toBe( + '/rooms?from=now-6h&to=now&tz=UTC' + ); + http.expectOne('api/v1/status').flush(statusResponse()); + http.verify(); + }); +}); diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/locked-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/locked-page.ts similarity index 87% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/locked-page.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/locked-page.ts index aa3c6a6ac..d0ce6f0d0 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/locked-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/locked-page.ts @@ -2,14 +2,14 @@ import { Component, computed, inject } from '@angular/core'; import { ActivatedRoute, RouterLink } from '@angular/router'; import type { FeatureKey, NavigationMeta } from '@openvidu-dashboard/typings'; -import { type EntityKind, EntityPreviewService } from '../core/entity-preview.js'; -import { ListStateService } from '../core/list-state.js'; -import { ownData } from '../core/route-state.js'; -import { CopyButton } from '../components/copy-button.js'; -import { EmptyState } from '../components/empty-state.js'; -import { FeatureContent, FeatureGate } from '../components/feature-gate.js'; -import { StatusBadge, type StatusDomain } from '../components/status-badge.js'; -import { RECONCILER_ESTIMATE } from '../format/labels.js'; +import { type EntityKind, EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { ownData } from '../../core/state/route-state.js'; +import { RECONCILER_ESTIMATE } from '../../format/labels.js'; +import { StatusBadge, type StatusDomain } from '../badges/status-badge.js'; +import { CopyButton } from '../copy-button/copy-button.js'; +import { EmptyState } from '../feedback/empty-state.js'; +import { FeatureContent, FeatureGate } from './feature-gate.js'; const STATUS_DOMAINS: Readonly> = { room: 'room', diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/pro-lock-overlay.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/pro-lock-overlay.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/pro-lock-overlay.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/pro-lock-overlay.ts index af467b70c..3d1c6fbf8 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/pro-lock-overlay.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/lock/pro-lock-overlay.ts @@ -2,7 +2,7 @@ import { Component, computed, input } from '@angular/core'; import { MatIcon } from '@angular/material/icon'; import type { FeatureKey } from '@openvidu-dashboard/typings'; -import { EXTERNAL_LINKS } from '../core/links.js'; +import { EXTERNAL_LINKS } from '../../core/links.js'; import { FEATURE_COPY } from './features.js'; /** diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control/refresh-control.spec.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control/refresh-control.spec.ts index 3f6329db3..a4ecdba41 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control/refresh-control.spec.ts @@ -3,7 +3,7 @@ import { TestBed } from '@angular/core/testing'; import { provideRouter } from '@angular/router'; import { describe, expect, it, vi } from 'vitest'; -import { RefreshRegistry, type RefreshScheduler } from '../core/refresh.js'; +import { RefreshRegistry, type RefreshScheduler } from '../../core/refresh/refresh.js'; import { RefreshControl } from './refresh-control.js'; describe('RefreshControl', () => { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control/refresh-control.ts similarity index 96% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control/refresh-control.ts index e332b52cf..98abe864b 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/refresh-control/refresh-control.ts @@ -5,9 +5,9 @@ import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; import { MatTooltip } from '@angular/material/tooltip'; import { REFRESH_INTERVALS_MS, type RefreshIntervalMs } from '@openvidu-dashboard/typings'; -import { QueryStateService } from '../core/query-state.js'; -import { RefreshRegistry } from '../core/refresh.js'; -import { formatTimestamp } from '../format/formatters.js'; +import { RefreshRegistry } from '../../core/refresh/refresh.js'; +import { QueryStateService } from '../../core/state/query-state.js'; +import { formatTimestamp } from '../../format/formatters.js'; export const REFRESH_LABELS: Readonly> = { 0: 'Off', diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/global-search.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/global-search.spec.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/global-search.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/global-search.spec.ts index 3bf10cc75..10f7e419f 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/global-search.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/global-search.spec.ts @@ -6,7 +6,7 @@ import { provideRouter, Router } from '@angular/router'; import { RouterTestingHarness } from '@angular/router/testing'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import { childComponent, routeElement } from '../../testing/harness.js'; +import { childComponent, routeElement } from '../../../testing/harness.js'; import { GlobalSearch, SEARCH_DEBOUNCE_MS, sidTarget } from './global-search.js'; @Component({ selector: 'ovd-page', template: 'page' }) diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/global-search.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/global-search.ts similarity index 96% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/global-search.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/global-search.ts index ac165833c..1b9df8d9d 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/global-search.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/global-search.ts @@ -11,11 +11,11 @@ import { type Params, Router } from '@angular/router'; import { entityIdKind, type ListResponse } from '@openvidu-dashboard/typings'; import { catchError, debounceTime, distinctUntilChanged, forkJoin, map, of, Subject, switchMap } from 'rxjs'; -import type { EntityKind } from '../core/entity-preview.js'; -import { GLOBAL_SEARCH_ID } from '../core/focus.js'; -import { HttpService } from '../core/http.js'; -import { ListStateService } from '../core/list-state.js'; -import { resolveRange } from '../core/relative-time.js'; +import { HttpService } from '../../core/http/http.js'; +import type { EntityKind } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { resolveRange } from '../../core/state/relative-time.js'; +import { GLOBAL_SEARCH_ID } from '../../core/ui/focus.js'; import { DETAIL_PATHS, SHORT_SEARCH_HINT } from './list-search.js'; export const SEARCH_DEBOUNCE_MS = 300; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/list-search.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/list-search.spec.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/list-search.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/list-search.spec.ts index 5a2161f11..c6024689e 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/list-search.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/list-search.spec.ts @@ -4,7 +4,7 @@ import { provideRouter, Router } from '@angular/router'; import { RouterTestingHarness } from '@angular/router/testing'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { routeElement } from '../../testing/harness.js'; +import { routeElement } from '../../../testing/harness.js'; import { EXACT_ID_HINT, LIST_SEARCH_DEBOUNCE_MS, diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/list-search.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/list-search.ts similarity index 95% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/list-search.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/list-search.ts index e0bb44008..300ee1950 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/list-search.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/search/list-search.ts @@ -7,9 +7,9 @@ import { MatTooltip } from '@angular/material/tooltip'; import { Router } from '@angular/router'; import { isEntityId } from '@openvidu-dashboard/typings'; -import type { EntityKind } from '../core/entity-preview.js'; -import { ListStateService } from '../core/list-state.js'; -import { QueryStateService } from '../core/query-state.js'; +import type { EntityKind } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { QueryStateService } from '../../core/state/query-state.js'; export const LIST_SEARCH_DEBOUNCE_MS = 300; export const SHORT_SEARCH_HINT = 'Type at least 2 characters'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/kpi-tile.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/kpi-tile.spec.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/kpi-tile.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/kpi-tile.spec.ts index b2121f348..da31e1ba1 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/kpi-tile.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/kpi-tile.spec.ts @@ -4,8 +4,8 @@ import { provideRouter } from '@angular/router'; import { RouterTestingHarness } from '@angular/router/testing'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { routeElement } from '../../testing/harness.js'; -import { setMediaQuery } from '../../testing/media.js'; +import { routeElement } from '../../../testing/harness.js'; +import { setMediaQuery } from '../../../testing/media.js'; import { HIGHLIGHT_MS, KpiTile, TICKING_MS } from './kpi-tile.js'; import { SectionCard } from './section-card.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/kpi-tile.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/kpi-tile.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/kpi-tile.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/kpi-tile.ts index 40c895474..85c5bd91c 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/kpi-tile.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/kpi-tile.ts @@ -13,8 +13,8 @@ import { import { MatTooltip } from '@angular/material/tooltip'; import { type Params, RouterLink } from '@angular/router'; -import { APPROXIMATE_TEXT } from '../format/info-texts.js'; -import { InfoTip } from './info-tip.js'; +import { APPROXIMATE_TEXT } from '../../format/info-texts.js'; +import { InfoTip } from '../info-tip/info-tip.js'; export const HIGHLIGHT_MS = 600; /** Values that change more often than this (a duration ticking every second) are never highlighted. */ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/section-card.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/section-card.ts similarity index 95% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/section-card.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/section-card.ts index c10598a93..f3098bebf 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/section-card.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/section-card.ts @@ -3,9 +3,9 @@ import { Component, computed, inject, Injectable, input, signal, type TemplateRe import { MatIconButton } from '@angular/material/button'; import { MatIcon } from '@angular/material/icon'; -import { RouteStateService } from '../core/route-state.js'; -import { SectionStateService } from '../core/section-state.js'; -import { InfoTip } from './info-tip.js'; +import { RouteStateService } from '../../core/state/route-state.js'; +import { SectionStateService } from '../../core/state/section-state.js'; +import { InfoTip } from '../info-tip/info-tip.js'; let nextId = 0; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tile-row.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/tile-row.spec.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tile-row.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/tile-row.spec.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tile-row.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/tile-row.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tile-row.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/tiles/tile-row.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone-chip.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone/zone-chip.spec.ts similarity index 91% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone-chip.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone/zone-chip.spec.ts index 50922dbc9..ee3d82168 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone-chip.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone/zone-chip.spec.ts @@ -4,10 +4,10 @@ import { provideRouter, Router } from '@angular/router'; import { RouterTestingHarness } from '@angular/router/testing'; import { beforeEach, describe, expect, it } from 'vitest'; -import { routeElement } from '../../testing/harness.js'; -import { ListStateService } from '../core/list-state.js'; -import { browserTimeZone, PreferencesService } from '../core/preferences.js'; -import { SessionZoneService } from '../core/session-zone.js'; +import { routeElement } from '../../../testing/harness.js'; +import { browserTimeZone, PreferencesService } from '../../core/preferences/preferences.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { SessionZoneService } from '../../core/state/session-zone.js'; import { ZoneChip } from './zone-chip.js'; @Component({ imports: [ZoneChip], template: '' }) diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone-chip.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone/zone-chip.ts similarity index 95% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone-chip.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone/zone-chip.ts index d42a4b227..c4a2c6704 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone-chip.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone/zone-chip.ts @@ -4,8 +4,8 @@ import { MatIcon } from '@angular/material/icon'; import { MatDivider } from '@angular/material/list'; import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; -import { browserTimeZone } from '../core/preferences.js'; -import { QueryStateService } from '../core/query-state.js'; +import { browserTimeZone } from '../../core/preferences/preferences.js'; +import { QueryStateService } from '../../core/state/query-state.js'; import { ZoneSelect } from './zone-select.js'; /** diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone-select.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone/zone-select.ts similarity index 97% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone-select.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone/zone-select.ts index ee11406e7..b2f386030 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone-select.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/zone/zone-select.ts @@ -4,7 +4,7 @@ import { MatOption } from '@angular/material/core'; import { MatFormField, MatLabel } from '@angular/material/form-field'; import { MatInput } from '@angular/material/input'; -import { isTimeZone } from '../core/relative-time.js'; +import { isTimeZone } from '../../core/state/relative-time.js'; const MAX_ZONE_OPTIONS = 50; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth/auth.spec.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth/auth.spec.ts index 3c7fefa50..8b878ffb7 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth/auth.spec.ts @@ -6,9 +6,9 @@ import { provideRouter, Router } from '@angular/router'; import { RouterTestingHarness } from '@angular/router/testing'; import { beforeEach, describe, expect, it } from 'vitest'; -import { settle } from '../../testing/fixtures.js'; +import { settle } from '../../../testing/fixtures.js'; +import { HttpService } from '../http/http.js'; import { authGuard, authInterceptor, AuthService } from './auth.js'; -import { HttpService } from './http.js'; @Component({ template: 'page' }) class Page {} diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth/auth.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth/auth.ts index 289f909cd..cc3dec9aa 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/auth/auth.ts @@ -10,7 +10,7 @@ import { type CanActivateFn, Router } from '@angular/router'; import type { AuthTokenResponse, MeResponse } from '@openvidu-dashboard/typings'; import { catchError, from, switchMap, throwError } from 'rxjs'; -import { API_BASE, HttpService } from './http.js'; +import { API_BASE, HttpService } from '../http/http.js'; /** Requests that must not trigger the refresh-and-replay flow: the auth endpoints themselves. */ export const SKIP_SESSION_REFRESH = new HttpContextToken(() => false); diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/api-error.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http/api-error.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/api-error.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http/api-error.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/connectivity.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http/connectivity.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/connectivity.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http/connectivity.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http/http.spec.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http/http.spec.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http/http.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/http/http.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/info.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/info.spec.ts index 0d0b263c6..8aafd46b2 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/info.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/info.spec.ts @@ -5,7 +5,7 @@ import { provideRouter } from '@angular/router'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { infoResponse } from '../../testing/fixtures.js'; -import { HttpService } from './http.js'; +import { HttpService } from './http/http.js'; import { FeatureService, InfoService, proFeatureInterceptor } from './info.js'; describe('InfoService', () => { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/info.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/info.ts index 99eeaae5f..3e7ee8bb0 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/info.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/info.ts @@ -3,9 +3,9 @@ import { computed, inject, Service, type Signal, signal } from '@angular/core'; import type { FeatureKey, InfoPublicResponse, InfoResponse } from '@openvidu-dashboard/typings'; import { catchError, throwError } from 'rxjs'; -import { type ApiRequestError, toApiRequestError } from './api-error.js'; -import { AuthService } from './auth.js'; -import { API_BASE, HttpService } from './http.js'; +import { AuthService } from './auth/auth.js'; +import { type ApiRequestError, toApiRequestError } from './http/api-error.js'; +import { API_BASE, HttpService } from './http/http.js'; function isFullInfo(info: InfoResponse | InfoPublicResponse): info is InfoResponse { return 'features' in info; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/preferences.spec.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/preferences.spec.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/preferences.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/preferences.ts index 5c840cd2d..90c17a113 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/preferences.ts @@ -15,7 +15,7 @@ import { type TimeZonePreference } from '@openvidu-dashboard/typings'; -import { isTimeZone } from './relative-time.js'; +import { isTimeZone } from '../state/relative-time.js'; import { StorageService } from './storage.js'; export const PREFERENCES_KEY = 'ovd.prefs.v1'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/storage.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/storage.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/storage.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/storage.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/theme.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/theme.spec.ts similarity index 94% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/theme.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/theme.spec.ts index c91924678..0d93902da 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/theme.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/theme.spec.ts @@ -1,7 +1,7 @@ import { TestBed } from '@angular/core/testing'; import { afterEach, describe, expect, it } from 'vitest'; -import { resetMediaQueries, setMediaQuery } from '../../testing/media.js'; +import { resetMediaQueries, setMediaQuery } from '../../../testing/media.js'; import { PreferencesService } from './preferences.js'; import { ThemeService } from './theme.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/theme.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/theme.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/theme.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/preferences/theme.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/providers.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/providers.ts index 42689e3dd..760763be7 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/providers.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/providers.ts @@ -11,10 +11,10 @@ import { MatIconRegistry } from '@angular/material/icon'; import { DomSanitizer, Title } from '@angular/platform-browser'; import { type RouterStateSnapshot, TitleStrategy } from '@angular/router'; -import { authInterceptor, AuthService } from './auth.js'; -import { connectivityInterceptor } from './connectivity.js'; +import { authInterceptor, AuthService } from './auth/auth.js'; +import { connectivityInterceptor } from './http/connectivity.js'; import { InfoService, proFeatureInterceptor } from './info.js'; -import { ThemeService } from './theme.js'; +import { ThemeService } from './preferences/theme.js'; export const PRODUCT_NAME = 'OpenVidu Dashboard'; /** Icon sprite built by `scripts/icons.mjs`, relative to the document base. */ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/list-loader.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/list-loader.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/list-loader.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/list-loader.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/live-counters.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/live-counters.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/live-counters.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/live-counters.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/refresh.spec.ts similarity index 99% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/refresh.spec.ts index 8674a1d31..6cb00ef4b 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/refresh.spec.ts @@ -3,7 +3,7 @@ import { TestBed } from '@angular/core/testing'; import type { RefreshIntervalMs } from '@openvidu-dashboard/typings'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import { PreferencesService } from './preferences.js'; +import { PreferencesService } from '../preferences/preferences.js'; import { injectRefreshScheduler, RefreshRegistry, RefreshScheduler } from './refresh.js'; class FakeDocument { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/refresh.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/refresh.ts index 60bf8a14a..b42a28c4d 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/refresh.ts @@ -1,7 +1,7 @@ import { DestroyRef, DOCUMENT, effect, inject, Service, type Signal, signal } from '@angular/core'; import type { RefreshIntervalMs } from '@openvidu-dashboard/typings'; -import { PreferencesService } from './preferences.js'; +import { PreferencesService } from '../preferences/preferences.js'; /** First retry delay after a failed refresh; it doubles up to `BACKOFF_MAX_MS`. */ export const BACKOFF_START_MS = 10_000; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/server-status.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/server-status.spec.ts similarity index 97% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/server-status.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/server-status.spec.ts index a8fdf7d10..0803cfaa9 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/server-status.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/server-status.spec.ts @@ -5,9 +5,9 @@ import { TestBed } from '@angular/core/testing'; import { provideRouter } from '@angular/router'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import { infoResponse, statusResponse } from '../../testing/fixtures.js'; -import { InfoService } from './info.js'; -import { PreferencesService } from './preferences.js'; +import { infoResponse, statusResponse } from '../../../testing/fixtures.js'; +import { InfoService } from '../info.js'; +import { PreferencesService } from '../preferences/preferences.js'; import { injectServerStatusPoll, ServerStatusService } from './server-status.js'; describe('ServerStatusService', () => { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/server-status.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/server-status.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/server-status.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/server-status.ts index cec31e0e4..6cfc85876 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/server-status.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/server-status.ts @@ -1,8 +1,8 @@ import { computed, effect, inject, Service, signal, untracked } from '@angular/core'; import { freshnessWindows, type RefreshIntervalMs, type StatusResponse } from '@openvidu-dashboard/typings'; -import { HttpService } from './http.js'; -import { InfoService } from './info.js'; +import { HttpService } from '../http/http.js'; +import { InfoService } from '../info.js'; import { injectRefreshScheduler, type RefreshScheduler } from './refresh.js'; export const STATUS_POLL_MS: RefreshIntervalMs = 30_000; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ticker.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/ticker.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ticker.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/refresh/ticker.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/entity-preview.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/entity-preview.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/entity-preview.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/entity-preview.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/list-state.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/list-state.ts similarity index 98% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/list-state.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/list-state.ts index d19f6bd07..fa4e83443 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/list-state.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/list-state.ts @@ -4,7 +4,7 @@ import { NavigationEnd, type Params, Router } from '@angular/router'; import { PAGE_SIZES, type PageSize, RANGE_PRESET_FROM, SortOrder } from '@openvidu-dashboard/typings'; import { filter } from 'rxjs'; -import { PreferencesService } from './preferences.js'; +import { PreferencesService } from '../preferences/preferences.js'; import { QueryStateService, type RangeParams } from './query-state.js'; import { isTimeZone } from './relative-time.js'; import { RouteStateService } from './route-state.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/query-state.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/query-state.spec.ts similarity index 99% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/query-state.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/query-state.spec.ts index d4cedab96..25c4ba09e 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/query-state.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/query-state.spec.ts @@ -7,8 +7,8 @@ import { RouterTestingHarness } from '@angular/router/testing'; import { filter, firstValueFrom } from 'rxjs'; import { beforeEach, describe, expect, it } from 'vitest'; +import { PreferencesService } from '../preferences/preferences.js'; import { ListStateService } from './list-state.js'; -import { PreferencesService } from './preferences.js'; import { QueryStateService } from './query-state.js'; import { SessionZoneService } from './session-zone.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/query-state.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/query-state.ts similarity index 97% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/query-state.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/query-state.ts index 307426f2c..724336904 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/query-state.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/query-state.ts @@ -2,8 +2,8 @@ import { computed, inject, Service } from '@angular/core'; import { type Params, Router } from '@angular/router'; import { PAGE_SIZES, type PageSize, SortOrder, type TimeExpression } from '@openvidu-dashboard/typings'; -import type { QueryValue } from './http.js'; -import { PreferencesService } from './preferences.js'; +import type { QueryValue } from '../http/http.js'; +import { PreferencesService } from '../preferences/preferences.js'; import { isTimeExpression, isTimeZone } from './relative-time.js'; import { RouteStateService } from './route-state.js'; import { SessionZoneService } from './session-zone.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ranked-sort.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/ranked-sort.ts similarity index 97% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ranked-sort.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/ranked-sort.ts index 2cbac6537..b66523a71 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ranked-sort.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/ranked-sort.ts @@ -1,7 +1,7 @@ import { computed, inject, type Signal } from '@angular/core'; import type { InfoLimits } from '@openvidu-dashboard/typings'; -import { InfoService } from './info.js'; +import { InfoService } from '../info.js'; const HOUR_MS = 3_600_000; const DAY_MS = 24 * HOUR_MS; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/relative-time.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/relative-time.spec.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/relative-time.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/relative-time.spec.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/relative-time.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/relative-time.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/relative-time.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/relative-time.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/route-state.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/route-state.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/route-state.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/route-state.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/section-state.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/section-state.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/section-state.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/section-state.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/session-zone.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/session-zone.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/session-zone.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/state/session-zone.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/breakpoints.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/breakpoints.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/breakpoints.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/breakpoints.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/clipboard.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/clipboard.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/clipboard.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/clipboard.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/focus.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/focus.spec.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/focus.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/focus.spec.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/focus.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/focus.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/focus.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/focus.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/toast.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/toast.spec.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/toast.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/toast.spec.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/toast.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/toast.ts similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/toast.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/core/ui/toast.ts diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/agents/agents-page.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/agents/agents-page.spec.ts index 487381a00..6635e33ac 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/agents/agents-page.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/agents/agents-page.spec.ts @@ -10,7 +10,7 @@ import { describe, expect, it } from 'vitest'; import { infoResponse, settle } from '../../../testing/fixtures.js'; import { routeElement } from '../../../testing/harness.js'; import { InfoService } from '../../core/info.js'; -import { LiveCountersService } from '../../core/live-counters.js'; +import { LiveCountersService } from '../../core/refresh/live-counters.js'; import { AgentsPage } from './agents-page.js'; @Component({ selector: 'ovd-blank', template: '' }) diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/agents/agents-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/agents/agents-page.ts index 1b54f54a6..c3039e030 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/agents/agents-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/agents/agents-page.ts @@ -10,27 +10,27 @@ import { ParticipantSort, ParticipantStatus } from '@openvidu-dashboard/typings'; -import { CopyButton } from '../../components/copy-button.js'; -import { CursorPaginator } from '../../components/cursor-paginator.js'; -import { DataTable, type SortChange, TableCell, type TableColumn } from '../../components/data-table.js'; -import { RangePickerService } from '../../components/date-time-range-picker.js'; -import { Duration } from '../../components/duration.js'; -import { EmptyState } from '../../components/empty-state.js'; -import { KpiTile } from '../../components/kpi-tile.js'; -import { exactListId, ListSearch, listSearchQuery } from '../../components/list-search.js'; -import { Notice } from '../../components/notice.js'; -import { RoomChip } from '../../components/room-chip.js'; -import { SourceIcon } from '../../components/source-icon.js'; -import { StatusBadge } from '../../components/status-badge.js'; -import { TileRow } from '../../components/tile-row.js'; -import { EntityPreviewService } from '../../core/entity-preview.js'; -import { injectListLoader } from '../../core/list-loader.js'; -import { ListStateService } from '../../core/list-state.js'; -import { LiveCountersService } from '../../core/live-counters.js'; -import { QueryStateService } from '../../core/query-state.js'; -import { injectRankedSortLimits, rankedSortReasons } from '../../core/ranked-sort.js'; -import { resolveRange } from '../../core/relative-time.js'; -import { StorageService } from '../../core/storage.js'; +import { RoomChip } from '../../components/badges/room-chip.js'; +import { SourceIcon } from '../../components/badges/source-icon.js'; +import { StatusBadge } from '../../components/badges/status-badge.js'; +import { CopyButton } from '../../components/copy-button/copy-button.js'; +import { CursorPaginator } from '../../components/data-table/cursor-paginator.js'; +import { DataTable, type SortChange, TableCell, type TableColumn } from '../../components/data-table/data-table.js'; +import { RangePickerService } from '../../components/date-time-range-picker/date-time-range-picker.js'; +import { Duration } from '../../components/duration/duration.js'; +import { EmptyState } from '../../components/feedback/empty-state.js'; +import { Notice } from '../../components/feedback/notice.js'; +import { exactListId, ListSearch, listSearchQuery } from '../../components/search/list-search.js'; +import { KpiTile } from '../../components/tiles/kpi-tile.js'; +import { TileRow } from '../../components/tiles/tile-row.js'; +import { StorageService } from '../../core/preferences/storage.js'; +import { injectListLoader } from '../../core/refresh/list-loader.js'; +import { LiveCountersService } from '../../core/refresh/live-counters.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { QueryStateService } from '../../core/state/query-state.js'; +import { injectRankedSortLimits, rankedSortReasons } from '../../core/state/ranked-sort.js'; +import { resolveRange } from '../../core/state/relative-time.js'; import { formatNumber, formatTimestamp } from '../../format/formatters.js'; import { injectLiveCounters } from '../overview/overview-data.js'; import { participantPreview } from '../participants/participant-display.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-card.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-card.ts index 359a6bab1..861a3f6b5 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-card.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-card.ts @@ -14,11 +14,11 @@ import { MatButton } from '@angular/material/button'; import { MatIcon } from '@angular/material/icon'; import type { FeatureKey } from '@openvidu-dashboard/typings'; -import { EmptyState } from '../../components/empty-state.js'; -import { ErrorBanner } from '../../components/error-banner.js'; -import { ProLockOverlay } from '../../components/pro-lock-overlay.js'; -import { SectionCard } from '../../components/section-card.js'; -import { Skeleton } from '../../components/skeleton.js'; +import { EmptyState } from '../../components/feedback/empty-state.js'; +import { ErrorBanner } from '../../components/feedback/error-banner.js'; +import { Skeleton } from '../../components/feedback/skeleton.js'; +import { ProLockOverlay } from '../../components/lock/pro-lock-overlay.js'; +import { SectionCard } from '../../components/tiles/section-card.js'; import { FeatureService } from '../../core/info.js'; /** Content of an analytics card, instantiated only once it has data: ``. */ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-data.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-data.ts index 45022eef8..660a92f3a 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-data.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-data.ts @@ -16,8 +16,8 @@ import { type FeatureKey } from '@openvidu-dashboard/typings'; -import { HttpService } from '../../core/http.js'; -import type { RangeParams } from '../../core/query-state.js'; +import { HttpService } from '../../core/http/http.js'; +import type { RangeParams } from '../../core/state/query-state.js'; import { apiRange } from '../rooms/rooms-data.js'; import { hourlyGranularity } from './analytics-granularity.js'; import type { AnalyticsProCard } from './analytics-seams.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-page.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-page.spec.ts index 9d779ebf3..453cb161f 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-page.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-page.spec.ts @@ -17,9 +17,9 @@ import { seriesRequests } from '../../../testing/analytics.js'; import { settle } from '../../../testing/fixtures.js'; -import { PreferencesService } from '../../core/preferences.js'; -import { RefreshRegistry } from '../../core/refresh.js'; -import { ToastService } from '../../core/toast.js'; +import { PreferencesService } from '../../core/preferences/preferences.js'; +import { RefreshRegistry } from '../../core/refresh/refresh.js'; +import { ToastService } from '../../core/ui/toast.js'; import { analyticsPlan } from './analytics-data.js'; import { autoGranularity, granularityOptions } from './analytics-granularity.js'; import { dimensionLabel } from './analytics-page.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-page.ts index dbd46aa8f..d453a3c92 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/analytics/analytics-page.ts @@ -25,21 +25,21 @@ import { import { BreakdownChart } from '../../charts/breakdown-chart.js'; import { seriesNote } from '../../charts/chart-note.js'; import type { BreakdownEntry, ChartSeries } from '../../charts/chart-options.js'; -import { TimeSeriesChart } from '../../charts/time-series-chart.js'; -import { RangePickerService } from '../../components/date-time-range-picker.js'; -import { errorMessage } from '../../components/error-banner.js'; -import { KpiTile } from '../../components/kpi-tile.js'; -import { Notice } from '../../components/notice.js'; -import { TileRow } from '../../components/tile-row.js'; -import { toApiRequestError } from '../../core/api-error.js'; +import { TimeSeriesChart } from '../../charts/time-series-chart/time-series-chart.js'; +import { RangePickerService } from '../../components/date-time-range-picker/date-time-range-picker.js'; +import { errorMessage } from '../../components/feedback/error-banner.js'; +import { Notice } from '../../components/feedback/notice.js'; +import { KpiTile } from '../../components/tiles/kpi-tile.js'; +import { TileRow } from '../../components/tiles/tile-row.js'; +import { toApiRequestError } from '../../core/http/api-error.js'; import { InfoService } from '../../core/info.js'; -import { injectListLoader } from '../../core/list-loader.js'; -import { ListStateService } from '../../core/list-state.js'; -import { QueryStateService } from '../../core/query-state.js'; -import { resolveRange } from '../../core/relative-time.js'; -import { ToastService } from '../../core/toast.js'; -import { INFO_TEXTS } from '../../format/info-texts.js'; +import { injectListLoader } from '../../core/refresh/list-loader.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { QueryStateService } from '../../core/state/query-state.js'; +import { resolveRange } from '../../core/state/relative-time.js'; +import { ToastService } from '../../core/ui/toast.js'; import { formatBytes, formatDuration, formatNumber, formatPercent } from '../../format/formatters.js'; +import { INFO_TEXTS } from '../../format/info-texts.js'; import { CONNECTION_TYPE_LABELS, EGRESS_TYPE_LABELS, diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-data.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-data.ts index b310d0b20..676fcfd9d 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-data.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-data.ts @@ -9,8 +9,8 @@ import type { SortOrder } from '@openvidu-dashboard/typings'; -import { HttpService } from '../../core/http.js'; -import type { RangeParams } from '../../core/query-state.js'; +import { HttpService } from '../../core/http/http.js'; +import type { RangeParams } from '../../core/state/query-state.js'; import { apiRange } from '../rooms/rooms-data.js'; export interface EgressListRequest { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-display.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-display.ts index 38a40942b..bad64dd98 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-display.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-display.ts @@ -1,6 +1,6 @@ import { type EgressListItem, type EgressOutputKind, type EgressStatus, isEntityId } from '@openvidu-dashboard/typings'; -import type { EntityPreview } from '../../core/entity-preview.js'; +import type { EntityPreview } from '../../core/state/entity-preview.js'; /** Icon of each output kind. */ export const EGRESS_OUTPUT_ICONS: Readonly> = { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-locked-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-locked-page.ts index f61d7f44d..630088e3f 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-locked-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-locked-page.ts @@ -1,9 +1,9 @@ import { Component, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { EntityPreviewService } from '../../core/entity-preview.js'; -import { ListStateService } from '../../core/list-state.js'; -import { LockedPage } from '../../pages/locked-page.js'; +import { LockedPage } from '../../components/lock/locked-page.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; import { EgressDataService } from './egress-data.js'; import { egressPreview, isEgressId } from './egress-display.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-page.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-page.spec.ts index dcf639a1a..6b13e7d40 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-page.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-page.spec.ts @@ -9,9 +9,9 @@ import { describe, expect, it } from 'vitest'; import { infoResponse, settle } from '../../../testing/fixtures.js'; import { routeElement } from '../../../testing/harness.js'; -import { LIST_SEARCH_DEBOUNCE_MS } from '../../components/list-search.js'; -import { EntityPreviewService } from '../../core/entity-preview.js'; +import { LIST_SEARCH_DEBOUNCE_MS } from '../../components/search/list-search.js'; import { InfoService } from '../../core/info.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; import { EgressLockedPage } from './egress-locked-page.js'; import { EgressPage } from './egress-page.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-page.ts index ad9e187bf..868413dd6 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/egress/egress-page.ts @@ -15,30 +15,30 @@ import { type ListResponse } from '@openvidu-dashboard/typings'; -import { CopyButton } from '../../components/copy-button.js'; -import { CursorPaginator } from '../../components/cursor-paginator.js'; -import { DataTable, type SortChange, TableCell, type TableColumn } from '../../components/data-table.js'; -import { RangePickerService } from '../../components/date-time-range-picker.js'; -import { Duration } from '../../components/duration.js'; -import { EmptyState } from '../../components/empty-state.js'; -import { KindBadge } from '../../components/kind-badge.js'; -import { KpiTile } from '../../components/kpi-tile.js'; -import { exactListId, ListSearch, listSearchQuery } from '../../components/list-search.js'; -import { RoomChip } from '../../components/room-chip.js'; -import { StatusBadge } from '../../components/status-badge.js'; -import { TileRow } from '../../components/tile-row.js'; -import { EntityPreviewService } from '../../core/entity-preview.js'; -import { injectListLoader } from '../../core/list-loader.js'; -import { ListStateService } from '../../core/list-state.js'; -import { QueryStateService } from '../../core/query-state.js'; -import { injectRankedSortLimits, rankedSortReasons } from '../../core/ranked-sort.js'; -import { resolveRange } from '../../core/relative-time.js'; -import { injectTicker } from '../../core/ticker.js'; +import { KindBadge } from '../../components/badges/kind-badge.js'; +import { RoomChip } from '../../components/badges/room-chip.js'; +import { StatusBadge } from '../../components/badges/status-badge.js'; +import { CopyButton } from '../../components/copy-button/copy-button.js'; +import { CursorPaginator } from '../../components/data-table/cursor-paginator.js'; +import { DataTable, type SortChange, TableCell, type TableColumn } from '../../components/data-table/data-table.js'; +import { RangePickerService } from '../../components/date-time-range-picker/date-time-range-picker.js'; +import { Duration } from '../../components/duration/duration.js'; +import { EmptyState } from '../../components/feedback/empty-state.js'; +import { exactListId, ListSearch, listSearchQuery } from '../../components/search/list-search.js'; +import { KpiTile } from '../../components/tiles/kpi-tile.js'; +import { TileRow } from '../../components/tiles/tile-row.js'; +import { injectListLoader } from '../../core/refresh/list-loader.js'; +import { injectTicker } from '../../core/refresh/ticker.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { QueryStateService } from '../../core/state/query-state.js'; +import { injectRankedSortLimits, rankedSortReasons } from '../../core/state/ranked-sort.js'; +import { resolveRange } from '../../core/state/relative-time.js'; import { formatDuration, formatNumber, formatTimestamp } from '../../format/formatters.js'; import { EGRESS_STATUS_LABELS, EGRESS_TYPE_LABELS, RECONCILER_ESTIMATE } from '../../format/labels.js'; import { isRoomSid } from '../rooms/room-display.js'; -import { egressErrorHint, egressErrorMarker, egressPreview } from './egress-display.js'; import { EgressDataService, type EgressListRequest } from './egress-data.js'; +import { egressErrorHint, egressErrorMarker, egressPreview } from './egress-display.js'; import { EgressOutputs } from './egress-outputs.js'; const STATUSES = Object.values(EgressStatus); diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-data.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-data.ts index 4ee59431b..95b02d675 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-data.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-data.ts @@ -9,8 +9,8 @@ import type { SortOrder } from '@openvidu-dashboard/typings'; -import { HttpService } from '../../core/http.js'; -import type { RangeParams } from '../../core/query-state.js'; +import { HttpService } from '../../core/http/http.js'; +import type { RangeParams } from '../../core/state/query-state.js'; import { apiRange } from '../rooms/rooms-data.js'; export interface IngressListRequest { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-display.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-display.ts index 768a52282..94b49cec6 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-display.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-display.ts @@ -1,6 +1,6 @@ import { type IngressListItem, isEntityId } from '@openvidu-dashboard/typings'; -import type { EntityPreview } from '../../core/entity-preview.js'; +import type { EntityPreview } from '../../core/state/entity-preview.js'; export function isIngressId(value: string): boolean { return isEntityId('ingress', value); diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-locked-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-locked-page.ts index 8a67a2870..d359bf771 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-locked-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-locked-page.ts @@ -1,9 +1,9 @@ import { Component, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { EntityPreviewService } from '../../core/entity-preview.js'; -import { ListStateService } from '../../core/list-state.js'; -import { LockedPage } from '../../pages/locked-page.js'; +import { LockedPage } from '../../components/lock/locked-page.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; import { IngressDataService } from './ingress-data.js'; import { ingressPreview, isIngressId } from './ingress-display.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-page.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-page.spec.ts index 16b316c9a..7497d842b 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-page.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-page.spec.ts @@ -9,7 +9,7 @@ import { describe, expect, it } from 'vitest'; import { infoResponse, settle } from '../../../testing/fixtures.js'; import { routeElement } from '../../../testing/harness.js'; -import { LIST_SEARCH_DEBOUNCE_MS } from '../../components/list-search.js'; +import { LIST_SEARCH_DEBOUNCE_MS } from '../../components/search/list-search.js'; import { InfoService } from '../../core/info.js'; import { IngressLockedPage } from './ingress-locked-page.js'; import { IngressPage } from './ingress-page.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-page.ts index 3720a60da..ea2dd9232 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/ingress/ingress-page.ts @@ -14,25 +14,25 @@ import { type ListResponse } from '@openvidu-dashboard/typings'; -import { CopyButton } from '../../components/copy-button.js'; -import { CursorPaginator } from '../../components/cursor-paginator.js'; -import { DataTable, type SortChange, TableCell, type TableColumn } from '../../components/data-table.js'; -import { RangePickerService } from '../../components/date-time-range-picker.js'; -import { Duration } from '../../components/duration.js'; -import { EmptyState } from '../../components/empty-state.js'; -import { KindBadge } from '../../components/kind-badge.js'; -import { KpiTile } from '../../components/kpi-tile.js'; -import { exactListId, ListSearch, listSearchQuery } from '../../components/list-search.js'; -import { StatusBadge } from '../../components/status-badge.js'; -import { TileRow } from '../../components/tile-row.js'; -import { EntityPreviewService } from '../../core/entity-preview.js'; -import { injectListLoader } from '../../core/list-loader.js'; -import { ListStateService } from '../../core/list-state.js'; -import { QueryStateService } from '../../core/query-state.js'; -import { injectRankedSortLimits, rankedSortReasons } from '../../core/ranked-sort.js'; -import { resolveRange } from '../../core/relative-time.js'; -import { INFO_TEXTS } from '../../format/info-texts.js'; +import { KindBadge } from '../../components/badges/kind-badge.js'; +import { StatusBadge } from '../../components/badges/status-badge.js'; +import { CopyButton } from '../../components/copy-button/copy-button.js'; +import { CursorPaginator } from '../../components/data-table/cursor-paginator.js'; +import { DataTable, type SortChange, TableCell, type TableColumn } from '../../components/data-table/data-table.js'; +import { RangePickerService } from '../../components/date-time-range-picker/date-time-range-picker.js'; +import { Duration } from '../../components/duration/duration.js'; +import { EmptyState } from '../../components/feedback/empty-state.js'; +import { exactListId, ListSearch, listSearchQuery } from '../../components/search/list-search.js'; +import { KpiTile } from '../../components/tiles/kpi-tile.js'; +import { TileRow } from '../../components/tiles/tile-row.js'; +import { injectListLoader } from '../../core/refresh/list-loader.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { QueryStateService } from '../../core/state/query-state.js'; +import { injectRankedSortLimits, rankedSortReasons } from '../../core/state/ranked-sort.js'; +import { resolveRange } from '../../core/state/relative-time.js'; import { formatDuration, formatNumber, formatTimestamp } from '../../format/formatters.js'; +import { INFO_TEXTS } from '../../format/info-texts.js'; import { INGRESS_INPUT_LABELS, INGRESS_STATUS_LABELS } from '../../format/labels.js'; import { IngressDataService, type IngressListRequest } from './ingress-data.js'; import { ingressPreview } from './ingress-display.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/login-page.html b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/login/login-page.html similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/login-page.html rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/login/login-page.html diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/login-page.scss b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/login/login-page.scss similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/login-page.scss rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/login/login-page.scss diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/login/login-page.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/login/login-page.spec.ts new file mode 100644 index 000000000..75c7917bd --- /dev/null +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/login/login-page.spec.ts @@ -0,0 +1,191 @@ +import { HttpHeaders, provideHttpClient } from '@angular/common/http'; +import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { TestBed } from '@angular/core/testing'; +import { provideRouter, Router } from '@angular/router'; +import { RouterTestingHarness } from '@angular/router/testing'; +import { afterEach, describe, expect, it, vi } from 'vitest'; + +import { infoResponse, settle, signIn } from '../../../testing/fixtures.js'; +import { routeElement } from '../../../testing/harness.js'; +import { AuthService, safeRedirect } from '../../core/auth/auth.js'; +import { InfoService } from '../../core/info.js'; +import { ToastService } from '../../core/ui/toast.js'; +import { DASHBOARD_ROUTES } from '../../routes.js'; +import { composeRoutes } from '../../routing/compose-routes.js'; + +function setup(): HttpTestingController { + TestBed.configureTestingModule({ + providers: [ + provideRouter(composeRoutes(DASHBOARD_ROUTES)), + provideHttpClient(), + provideHttpClientTesting(), + { provide: ToastService, useValue: { show: vi.fn() } } + ] + }); + + return TestBed.inject(HttpTestingController); +} + +function url(): string { + return TestBed.inject(Router).url; +} + +describe('safeRedirect', () => { + it.each([ + ['/rooms?status=active', '/rooms?status=active'], + ['https://evil.example', null], + ['//evil.example', null], + ['/login?redirect=/x', null], + [null, null] + ])('accepts %j as %j', (value, expected) => { + expect(safeRedirect(value)).toBe(expected); + }); +}); + +describe('LoginPage', () => { + afterEach(() => { + vi.useRealTimers(); + }); + + async function open(path: string): Promise<{ harness: RouterTestingHarness; http: HttpTestingController }> { + const http = setup(); + const harness = await RouterTestingHarness.create(path); + + return { harness, http }; + } + + function fill(harness: RouterTestingHarness, username: string, password: string): void { + const [user, pass] = [...routeElement(harness).querySelectorAll('input')]; + + for (const [input, value] of [ + [user, username], + [pass, password] + ] as const) { + if (input !== undefined) { + input.value = value; + input.dispatchEvent(new Event('input')); + } + } + } + + function submit(harness: RouterTestingHarness): void { + routeElement(harness) + .querySelector('form') + ?.dispatchEvent(new Event('submit', { cancelable: true })); + } + + it('signs in and lands on the redirect target', async () => { + const { harness, http } = await open('/login?redirect=%2Frooms%3Fstatus%3Dactive'); + + fill(harness, 'admin', 'secret'); + submit(harness); + await settle(); + http.expectOne('api/v1/auth/login').flush({ accessToken: 'token', expiresAt: '2026-10-14T00:15:00.000Z' }); + await settle(); + http.expectOne('api/v1/info').flush(infoResponse()); + await settle(); + await harness.fixture.whenStable(); + + expect(url().startsWith('/rooms?status=active')).toBe(true); + }); + + it('clears the password and focuses the username on invalid credentials', async () => { + const { harness, http } = await open('/login'); + + fill(harness, 'admin', 'wrong'); + submit(harness); + await settle(); + http.expectOne('api/v1/auth/login').flush( + { error: { code: 'INVALID_CREDENTIALS', message: 'no' } }, + { status: 401, statusText: 'x' } + ); + await settle(); + await harness.fixture.whenStable(); + + const element = routeElement(harness); + const [user, pass] = [...element.querySelectorAll('input')]; + + expect(element.querySelector('.message')?.textContent).toBe('Invalid username or password'); + expect(pass?.value).toBe(''); + expect(user?.value).toBe('admin'); + expect(document.activeElement).toBe(user); + }); + + it('counts down a rate limit and enables the form again at zero', async () => { + const { harness, http } = await open('/login'); + + vi.useFakeTimers(); + fill(harness, 'admin', 'wrong'); + submit(harness); + await vi.advanceTimersByTimeAsync(0); + http.expectOne('api/v1/auth/login').flush( + { error: { code: 'RATE_LIMITED', message: 'slow down' } }, + { status: 429, statusText: 'x', headers: new HttpHeaders({ 'Retry-After': '3' }) } + ); + await vi.advanceTimersByTimeAsync(0); + harness.fixture.detectChanges(); + + const element = routeElement(harness); + const button = element.querySelector('button[type="submit"]'); + + expect(element.querySelector('.message')?.textContent).toBe('Too many attempts, try again in 3 s'); + expect(button?.disabled).toBe(true); + + await vi.advanceTimersByTimeAsync(1000); + harness.fixture.detectChanges(); + expect(element.querySelector('.message')?.textContent).toBe('Too many attempts, try again in 2 s'); + + await vi.advanceTimersByTimeAsync(2000); + harness.fixture.detectChanges(); + expect(element.querySelector('.message')?.textContent).toBe(''); + expect(button?.disabled).toBe(false); + }); + + it('shows the unreachable banner with retry', async () => { + const { harness, http } = await open('/login'); + + fill(harness, 'admin', 'secret'); + submit(harness); + await settle(); + http.expectOne('api/v1/auth/login').error(new ProgressEvent('error'), { status: 0 }); + await settle(); + await harness.fixture.whenStable(); + + expect(routeElement(harness).querySelector('.unreachable')?.textContent).toContain( + 'The server is unreachable.' + ); + }); + + it('sends a signed-in user to the redirect target', async () => { + const http = setup(); + + await signIn(TestBed.inject(AuthService), http); + await RouterTestingHarness.create('/login?redirect=%2Fsettings'); + + expect(url()).toBe('/settings'); + }); + + it('shows the edition and version of the public info before sign-in', async () => { + const http = setup(); + const load = TestBed.inject(InfoService).load(); + + http.expectOne('api/v1/info').flush({ edition: 'ce', versions: { dashboard: '3.10.0' } }); + await load; + + const harness = await RouterTestingHarness.create('/login'); + const footer = routeElement(harness).querySelector('footer')?.textContent ?? ''; + + expect(footer).toContain('CE'); + expect(footer).toContain('3.10.0'); + expect(footer).toContain('Documentation'); + }); + + it('requires both fields before calling the server', async () => { + const { harness, http } = await open('/login'); + + submit(harness); + await settle(); + + http.expectNone('api/v1/auth/login'); + }); +}); diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/login-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/login/login-page.ts similarity index 91% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/login-page.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/login/login-page.ts index 96806eab1..cce41fd91 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/login-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/login/login-page.ts @@ -7,12 +7,12 @@ import { MatIcon } from '@angular/material/icon'; import { MatInput } from '@angular/material/input'; import { ActivatedRoute, Router } from '@angular/router'; -import { toApiRequestError } from '../core/api-error.js'; -import { AuthService, safeRedirect } from '../core/auth.js'; -import { InfoService } from '../core/info.js'; -import { EXTERNAL_LINKS } from '../core/links.js'; -import { PRODUCT_NAME } from '../core/providers.js'; -import { ExternalLink } from '../components/external-link.js'; +import { ExternalLink } from '../../components/external-link/external-link.js'; +import { AuthService, safeRedirect } from '../../core/auth/auth.js'; +import { toApiRequestError } from '../../core/http/api-error.js'; +import { InfoService } from '../../core/info.js'; +import { EXTERNAL_LINKS } from '../../core/links.js'; +import { PRODUCT_NAME } from '../../core/providers.js'; /** Wait after a `429` without `Retry-After`. */ const DEFAULT_RETRY_SECONDS = 60; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-data.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-data.ts index 784990739..00ea58ef8 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-data.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-data.ts @@ -1,10 +1,10 @@ import { effect, inject, InjectionToken, Service, signal, type Type, untracked } from '@angular/core'; import type { OverviewResponse } from '@openvidu-dashboard/typings'; -import { HttpService } from '../../core/http.js'; -import { LiveCountersService } from '../../core/live-counters.js'; -import { QueryStateService } from '../../core/query-state.js'; -import { injectRefreshScheduler, type RefreshScheduler } from '../../core/refresh.js'; +import { HttpService } from '../../core/http/http.js'; +import { LiveCountersService } from '../../core/refresh/live-counters.js'; +import { injectRefreshScheduler, type RefreshScheduler } from '../../core/refresh/refresh.js'; +import { QueryStateService } from '../../core/state/query-state.js'; /** The last overview body and when the browser received and last confirmed it. */ export interface OverviewSnapshot { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-page.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-page.spec.ts index 6dac121c6..64ec09d88 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-page.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-page.spec.ts @@ -10,9 +10,9 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { infoResponse, settle } from '../../../testing/fixtures.js'; import { routeElement } from '../../../testing/harness.js'; import { InfoService } from '../../core/info.js'; -import { LiveCountersService } from '../../core/live-counters.js'; -import { PreferencesService } from '../../core/preferences.js'; -import { ServerStatusService } from '../../core/server-status.js'; +import { PreferencesService } from '../../core/preferences/preferences.js'; +import { LiveCountersService } from '../../core/refresh/live-counters.js'; +import { ServerStatusService } from '../../core/refresh/server-status.js'; import { OverviewPage } from './overview-page.js'; @Component({ selector: 'ovd-blank', template: '' }) diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-page.ts index 1abb6cb7d..ca0cb5bb6 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/overview/overview-page.ts @@ -5,24 +5,24 @@ import { MatProgressBar } from '@angular/material/progress-bar'; import { RouterLink } from '@angular/router'; import type { OverviewRecentRoom, StatusWriter } from '@openvidu-dashboard/typings'; -import { CopyButton } from '../../components/copy-button.js'; -import { DataTable, TableCell, type TableColumn } from '../../components/data-table.js'; -import { Duration } from '../../components/duration.js'; -import { EmptyState } from '../../components/empty-state.js'; -import { ErrorBanner } from '../../components/error-banner.js'; -import { FeatureContent, FeatureGate } from '../../components/feature-gate.js'; +import { LiveChip } from '../../components/badges/live-chip.js'; +import { StatusBadge } from '../../components/badges/status-badge.js'; +import { CopyButton } from '../../components/copy-button/copy-button.js'; +import { DataTable, TableCell, type TableColumn } from '../../components/data-table/data-table.js'; +import { Duration } from '../../components/duration/duration.js'; +import { EmptyState } from '../../components/feedback/empty-state.js'; +import { ErrorBanner } from '../../components/feedback/error-banner.js'; +import { Notice } from '../../components/feedback/notice.js'; +import { Skeleton } from '../../components/feedback/skeleton.js'; +import { FeatureContent, FeatureGate } from '../../components/lock/feature-gate.js'; +import { KpiTile } from '../../components/tiles/kpi-tile.js'; +import { SectionCard } from '../../components/tiles/section-card.js'; +import { TileRow } from '../../components/tiles/tile-row.js'; import { FeatureService } from '../../core/info.js'; -import { KpiTile } from '../../components/kpi-tile.js'; -import { LiveChip } from '../../components/live-chip.js'; -import { Notice } from '../../components/notice.js'; -import { SectionCard } from '../../components/section-card.js'; -import { Skeleton } from '../../components/skeleton.js'; -import { StatusBadge } from '../../components/status-badge.js'; -import { TileRow } from '../../components/tile-row.js'; -import { QueryStateService } from '../../core/query-state.js'; -import { injectRefreshScheduler } from '../../core/refresh.js'; -import { ServerStatusService } from '../../core/server-status.js'; -import { injectTicker } from '../../core/ticker.js'; +import { injectRefreshScheduler } from '../../core/refresh/refresh.js'; +import { ServerStatusService } from '../../core/refresh/server-status.js'; +import { injectTicker } from '../../core/refresh/ticker.js'; +import { QueryStateService } from '../../core/state/query-state.js'; import { formatNumber, formatTimestamp } from '../../format/formatters.js'; import { INFO_TEXTS } from '../../format/info-texts.js'; import { RECONCILER_ESTIMATE } from '../../format/labels.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participant-display.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participant-display.ts index c53256187..cd0b3e654 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participant-display.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participant-display.ts @@ -8,8 +8,8 @@ import { VISIBLE_PARTICIPANT_KINDS } from '@openvidu-dashboard/typings'; -import { SOURCE_LABELS } from '../../components/source-icon.js'; -import type { EntityPreview } from '../../core/entity-preview.js'; +import { SOURCE_LABELS } from '../../components/badges/source-icon.js'; +import type { EntityPreview } from '../../core/state/entity-preview.js'; import { PARTICIPANT_KIND_LABELS } from '../../format/labels.js'; export function isParticipantSid(value: string): boolean { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participant-locked-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participant-locked-page.ts index e324cd3c5..fbdcb68c8 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participant-locked-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participant-locked-page.ts @@ -1,9 +1,9 @@ import { Component, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { EntityPreviewService } from '../../core/entity-preview.js'; -import { ListStateService } from '../../core/list-state.js'; -import { LockedPage } from '../../pages/locked-page.js'; +import { LockedPage } from '../../components/lock/locked-page.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; import { isParticipantSid, participantPreview } from './participant-display.js'; import { ParticipantsDataService } from './participants-data.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-data.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-data.ts index 5db666f54..0eba8c3ac 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-data.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-data.ts @@ -9,8 +9,8 @@ import type { SortOrder } from '@openvidu-dashboard/typings'; -import { HttpService, type QueryValue } from '../../core/http.js'; -import type { RangeParams } from '../../core/query-state.js'; +import { HttpService, type QueryValue } from '../../core/http/http.js'; +import type { RangeParams } from '../../core/state/query-state.js'; import { apiRange } from '../rooms/rooms-data.js'; export interface ParticipantsListRequest { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-page.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-page.spec.ts index dbb73662d..6f57377cb 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-page.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-page.spec.ts @@ -9,9 +9,9 @@ import { describe, expect, it, vi } from 'vitest'; import { infoResponse, settle } from '../../../testing/fixtures.js'; import { routeElement } from '../../../testing/harness.js'; -import { LIST_SEARCH_DEBOUNCE_MS } from '../../components/list-search.js'; -import { EntityPreviewService } from '../../core/entity-preview.js'; +import { LIST_SEARCH_DEBOUNCE_MS } from '../../components/search/list-search.js'; import { InfoService } from '../../core/info.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; import { ParticipantLockedPage } from './participant-locked-page.js'; import { ParticipantsPage } from './participants-page.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-page.ts index 415900338..ab7a9d16e 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/participants/participants-page.ts @@ -15,27 +15,27 @@ import { VISIBLE_PARTICIPANT_KINDS } from '@openvidu-dashboard/typings'; -import { CopyButton } from '../../components/copy-button.js'; -import { CursorPaginator } from '../../components/cursor-paginator.js'; -import { DataTable, type SortChange, TableCell, type TableColumn } from '../../components/data-table.js'; -import { RangePickerService } from '../../components/date-time-range-picker.js'; -import { Duration } from '../../components/duration.js'; -import { EmptyState } from '../../components/empty-state.js'; -import { KindBadge } from '../../components/kind-badge.js'; -import { KpiTile } from '../../components/kpi-tile.js'; -import { exactListId, ListSearch, listSearchQuery } from '../../components/list-search.js'; -import { RoomChip } from '../../components/room-chip.js'; -import { SourceIcon } from '../../components/source-icon.js'; -import { StatusBadge } from '../../components/status-badge.js'; -import { TileRow } from '../../components/tile-row.js'; -import { EntityPreviewService } from '../../core/entity-preview.js'; -import { injectListLoader } from '../../core/list-loader.js'; -import { ListStateService } from '../../core/list-state.js'; -import { QueryStateService } from '../../core/query-state.js'; -import { injectRankedSortLimits, rankedSortReasons } from '../../core/ranked-sort.js'; -import { resolveRange } from '../../core/relative-time.js'; -import { INFO_TEXTS } from '../../format/info-texts.js'; +import { KindBadge } from '../../components/badges/kind-badge.js'; +import { RoomChip } from '../../components/badges/room-chip.js'; +import { SourceIcon } from '../../components/badges/source-icon.js'; +import { StatusBadge } from '../../components/badges/status-badge.js'; +import { CopyButton } from '../../components/copy-button/copy-button.js'; +import { CursorPaginator } from '../../components/data-table/cursor-paginator.js'; +import { DataTable, type SortChange, TableCell, type TableColumn } from '../../components/data-table/data-table.js'; +import { RangePickerService } from '../../components/date-time-range-picker/date-time-range-picker.js'; +import { Duration } from '../../components/duration/duration.js'; +import { EmptyState } from '../../components/feedback/empty-state.js'; +import { exactListId, ListSearch, listSearchQuery } from '../../components/search/list-search.js'; +import { KpiTile } from '../../components/tiles/kpi-tile.js'; +import { TileRow } from '../../components/tiles/tile-row.js'; +import { injectListLoader } from '../../core/refresh/list-loader.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { QueryStateService } from '../../core/state/query-state.js'; +import { injectRankedSortLimits, rankedSortReasons } from '../../core/state/ranked-sort.js'; +import { resolveRange } from '../../core/state/relative-time.js'; import { formatNumber, formatTimestamp } from '../../format/formatters.js'; +import { INFO_TEXTS } from '../../format/info-texts.js'; import { PARTICIPANT_KIND_LABELS } from '../../format/labels.js'; import { isRoomSid } from '../rooms/room-display.js'; import { kindFilter, kindParam, participantPreview, servicesHint } from './participant-display.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/room-display.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/room-display.ts index 4855b7257..9c31744c5 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/room-display.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/room-display.ts @@ -1,6 +1,6 @@ import { type ByteTotals, isEntityId, type RoomFeature, type RoomListItem } from '@openvidu-dashboard/typings'; -import type { EntityPreview } from '../../core/entity-preview.js'; +import type { EntityPreview } from '../../core/state/entity-preview.js'; import { formatBytes } from '../../format/formatters.js'; /** Feature flags in display order, with the letter of their badge; SIP is not offered while OpenVidu does not use it. */ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/room-locked-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/room-locked-page.ts index 6c7711662..d9938b56f 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/room-locked-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/room-locked-page.ts @@ -2,9 +2,9 @@ import { Component, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { RoomSort, RoomStatusFilter } from '@openvidu-dashboard/typings'; -import { EntityPreviewService } from '../../core/entity-preview.js'; -import { ListStateService } from '../../core/list-state.js'; -import { LockedPage } from '../../pages/locked-page.js'; +import { LockedPage } from '../../components/lock/locked-page.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; import { isRoomSid, roomPreview } from './room-display.js'; import { RoomsDataService } from './rooms-data.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-data.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-data.ts index c477a2757..6dffae98b 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-data.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-data.ts @@ -9,9 +9,9 @@ import type { SortOrder } from '@openvidu-dashboard/typings'; -import { HttpService, type QueryValue } from '../../core/http.js'; -import type { RangeParams } from '../../core/query-state.js'; -import { resolveRange } from '../../core/relative-time.js'; +import { HttpService, type QueryValue } from '../../core/http/http.js'; +import type { RangeParams } from '../../core/state/query-state.js'; +import { resolveRange } from '../../core/state/relative-time.js'; /** Loads the Node select of the Rooms filter bar, shown with `per-node-breakdown`; CE renders the locked select. */ export const ROOMS_NODE_FILTER = new InjectionToken<(() => Promise>) | null>('ROOMS_NODE_FILTER', { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-page.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-page.spec.ts index ae08f1248..b5b6bbbbb 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-page.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-page.spec.ts @@ -9,11 +9,11 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; import { infoResponse, settle } from '../../../testing/fixtures.js'; import { routeElement } from '../../../testing/harness.js'; -import { RangePickerService } from '../../components/date-time-range-picker.js'; -import { LIST_SEARCH_DEBOUNCE_MS } from '../../components/list-search.js'; -import { EntityPreviewService } from '../../core/entity-preview.js'; +import { RangePickerService } from '../../components/date-time-range-picker/date-time-range-picker.js'; +import { LIST_SEARCH_DEBOUNCE_MS } from '../../components/search/list-search.js'; import { InfoService } from '../../core/info.js'; -import { PreferencesService } from '../../core/preferences.js'; +import { PreferencesService } from '../../core/preferences/preferences.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; import { RoomLockedPage } from './room-locked-page.js'; import { ROOMS_NODE_FILTER } from './rooms-data.js'; import { RoomsPage } from './rooms-page.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-page.ts index 23ce3dd56..5400a5cd6 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/rooms/rooms-page.ts @@ -16,26 +16,26 @@ import { type RoomSummary } from '@openvidu-dashboard/typings'; -import { CopyButton } from '../../components/copy-button.js'; -import { CursorPaginator } from '../../components/cursor-paginator.js'; -import { type SortChange, type TableColumn, DataTable, TableCell } from '../../components/data-table.js'; -import { RangePickerService } from '../../components/date-time-range-picker.js'; -import { Duration } from '../../components/duration.js'; -import { EmptyState } from '../../components/empty-state.js'; -import { KpiTile } from '../../components/kpi-tile.js'; -import { exactListId, ListSearch, listSearchQuery } from '../../components/list-search.js'; -import { StatusBadge } from '../../components/status-badge.js'; -import { TileRow } from '../../components/tile-row.js'; -import { EntityPreviewService } from '../../core/entity-preview.js'; +import { StatusBadge } from '../../components/badges/status-badge.js'; +import { CopyButton } from '../../components/copy-button/copy-button.js'; +import { CursorPaginator } from '../../components/data-table/cursor-paginator.js'; +import { type SortChange, type TableColumn, DataTable, TableCell } from '../../components/data-table/data-table.js'; +import { RangePickerService } from '../../components/date-time-range-picker/date-time-range-picker.js'; +import { Duration } from '../../components/duration/duration.js'; +import { EmptyState } from '../../components/feedback/empty-state.js'; +import { exactListId, ListSearch, listSearchQuery } from '../../components/search/list-search.js'; +import { KpiTile } from '../../components/tiles/kpi-tile.js'; +import { TileRow } from '../../components/tiles/tile-row.js'; import { FeatureService } from '../../core/info.js'; -import { injectListLoader, type ListLoader } from '../../core/list-loader.js'; -import { ListStateService } from '../../core/list-state.js'; -import { QueryStateService } from '../../core/query-state.js'; -import { injectRankedSortLimits, rankedSortReasons } from '../../core/ranked-sort.js'; -import { resolveRange } from '../../core/relative-time.js'; -import { injectTicker } from '../../core/ticker.js'; -import { INFO_TEXTS } from '../../format/info-texts.js'; +import { injectListLoader, type ListLoader } from '../../core/refresh/list-loader.js'; +import { injectTicker } from '../../core/refresh/ticker.js'; +import { EntityPreviewService } from '../../core/state/entity-preview.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { QueryStateService } from '../../core/state/query-state.js'; +import { injectRankedSortLimits, rankedSortReasons } from '../../core/state/ranked-sort.js'; +import { resolveRange } from '../../core/state/relative-time.js'; import { formatNumber, formatTimestamp } from '../../format/formatters.js'; +import { INFO_TEXTS } from '../../format/info-texts.js'; import { RECONCILER_ESTIMATE } from '../../format/labels.js'; import { formatBandwidth, ROOM_FEATURES, roomPreview } from './room-display.js'; import { ROOMS_NODE_FILTER, RoomsDataService, type RoomsListRequest } from './rooms-data.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/about-tab.html b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/about-tab.html similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/about-tab.html rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/about-tab.html diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/about-tab.scss b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/about-tab.scss similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/about-tab.scss rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/about-tab.scss diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/about-tab.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/about-tab.ts similarity index 90% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/about-tab.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/about-tab.ts index 39ece7e48..7334b8190 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/about-tab.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/about-tab.ts @@ -2,13 +2,13 @@ import { Component, computed, effect, inject, signal } from '@angular/core'; import { MatProgressBar } from '@angular/material/progress-bar'; import { formatRetentionLength, type InfoMigration, type InfoRetention } from '@openvidu-dashboard/typings'; -import { Notice } from '../components/notice.js'; -import { Skeleton } from '../components/skeleton.js'; -import { InfoService } from '../core/info.js'; -import { QueryStateService } from '../core/query-state.js'; -import { ServerStatusService } from '../core/server-status.js'; -import { formatBytes, formatNumber, formatTimestamp } from '../format/formatters.js'; -import { EditionBadge } from '../shell/edition-badge.js'; +import { Notice } from '../../components/feedback/notice.js'; +import { Skeleton } from '../../components/feedback/skeleton.js'; +import { InfoService } from '../../core/info.js'; +import { ServerStatusService } from '../../core/refresh/server-status.js'; +import { QueryStateService } from '../../core/state/query-state.js'; +import { formatBytes, formatNumber, formatTimestamp } from '../../format/formatters.js'; +import { EditionBadge } from '../../shell/edition-badge.js'; /** `7 days`, `36 hours`, `Kept forever` for a retention without limit. */ export function formatRetention(ms: number | null): string { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/preferences-tab.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/preferences-tab.ts similarity index 91% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/preferences-tab.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/preferences-tab.ts index 0ed206e4d..0a25bed66 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/preferences-tab.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/preferences-tab.ts @@ -15,12 +15,12 @@ import { type TimeZonePreference } from '@openvidu-dashboard/typings'; -import { browserTimeZone, PreferencesService } from '../core/preferences.js'; -import { SessionZoneService } from '../core/session-zone.js'; -import { ToastService } from '../core/toast.js'; -import { RANGE_PRESET_LABELS } from '../components/date-time-range-picker.js'; -import { REFRESH_LABELS } from '../components/refresh-control.js'; -import { ZoneSelect } from '../components/zone-select.js'; +import { RANGE_PRESET_LABELS } from '../../components/date-time-range-picker/date-time-range-picker.js'; +import { REFRESH_LABELS } from '../../components/refresh-control/refresh-control.js'; +import { ZoneSelect } from '../../components/zone/zone-select.js'; +import { browserTimeZone, PreferencesService } from '../../core/preferences/preferences.js'; +import { SessionZoneService } from '../../core/state/session-zone.js'; +import { ToastService } from '../../core/ui/toast.js'; /** Viewer preferences, saved on every change with a "Saved" toast. */ @Component({ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/pages.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/settings-page.spec.ts similarity index 60% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/pages.spec.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/settings-page.spec.ts index fec809632..be93a8ac3 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/pages.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/settings-page.spec.ts @@ -1,22 +1,20 @@ -import { HttpHeaders, provideHttpClient } from '@angular/common/http'; +import { provideHttpClient } from '@angular/common/http'; import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { provideRouter, Router } from '@angular/router'; import { RouterTestingHarness } from '@angular/router/testing'; import type { InfoResponse, StatusResponse } from '@openvidu-dashboard/typings'; -import { afterEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; -import { infoResponse, settle, signIn, statusResponse } from '../../testing/fixtures.js'; -import { routeElement } from '../../testing/harness.js'; -import { AuthService, safeRedirect } from '../core/auth.js'; -import { EntityPreviewService } from '../core/entity-preview.js'; -import { InfoService } from '../core/info.js'; -import { browserTimeZone, PREFERENCES_KEY, PreferencesService } from '../core/preferences.js'; -import { ServerStatusService } from '../core/server-status.js'; -import { SessionZoneService } from '../core/session-zone.js'; -import { ToastService } from '../core/toast.js'; -import { composeRoutes } from '../routing/compose-routes.js'; -import { DASHBOARD_ROUTES } from '../routes.js'; +import { infoResponse, signIn, statusResponse } from '../../../testing/fixtures.js'; +import { AuthService } from '../../core/auth/auth.js'; +import { InfoService } from '../../core/info.js'; +import { browserTimeZone, PREFERENCES_KEY, PreferencesService } from '../../core/preferences/preferences.js'; +import { ServerStatusService } from '../../core/refresh/server-status.js'; +import { SessionZoneService } from '../../core/state/session-zone.js'; +import { ToastService } from '../../core/ui/toast.js'; +import { DASHBOARD_ROUTES } from '../../routes.js'; +import { composeRoutes } from '../../routing/compose-routes.js'; import { formatRetention, migrationLine, retentionRows } from './about-tab.js'; function setup(): HttpTestingController { @@ -50,166 +48,6 @@ function url(): string { return TestBed.inject(Router).url; } -describe('safeRedirect', () => { - it.each([ - ['/rooms?status=active', '/rooms?status=active'], - ['https://evil.example', null], - ['//evil.example', null], - ['/login?redirect=/x', null], - [null, null] - ])('accepts %j as %j', (value, expected) => { - expect(safeRedirect(value)).toBe(expected); - }); -}); - -describe('LoginPage', () => { - afterEach(() => { - vi.useRealTimers(); - }); - - async function open(path: string): Promise<{ harness: RouterTestingHarness; http: HttpTestingController }> { - const http = setup(); - const harness = await RouterTestingHarness.create(path); - - return { harness, http }; - } - - function fill(harness: RouterTestingHarness, username: string, password: string): void { - const [user, pass] = [...routeElement(harness).querySelectorAll('input')]; - - for (const [input, value] of [ - [user, username], - [pass, password] - ] as const) { - if (input !== undefined) { - input.value = value; - input.dispatchEvent(new Event('input')); - } - } - } - - function submit(harness: RouterTestingHarness): void { - routeElement(harness) - .querySelector('form') - ?.dispatchEvent(new Event('submit', { cancelable: true })); - } - - it('signs in and lands on the redirect target', async () => { - const { harness, http } = await open('/login?redirect=%2Frooms%3Fstatus%3Dactive'); - - fill(harness, 'admin', 'secret'); - submit(harness); - await settle(); - http.expectOne('api/v1/auth/login').flush({ accessToken: 'token', expiresAt: '2026-10-14T00:15:00.000Z' }); - await settle(); - http.expectOne('api/v1/info').flush(infoResponse()); - await settle(); - await harness.fixture.whenStable(); - - expect(url().startsWith('/rooms?status=active')).toBe(true); - }); - - it('clears the password and focuses the username on invalid credentials', async () => { - const { harness, http } = await open('/login'); - - fill(harness, 'admin', 'wrong'); - submit(harness); - await settle(); - http.expectOne('api/v1/auth/login').flush( - { error: { code: 'INVALID_CREDENTIALS', message: 'no' } }, - { status: 401, statusText: 'x' } - ); - await settle(); - await harness.fixture.whenStable(); - - const element = routeElement(harness); - const [user, pass] = [...element.querySelectorAll('input')]; - - expect(element.querySelector('.message')?.textContent).toBe('Invalid username or password'); - expect(pass?.value).toBe(''); - expect(user?.value).toBe('admin'); - expect(document.activeElement).toBe(user); - }); - - it('counts down a rate limit and enables the form again at zero', async () => { - const { harness, http } = await open('/login'); - - vi.useFakeTimers(); - fill(harness, 'admin', 'wrong'); - submit(harness); - await vi.advanceTimersByTimeAsync(0); - http.expectOne('api/v1/auth/login').flush( - { error: { code: 'RATE_LIMITED', message: 'slow down' } }, - { status: 429, statusText: 'x', headers: new HttpHeaders({ 'Retry-After': '3' }) } - ); - await vi.advanceTimersByTimeAsync(0); - harness.fixture.detectChanges(); - - const element = routeElement(harness); - const button = element.querySelector('button[type="submit"]'); - - expect(element.querySelector('.message')?.textContent).toBe('Too many attempts, try again in 3 s'); - expect(button?.disabled).toBe(true); - - await vi.advanceTimersByTimeAsync(1000); - harness.fixture.detectChanges(); - expect(element.querySelector('.message')?.textContent).toBe('Too many attempts, try again in 2 s'); - - await vi.advanceTimersByTimeAsync(2000); - harness.fixture.detectChanges(); - expect(element.querySelector('.message')?.textContent).toBe(''); - expect(button?.disabled).toBe(false); - }); - - it('shows the unreachable banner with retry', async () => { - const { harness, http } = await open('/login'); - - fill(harness, 'admin', 'secret'); - submit(harness); - await settle(); - http.expectOne('api/v1/auth/login').error(new ProgressEvent('error'), { status: 0 }); - await settle(); - await harness.fixture.whenStable(); - - expect(routeElement(harness).querySelector('.unreachable')?.textContent).toContain( - 'The server is unreachable.' - ); - }); - - it('sends a signed-in user to the redirect target', async () => { - const http = setup(); - - await signIn(TestBed.inject(AuthService), http); - await RouterTestingHarness.create('/login?redirect=%2Fsettings'); - - expect(url()).toBe('/settings'); - }); - - it('shows the edition and version of the public info before sign-in', async () => { - const http = setup(); - const load = TestBed.inject(InfoService).load(); - - http.expectOne('api/v1/info').flush({ edition: 'ce', versions: { dashboard: '3.10.0' } }); - await load; - - const harness = await RouterTestingHarness.create('/login'); - const footer = routeElement(harness).querySelector('footer')?.textContent ?? ''; - - expect(footer).toContain('CE'); - expect(footer).toContain('3.10.0'); - expect(footer).toContain('Documentation'); - }); - - it('requires both fields before calling the server', async () => { - const { harness, http } = await open('/login'); - - submit(harness); - await settle(); - - http.expectNone('api/v1/auth/login'); - }); -}); - describe('About helpers', () => { it('lists the default retention per data class', () => { expect( @@ -473,44 +311,3 @@ describe('SettingsPage', () => { localStorage.removeItem(PREFERENCES_KEY); }); }); - -describe('LockedPage', () => { - it('shows the entity header from list data, the lock and a link back to the list with the range', async () => { - const http = setup(); - - await signIn(TestBed.inject(AuthService), http); - await loadInfo(http, infoResponse()); - TestBed.inject(EntityPreviewService).set('room', 'RM_ab12cd', { - name: 'demo-room', - status: 'active', - startedAt: '2026-10-13T12:31:05Z' - }); - - const harness = await RouterTestingHarness.create('/rooms?from=now-6h&to=now&tz=UTC'); - - await settle(); - - for (const request of http.match((req) => req.url.startsWith('api/v1/rooms'))) { - request.flush({}); - } - - await harness.navigateByUrl('/rooms/RM_ab12cd'); - - const element = harness.fixture.nativeElement as HTMLElement; - - expect(element.querySelector('h1')?.textContent).toBe('demo-room'); - expect(element.querySelector('ovd-locked-page .title ovd-copy-button button')?.getAttribute('aria-label')).toBe( - 'Copy room name' - ); - expect(element.querySelector('ovd-locked-page ovd-copy-chip')).toBeNull(); - expect(element.querySelector('ovd-locked-page ovd-status-badge')?.textContent).toContain('active'); - expect(element.querySelector('ovd-pro-lock-overlay')?.textContent).toContain( - 'Room detail is available in OpenVidu PRO' - ); - expect(element.querySelector('ovd-pro-lock-overlay a[href^="/rooms"]')?.getAttribute('href')).toBe( - '/rooms?from=now-6h&to=now&tz=UTC' - ); - http.expectOne('api/v1/status').flush(statusResponse()); - http.verify(); - }); -}); diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/settings-page.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/settings-page.ts similarity index 95% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/settings-page.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/settings-page.ts index 8ac55cbfb..9130cb0a6 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/pages/settings-page.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/features/settings/settings-page.ts @@ -1,7 +1,7 @@ import { afterNextRender, Component, computed, ElementRef, inject } from '@angular/core'; import { MatTab, MatTabGroup } from '@angular/material/tabs'; -import { QueryStateService } from '../core/query-state.js'; +import { QueryStateService } from '../../core/state/query-state.js'; import { AboutTab } from './about-tab.js'; import { PreferencesTab } from './preferences-tab.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routes.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routes.ts index 428d6ba99..ce325624b 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routes.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routes.ts @@ -2,9 +2,9 @@ import { inject } from '@angular/core'; import { Router, type UrlSegment } from '@angular/router'; import type { NavigationMeta } from '@openvidu-dashboard/typings'; -import { authGuard, AuthService, loginGuard } from './core/auth.js'; +import { authGuard, AuthService, loginGuard } from './core/auth/auth.js'; import type { DashboardRoute } from './routing/compose-routes.js'; -import { DashboardShell } from './shell/dashboard-shell.js'; +import { DashboardShell } from './shell/dashboard-shell/dashboard-shell.js'; function navigation(meta: NavigationMeta): { navigation: NavigationMeta } { return { navigation: meta }; @@ -36,7 +36,7 @@ export const DASHBOARD_ROUTES: DashboardRoute[] = [ path: 'login', title: 'Sign in', canActivate: [loginGuard], - loadComponent: () => import('./pages/login-page.js').then((module) => module.LoginPage) + loadComponent: () => import('./features/login/login-page.js').then((module) => module.LoginPage) }, { path: '', @@ -226,7 +226,8 @@ export const DASHBOARD_ROUTES: DashboardRoute[] = [ { path: 'settings', title: 'Settings', - loadComponent: () => import('./pages/settings-page.js').then((module) => module.SettingsPage), + loadComponent: () => + import('./features/settings/settings-page.js').then((module) => module.SettingsPage), data: navigation({ label: 'Settings', icon: 'settings', diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/breadcrumbs.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/breadcrumbs.spec.ts index f4d3221f7..530128e49 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/breadcrumbs.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/breadcrumbs.spec.ts @@ -4,8 +4,8 @@ import { provideRouter } from '@angular/router'; import { RouterTestingHarness } from '@angular/router/testing'; import { beforeEach, describe, expect, it } from 'vitest'; -import { EntityPreviewService } from '../core/entity-preview.js'; -import { ListStateService } from '../core/list-state.js'; +import { EntityPreviewService } from '../core/state/entity-preview.js'; +import { ListStateService } from '../core/state/list-state.js'; import { BreadcrumbService } from './breadcrumbs.js'; import { composeRoutes } from './compose-routes.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/breadcrumbs.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/breadcrumbs.ts index 594a1b876..a7e852c33 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/breadcrumbs.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/breadcrumbs.ts @@ -1,8 +1,8 @@ import { computed, inject, Service, signal } from '@angular/core'; import type { ActivatedRouteSnapshot, Params } from '@angular/router'; -import { ListStateService } from '../core/list-state.js'; -import { ownData, RouteStateService } from '../core/route-state.js'; +import { ListStateService } from '../core/state/list-state.js'; +import { ownData, RouteStateService } from '../core/state/route-state.js'; export interface BreadcrumbItem { label: string; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/compose-routes.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/compose-routes.ts index 20b311a21..4383e0122 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/compose-routes.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/routing/compose-routes.ts @@ -1,7 +1,7 @@ import type { Route, Routes } from '@angular/router'; import type { NavigationMeta } from '@openvidu-dashboard/typings'; -import type { DashboardRouteData } from '../core/route-state.js'; +import type { DashboardRouteData } from '../core/state/route-state.js'; /** A route of the dashboard whose `data` follows `DashboardRouteData`. */ export type DashboardRoute = Omit & { diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/banner-slot.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/banner-slot.ts index f7b2101cf..84aabf9c8 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/banner-slot.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/banner-slot.ts @@ -3,9 +3,9 @@ import { MatButton, MatIconButton } from '@angular/material/button'; import { MatIcon } from '@angular/material/icon'; import { MatProgressBar } from '@angular/material/progress-bar'; -import { ConnectivityService } from '../core/connectivity.js'; +import { ConnectivityService } from '../core/http/connectivity.js'; import { InfoService } from '../core/info.js'; -import { ServerStatusService } from '../core/server-status.js'; +import { ServerStatusService } from '../core/refresh/server-status.js'; import { formatNumber } from '../format/formatters.js'; /** diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/breadcrumbs.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/breadcrumbs.ts similarity index 96% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/breadcrumbs.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/breadcrumbs.ts index 78adc94cd..82539b169 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/components/breadcrumbs.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/breadcrumbs.ts @@ -1,8 +1,8 @@ import { Component, computed, inject, input } from '@angular/core'; import { RouterLink } from '@angular/router'; +import { CopyButton } from '../components/copy-button/copy-button.js'; import { type BreadcrumbItem, BreadcrumbService } from '../routing/breadcrumbs.js'; -import { CopyButton } from './copy-button.js'; /** The crumb trail: links carry the current range, the current page is text with its copy button. */ @Component({ diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell.html b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell/dashboard-shell.html similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell.html rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell/dashboard-shell.html diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell.scss b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell/dashboard-shell.scss similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell.scss rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell/dashboard-shell.scss diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell/dashboard-shell.ts similarity index 73% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell/dashboard-shell.ts index 117a03638..8c40d073a 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/dashboard-shell/dashboard-shell.ts @@ -2,16 +2,16 @@ import { Component, computed, inject, signal } from '@angular/core'; import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { RouterOutlet } from '@angular/router'; -import { BreakpointService } from '../core/breakpoints.js'; -import { FocusService, MAIN_CONTENT_ID } from '../core/focus.js'; -import { ListStateService } from '../core/list-state.js'; -import { PreferencesService } from '../core/preferences.js'; -import { injectServerStatusPoll } from '../core/server-status.js'; -import { Breadcrumbs } from '../components/breadcrumbs.js'; -import { BannerSlot } from './banner-slot.js'; -import { Header } from './header.js'; -import { sidenavLayout } from './layout.js'; -import { NavigationList } from './navigation-list.js'; +import { PreferencesService } from '../../core/preferences/preferences.js'; +import { injectServerStatusPoll } from '../../core/refresh/server-status.js'; +import { ListStateService } from '../../core/state/list-state.js'; +import { BreakpointService } from '../../core/ui/breakpoints.js'; +import { FocusService, MAIN_CONTENT_ID } from '../../core/ui/focus.js'; +import { BannerSlot } from '../banner-slot.js'; +import { Breadcrumbs } from '../breadcrumbs.js'; +import { Header } from '../header/header.js'; +import { sidenavLayout } from '../layout.js'; +import { NavigationList } from '../navigation-list.js'; /** * The authenticated frame: skip link, header, banners, sidenav, breadcrumbs, the page and the footer. Shells project diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header.html b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header/header.html similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header.html rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header/header.html diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header.scss b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header/header.scss similarity index 100% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header.scss rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header/header.scss diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header/header.ts similarity index 79% rename from openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header.ts rename to openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header/header.ts index ba1fe16d3..31e95e777 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/header/header.ts @@ -7,18 +7,18 @@ import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; import { MatTooltip } from '@angular/material/tooltip'; import { RouterLink } from '@angular/router'; -import { AuthService } from '../core/auth.js'; -import { BreakpointService } from '../core/breakpoints.js'; -import { FeatureService, InfoService } from '../core/info.js'; -import { PRODUCT_NAME } from '../core/providers.js'; -import { RefreshRegistry } from '../core/refresh.js'; -import { RouteStateService } from '../core/route-state.js'; -import { ThemeService } from '../core/theme.js'; -import { DateTimeRangePicker } from '../components/date-time-range-picker.js'; -import { GlobalSearch } from '../components/global-search.js'; -import { RefreshControl } from '../components/refresh-control.js'; -import { ZoneChip } from '../components/zone-chip.js'; -import { THEME_ICONS, ThemeToggle } from './theme-toggle.js'; +import { DateTimeRangePicker } from '../../components/date-time-range-picker/date-time-range-picker.js'; +import { RefreshControl } from '../../components/refresh-control/refresh-control.js'; +import { GlobalSearch } from '../../components/search/global-search.js'; +import { ZoneChip } from '../../components/zone/zone-chip.js'; +import { AuthService } from '../../core/auth/auth.js'; +import { FeatureService, InfoService } from '../../core/info.js'; +import { ThemeService } from '../../core/preferences/theme.js'; +import { PRODUCT_NAME } from '../../core/providers.js'; +import { RefreshRegistry } from '../../core/refresh/refresh.js'; +import { RouteStateService } from '../../core/state/route-state.js'; +import { BreakpointService } from '../../core/ui/breakpoints.js'; +import { THEME_ICONS, ThemeToggle } from '../theme-toggle.js'; /** * Burger, logo, global search, range picker (range-scoped routes) or zone chip (other unlocked timed routes), refresh diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/layout.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/layout.ts index 713f56c07..7147aefa2 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/layout.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/layout.ts @@ -1,4 +1,4 @@ -import type { ScreenSize } from '../core/breakpoints.js'; +import type { ScreenSize } from '../core/ui/breakpoints.js'; export interface SidenavLayout { mode: 'side' | 'over'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/navigation-list.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/navigation-list.ts index 53949f2a6..b866ff07e 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/navigation-list.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/navigation-list.ts @@ -5,7 +5,7 @@ import { type IsActiveMatchOptions, Router, RouterLink, RouterLinkActive } from import type { NavigationMeta } from '@openvidu-dashboard/typings'; import { FeatureService } from '../core/info.js'; -import { ListStateService } from '../core/list-state.js'; +import { ListStateService } from '../core/state/list-state.js'; import { navigationEntries } from '../routing/compose-routes.js'; import { SidenavFooter } from './sidenav-footer.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/shell.spec.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/shell.spec.ts index 93722b34a..a4fa7787c 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/shell.spec.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/shell.spec.ts @@ -10,14 +10,14 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; import { infoResponse, signIn, statusResponse } from '../../testing/fixtures.js'; import { routeElement } from '../../testing/harness.js'; import { iconNames } from '../../testing/icons.js'; -import { AuthService } from '../core/auth.js'; -import { BreakpointService, type ScreenSize } from '../core/breakpoints.js'; -import { ConnectivityService } from '../core/connectivity.js'; +import { AuthService } from '../core/auth/auth.js'; +import { ConnectivityService } from '../core/http/connectivity.js'; import { InfoService } from '../core/info.js'; -import { PreferencesService } from '../core/preferences.js'; -import { ServerStatusService } from '../core/server-status.js'; -import { composeRoutes } from '../routing/compose-routes.js'; +import { PreferencesService } from '../core/preferences/preferences.js'; +import { ServerStatusService } from '../core/refresh/server-status.js'; +import { BreakpointService, type ScreenSize } from '../core/ui/breakpoints.js'; import { DASHBOARD_ROUTES } from '../routes.js'; +import { composeRoutes } from '../routing/compose-routes.js'; import { BannerSlot } from './banner-slot.js'; import { sidenavLayout } from './layout.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/sidenav-footer.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/sidenav-footer.ts index cb164753f..03e8dee54 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/sidenav-footer.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/sidenav-footer.ts @@ -3,7 +3,7 @@ import { MatIcon } from '@angular/material/icon'; import { MatTooltip } from '@angular/material/tooltip'; import { RouterLink } from '@angular/router'; -import { ExternalLink } from '../components/external-link.js'; +import { ExternalLink } from '../components/external-link/external-link.js'; import { InfoService } from '../core/info.js'; import { EXTERNAL_LINKS } from '../core/links.js'; import { EditionBadge } from './edition-badge.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/theme-toggle.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/theme-toggle.ts index 452ae3ca1..51957a8fd 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/theme-toggle.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/lib/shell/theme-toggle.ts @@ -4,7 +4,7 @@ import { MatIcon } from '@angular/material/icon'; import { MatTooltip } from '@angular/material/tooltip'; import type { ThemePreference } from '@openvidu-dashboard/typings'; -import { ThemeService } from '../core/theme.js'; +import { ThemeService } from '../core/preferences/theme.js'; export const THEME_ICONS: Readonly> = { system: 'brightness_auto', diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/public-api.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/public-api.ts index 10d96d91f..16272b065 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/public-api.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/public-api.ts @@ -4,62 +4,62 @@ export * from './lib/charts/breakdown-chart.js'; export * from './lib/charts/chart-colors.js'; export * from './lib/charts/chart-note.js'; export * from './lib/charts/chart-options.js'; -export * from './lib/charts/time-series-chart.js'; -export * from './lib/components/breadcrumbs.js'; -export * from './lib/components/copy-button.js'; -export * from './lib/components/cursor-paginator.js'; -export * from './lib/components/data-table.js'; -export * from './lib/components/duration.js'; -export * from './lib/components/date-time-range-picker.js'; -export * from './lib/components/empty-state.js'; -export * from './lib/components/error-banner.js'; -export * from './lib/components/external-link.js'; -export * from './lib/components/feature-gate.js'; -export * from './lib/components/features.js'; -export * from './lib/components/global-search.js'; -export * from './lib/components/info-tip.js'; -export * from './lib/components/kind-badge.js'; -export * from './lib/components/kpi-tile.js'; -export * from './lib/components/list-search.js'; -export * from './lib/components/live-chip.js'; -export * from './lib/components/notice.js'; -export * from './lib/components/pro-lock-overlay.js'; -export * from './lib/components/refresh-control.js'; -export * from './lib/components/room-chip.js'; -export * from './lib/components/section-card.js'; -export * from './lib/components/skeleton.js'; -export * from './lib/components/source-icon.js'; -export * from './lib/components/status-badge.js'; -export * from './lib/components/tile-row.js'; -export * from './lib/components/zone-chip.js'; -export * from './lib/components/zone-select.js'; -export * from './lib/core/api-error.js'; -export * from './lib/core/breakpoints.js'; -export * from './lib/core/clipboard.js'; -export * from './lib/core/connectivity.js'; -export * from './lib/core/entity-preview.js'; -export * from './lib/core/auth.js'; -export * from './lib/core/focus.js'; -export * from './lib/core/http.js'; +export * from './lib/charts/time-series-chart/time-series-chart.js'; +export * from './lib/shell/breadcrumbs.js'; +export * from './lib/components/copy-button/copy-button.js'; +export * from './lib/components/data-table/cursor-paginator.js'; +export * from './lib/components/data-table/data-table.js'; +export * from './lib/components/duration/duration.js'; +export * from './lib/components/date-time-range-picker/date-time-range-picker.js'; +export * from './lib/components/feedback/empty-state.js'; +export * from './lib/components/feedback/error-banner.js'; +export * from './lib/components/external-link/external-link.js'; +export * from './lib/components/lock/feature-gate.js'; +export * from './lib/components/lock/features.js'; +export * from './lib/components/search/global-search.js'; +export * from './lib/components/info-tip/info-tip.js'; +export * from './lib/components/badges/kind-badge.js'; +export * from './lib/components/tiles/kpi-tile.js'; +export * from './lib/components/search/list-search.js'; +export * from './lib/components/badges/live-chip.js'; +export * from './lib/components/feedback/notice.js'; +export * from './lib/components/lock/pro-lock-overlay.js'; +export * from './lib/components/refresh-control/refresh-control.js'; +export * from './lib/components/badges/room-chip.js'; +export * from './lib/components/tiles/section-card.js'; +export * from './lib/components/feedback/skeleton.js'; +export * from './lib/components/badges/source-icon.js'; +export * from './lib/components/badges/status-badge.js'; +export * from './lib/components/tiles/tile-row.js'; +export * from './lib/components/zone/zone-chip.js'; +export * from './lib/components/zone/zone-select.js'; +export * from './lib/core/http/api-error.js'; +export * from './lib/core/ui/breakpoints.js'; +export * from './lib/core/ui/clipboard.js'; +export * from './lib/core/http/connectivity.js'; +export * from './lib/core/state/entity-preview.js'; +export * from './lib/core/auth/auth.js'; +export * from './lib/core/ui/focus.js'; +export * from './lib/core/http/http.js'; export * from './lib/core/info.js'; export * from './lib/core/links.js'; -export * from './lib/core/list-loader.js'; -export * from './lib/core/list-state.js'; -export * from './lib/core/live-counters.js'; -export * from './lib/core/preferences.js'; +export * from './lib/core/refresh/list-loader.js'; +export * from './lib/core/state/list-state.js'; +export * from './lib/core/refresh/live-counters.js'; +export * from './lib/core/preferences/preferences.js'; export * from './lib/core/providers.js'; -export * from './lib/core/query-state.js'; -export * from './lib/core/ranked-sort.js'; -export * from './lib/core/refresh.js'; -export * from './lib/core/server-status.js'; -export * from './lib/core/session-zone.js'; -export * from './lib/core/relative-time.js'; -export * from './lib/core/route-state.js'; -export * from './lib/core/section-state.js'; -export * from './lib/core/storage.js'; -export * from './lib/core/theme.js'; -export * from './lib/core/ticker.js'; -export * from './lib/core/toast.js'; +export * from './lib/core/state/query-state.js'; +export * from './lib/core/state/ranked-sort.js'; +export * from './lib/core/refresh/refresh.js'; +export * from './lib/core/refresh/server-status.js'; +export * from './lib/core/state/session-zone.js'; +export * from './lib/core/state/relative-time.js'; +export * from './lib/core/state/route-state.js'; +export * from './lib/core/state/section-state.js'; +export * from './lib/core/preferences/storage.js'; +export * from './lib/core/preferences/theme.js'; +export * from './lib/core/refresh/ticker.js'; +export * from './lib/core/ui/toast.js'; export * from './lib/features/analytics/analytics-card.js'; export * from './lib/features/analytics/analytics-data.js'; export * from './lib/features/analytics/analytics-seams.js'; @@ -80,9 +80,9 @@ export * from './lib/routing/breadcrumbs.js'; export * from './lib/routing/compose-routes.js'; export * from './lib/routes.js'; export * from './lib/shell/banner-slot.js'; -export * from './lib/shell/dashboard-shell.js'; +export * from './lib/shell/dashboard-shell/dashboard-shell.js'; export * from './lib/shell/edition-badge.js'; -export * from './lib/shell/header.js'; +export * from './lib/shell/header/header.js'; export * from './lib/shell/layout.js'; export * from './lib/shell/navigation-list.js'; export * from './lib/shell/sidenav-footer.js'; diff --git a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/testing/analytics.ts b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/testing/analytics.ts index e1ee76164..a9057271c 100644 --- a/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/testing/analytics.ts +++ b/openvidu-dashboard/dashboard-ce/frontend/projects/dashboard-ui/src/testing/analytics.ts @@ -8,7 +8,7 @@ import type { AnalyticsSummary, InfoRetention } from '@openvidu-dashboard/typing import { NGX_ECHARTS_CONFIG } from 'ngx-echarts'; import { BreakdownChart } from '../lib/charts/breakdown-chart.js'; -import { TimeSeriesChart } from '../lib/charts/time-series-chart.js'; +import { TimeSeriesChart } from '../lib/charts/time-series-chart/time-series-chart.js'; import { InfoService } from '../lib/core/info.js'; import { AnalyticsPage } from '../lib/features/analytics/analytics-page.js'; import { infoResponse, settle } from './fixtures.js';