@rtsee/ngx 0.0.139 → 0.0.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,7 +9,7 @@ import { FloatLabel } from 'primeng/floatlabel';
|
|
|
9
9
|
import * as i4 from 'primeng/button';
|
|
10
10
|
import { Button, ButtonModule } from 'primeng/button';
|
|
11
11
|
import { interval, tap, map } from 'rxjs';
|
|
12
|
-
import { RTSeeTextLabelKeys, RTSeeCore,
|
|
12
|
+
import { RTSeeTextLabelKeys, RTSeeCore, hasPermission, RTSeePeerPermissions, defaultLabels } from '@rtsee/core';
|
|
13
13
|
import { RTSEE_BLOCK_REASONS, RTSeeChatMemberRoles, RTSeeIllustratorEvents, RTSeeChatTypes, OzzyTaskStatus, CREATE_STORY_ACTION_NAME, EDIT_STORY_ACTION_NAME, CREATE_SLIDE_ACTION_NAME, EDIT_SLIDE_ACTION_NAME, getStoryTranslatorLanguage, STORY_TRANSLATOR_LANGUAGES, RTSEE_REPORT_REASONS, RTSeeModerationWidgets } from '@rtsee/common';
|
|
14
14
|
import { AuthEndpointsKeys, LS_TOKEN_LABEL, LS_USER_LABEL, DEFAULT_ROUTE_NAMES } from '@rtsee/auth';
|
|
15
15
|
import * as i2 from '@angular/router';
|
|
@@ -8454,7 +8454,20 @@ class RtseeEventsDashboardComponent {
|
|
|
8454
8454
|
get reportsManager() {
|
|
8455
8455
|
return this.eventsDashboard?.reports;
|
|
8456
8456
|
}
|
|
8457
|
+
get tipsManager() {
|
|
8458
|
+
return this.eventsDashboard?.tips;
|
|
8459
|
+
}
|
|
8460
|
+
get canViewTips() {
|
|
8461
|
+
const peer = this.eventsDashboard?.myPeer;
|
|
8462
|
+
if (!peer) {
|
|
8463
|
+
return false;
|
|
8464
|
+
}
|
|
8465
|
+
return hasPermission(peer, RTSeePeerPermissions.APPLICATIONS_PAYMENTS_MANAGE);
|
|
8466
|
+
}
|
|
8457
8467
|
selectTab(tab) {
|
|
8468
|
+
if (tab === 'tips' && !this.canViewTips) {
|
|
8469
|
+
return;
|
|
8470
|
+
}
|
|
8458
8471
|
this.activeTab = tab;
|
|
8459
8472
|
if (tab === 'reports') {
|
|
8460
8473
|
this.reportsManager?.loadReports(this.reportsManager.reportsPage || 1);
|
|
@@ -8462,6 +8475,9 @@ class RtseeEventsDashboardComponent {
|
|
|
8462
8475
|
else if (tab === 'blocks') {
|
|
8463
8476
|
this.reportsManager?.loadBlocks(this.reportsManager.blocksPage || 1);
|
|
8464
8477
|
}
|
|
8478
|
+
else if (tab === 'tips') {
|
|
8479
|
+
this.tipsManager?.loadTips(this.tipsManager.tipsPage || 1);
|
|
8480
|
+
}
|
|
8465
8481
|
}
|
|
8466
8482
|
refreshModerationTab() {
|
|
8467
8483
|
if (this.activeTab === 'reports') {
|
|
@@ -8470,6 +8486,22 @@ class RtseeEventsDashboardComponent {
|
|
|
8470
8486
|
else if (this.activeTab === 'blocks') {
|
|
8471
8487
|
this.reportsManager?.loadBlocks(this.reportsManager.blocksPage || 1);
|
|
8472
8488
|
}
|
|
8489
|
+
else if (this.activeTab === 'tips' && this.canViewTips) {
|
|
8490
|
+
this.tipsManager?.loadTips(this.tipsManager.tipsPage || 1);
|
|
8491
|
+
}
|
|
8492
|
+
}
|
|
8493
|
+
formatTipAmount(amount, currency) {
|
|
8494
|
+
const numAmount = Number(amount) || 0;
|
|
8495
|
+
const code = (currency || 'USD').trim().toUpperCase();
|
|
8496
|
+
try {
|
|
8497
|
+
return new Intl.NumberFormat('en-US', {
|
|
8498
|
+
style: 'currency',
|
|
8499
|
+
currency: code,
|
|
8500
|
+
}).format(numAmount);
|
|
8501
|
+
}
|
|
8502
|
+
catch {
|
|
8503
|
+
return `${numAmount.toFixed(2)} ${code}`;
|
|
8504
|
+
}
|
|
8473
8505
|
}
|
|
8474
8506
|
loadMore() {
|
|
8475
8507
|
if (this.eventsDashboard) {
|
|
@@ -8477,11 +8509,11 @@ class RtseeEventsDashboardComponent {
|
|
|
8477
8509
|
}
|
|
8478
8510
|
}
|
|
8479
8511
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: RtseeEventsDashboardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8480
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: RtseeEventsDashboardComponent, isStandalone: true, selector: "rtsee-events-dashboard", inputs: { eventsDashboard: "eventsDashboard", framed: "framed", isFramed: "isFramed" }, ngImport: i0, template: "<div class=\"rtsee-events-dashboard\"\n [ngClass]=\"{\n 'rtsee-events-dashboard-framed': framed || isFramed,\n 'rts-messenger-framed': framed || isFramed\n }\"\n>\n <div class=\"rtsee-events-dashboard-tabs\">\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'sessions'\"\n (click)=\"selectTab('sessions')\"\n >\n <span class=\"material-icons-outlined\">sensors</span>\n <span>Sessions</span>\n </button>\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'reports'\"\n (click)=\"selectTab('reports')\"\n >\n <span class=\"material-icons-outlined\">flag</span>\n <span>Reports</span>\n @if (reportsManager && reportsManager.reportsTotal > 0) {\n <span class=\"rtsee-events-dashboard-badge\">{{ reportsManager.reportsTotal }}</span>\n }\n </button>\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'blocks'\"\n (click)=\"selectTab('blocks')\"\n >\n <span class=\"material-icons-outlined\">block</span>\n <span>Blocks</span>\n @if (reportsManager && reportsManager.blocksTotal > 0) {\n <span class=\"rtsee-events-dashboard-badge\">{{ reportsManager.blocksTotal }}</span>\n }\n </button>\n\n @if (activeTab !== 'sessions') {\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-refresh-btn\"\n (click)=\"refreshModerationTab()\"\n title=\"Refresh list\"\n >\n <span class=\"material-icons-outlined\">refresh</span>\n </button>\n }\n </div>\n\n @if (activeTab === 'sessions') {\n <div class=\"rtsee-events-dashboard-client-thumbnails\">\n @for (client of eventsDashboard.clients; track client.id) {\n <div class=\"rtsee-events-dashboard-client-thumbnail-wrapper\">\n <ngx-rtsee-events-dashboard-client-thumbnail\n [client]=\"client\"\n [dashboard]=\"eventsDashboard\"\n ></ngx-rtsee-events-dashboard-client-thumbnail>\n </div>\n }\n </div>\n\n @if (eventsDashboard?.hasMoreClients) {\n <div class=\"rtsee-events-dashboard-load-more\">\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-load-more-btn\"\n [disabled]=\"eventsDashboard.isLoadingMore\"\n (click)=\"loadMore()\"\n >\n @if (eventsDashboard.isLoadingMore) {\n <span class=\"material-icons-outlined spin-icon\">sync</span>\n <span>Loading...</span>\n } @else {\n <span class=\"material-icons-outlined\">expand_more</span>\n <span>Load More Sessions</span>\n }\n </button>\n </div>\n }\n }\n\n @if (activeTab === 'reports' && reportsManager) {\n <div class=\"rtsee-moderation-panel\">\n @if (reportsManager.reportsLoading) {\n <div class=\"rtsee-moderation-empty\">Loading reports...</div>\n } @else if (!reportsManager.reports.length) {\n <div class=\"rtsee-moderation-empty\">No content reports have been submitted yet.</div>\n } @else {\n <div class=\"rtsee-moderation-list\">\n @for (item of reportsManager.reports; track item.id) {\n <div class=\"rtsee-moderation-card\">\n <div class=\"rtsee-moderation-card-top\">\n <div class=\"rtsee-moderation-actors\">\n <span class=\"actor-label\">Reporter:</span>\n <strong>{{ item.reporter.name }}</strong>\n <span class=\"actor-arrow\">\u2192</span>\n <span class=\"actor-label\">Reported:</span>\n <strong>{{ item.reportedUser?.name || 'Unknown User' }}</strong>\n </div>\n <span class=\"rtsee-moderation-time\">\n {{ item.createdAt | date: 'medium' }}\n </span>\n </div>\n <div class=\"rtsee-moderation-reason-chip\">\n <span class=\"material-icons-outlined\">flag</span>\n <span>{{ item.reason }}</span>\n </div>\n @if (item.explanation) {\n <p class=\"rtsee-moderation-explanation\">\n <strong>Explanation:</strong> {{ item.explanation }}\n </p>\n }\n @if (item.messageText) {\n <div class=\"rtsee-moderation-message-quote\">\n <span>Reported message:</span> \"{{ item.messageText }}\"\n </div>\n }\n </div>\n }\n </div>\n\n <div class=\"rtsee-moderation-pagination\">\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasPrevReportsPage || reportsManager.reportsLoading\"\n (click)=\"reportsManager.prevReportsPage()\"\n >\n Previous\n </button>\n <span>\n Page {{ reportsManager.reportsPage }} of {{ reportsManager.reportsTotalPages }}\n ({{ reportsManager.reportsTotal }} total)\n </span>\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasNextReportsPage || reportsManager.reportsLoading\"\n (click)=\"reportsManager.nextReportsPage()\"\n >\n Next\n </button>\n </div>\n }\n </div>\n }\n\n @if (activeTab === 'blocks' && reportsManager) {\n <div class=\"rtsee-moderation-panel\">\n @if (reportsManager.blocksLoading) {\n <div class=\"rtsee-moderation-empty\">Loading blocks...</div>\n } @else if (!reportsManager.blocks.length) {\n <div class=\"rtsee-moderation-empty\">No active user blocks recorded.</div>\n } @else {\n <div class=\"rtsee-moderation-list\">\n @for (block of reportsManager.blocks; track block.id) {\n <div class=\"rtsee-moderation-card\">\n <div class=\"rtsee-moderation-card-top\">\n <div class=\"rtsee-moderation-actors\">\n <span class=\"actor-label\">Blocked by:</span>\n <strong>{{ block.blocker.name }}</strong>\n <span class=\"actor-arrow\">\u2192</span>\n <span class=\"actor-label\">Blocked user:</span>\n <strong>{{ block.blockedUser.name }}</strong>\n </div>\n <span class=\"rtsee-moderation-time\">\n {{ block.createdAt | date: 'medium' }}\n </span>\n </div>\n <div class=\"rtsee-moderation-reason-chip rtsee-block-chip\">\n <span class=\"material-icons-outlined\">block</span>\n <span>{{ block.reason }}</span>\n </div>\n @if (block.explanation) {\n <p class=\"rtsee-moderation-explanation\">\n <strong>Explanation:</strong> {{ block.explanation }}\n </p>\n }\n </div>\n }\n </div>\n\n <div class=\"rtsee-moderation-pagination\">\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasPrevBlocksPage || reportsManager.blocksLoading\"\n (click)=\"reportsManager.prevBlocksPage()\"\n >\n Previous\n </button>\n <span>\n Page {{ reportsManager.blocksPage }} of {{ reportsManager.blocksTotalPages }}\n ({{ reportsManager.blocksTotal }} total)\n </span>\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasNextBlocksPage || reportsManager.blocksLoading\"\n (click)=\"reportsManager.nextBlocksPage()\"\n >\n Next\n </button>\n </div>\n }\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: RtseeEventsDashboardClientThumbnailComponent, selector: "ngx-rtsee-events-dashboard-client-thumbnail", inputs: ["dashboard", "client"] }, { kind: "pipe", type: DatePipe, name: "date" }] }); }
|
|
8512
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: RtseeEventsDashboardComponent, isStandalone: true, selector: "rtsee-events-dashboard", inputs: { eventsDashboard: "eventsDashboard", framed: "framed", isFramed: "isFramed" }, ngImport: i0, template: "<div class=\"rtsee-events-dashboard\"\n [ngClass]=\"{\n 'rtsee-events-dashboard-framed': framed || isFramed,\n 'rts-messenger-framed': framed || isFramed\n }\"\n>\n <div class=\"rtsee-events-dashboard-tabs\">\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'sessions'\"\n (click)=\"selectTab('sessions')\"\n >\n <span class=\"material-icons-outlined\">sensors</span>\n <span>Sessions</span>\n </button>\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'reports'\"\n (click)=\"selectTab('reports')\"\n >\n <span class=\"material-icons-outlined\">flag</span>\n <span>Reports</span>\n @if (reportsManager && reportsManager.reportsTotal > 0) {\n <span class=\"rtsee-events-dashboard-badge\">{{ reportsManager.reportsTotal }}</span>\n }\n </button>\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'blocks'\"\n (click)=\"selectTab('blocks')\"\n >\n <span class=\"material-icons-outlined\">block</span>\n <span>Blocks</span>\n @if (reportsManager && reportsManager.blocksTotal > 0) {\n <span class=\"rtsee-events-dashboard-badge\">{{ reportsManager.blocksTotal }}</span>\n }\n </button>\n @if (canViewTips) {\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'tips'\"\n (click)=\"selectTab('tips')\"\n >\n <span class=\"material-icons-outlined\">volunteer_activism</span>\n <span>Tips</span>\n @if (tipsManager && tipsManager.tipsTotal > 0) {\n <span class=\"rtsee-events-dashboard-badge rtsee-tips-badge\">{{ tipsManager.tipsTotal }}</span>\n }\n </button>\n }\n\n @if (activeTab !== 'sessions') {\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-refresh-btn\"\n (click)=\"refreshModerationTab()\"\n title=\"Refresh list\"\n >\n <span class=\"material-icons-outlined\">refresh</span>\n </button>\n }\n </div>\n\n @if (activeTab === 'sessions') {\n <div class=\"rtsee-events-dashboard-client-thumbnails\">\n @for (client of eventsDashboard.clients; track client.id) {\n <div class=\"rtsee-events-dashboard-client-thumbnail-wrapper\">\n <ngx-rtsee-events-dashboard-client-thumbnail\n [client]=\"client\"\n [dashboard]=\"eventsDashboard\"\n ></ngx-rtsee-events-dashboard-client-thumbnail>\n </div>\n }\n </div>\n\n @if (eventsDashboard?.hasMoreClients) {\n <div class=\"rtsee-events-dashboard-load-more\">\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-load-more-btn\"\n [disabled]=\"eventsDashboard.isLoadingMore\"\n (click)=\"loadMore()\"\n >\n @if (eventsDashboard.isLoadingMore) {\n <span class=\"material-icons-outlined spin-icon\">sync</span>\n <span>Loading...</span>\n } @else {\n <span class=\"material-icons-outlined\">expand_more</span>\n <span>Load More Sessions</span>\n }\n </button>\n </div>\n }\n }\n\n @if (activeTab === 'reports' && reportsManager) {\n <div class=\"rtsee-moderation-panel\">\n @if (reportsManager.reportsLoading) {\n <div class=\"rtsee-moderation-empty\">Loading reports...</div>\n } @else if (!reportsManager.reports.length) {\n <div class=\"rtsee-moderation-empty\">No content reports have been submitted yet.</div>\n } @else {\n <div class=\"rtsee-moderation-list\">\n @for (item of reportsManager.reports; track item.id) {\n <div class=\"rtsee-moderation-card\">\n <div class=\"rtsee-moderation-card-top\">\n <div class=\"rtsee-moderation-actors\">\n <span class=\"actor-label\">Reporter:</span>\n <strong>{{ item.reporter.name }}</strong>\n <span class=\"actor-arrow\">\u2192</span>\n <span class=\"actor-label\">Reported:</span>\n <strong>{{ item.reportedUser?.name || 'Unknown User' }}</strong>\n </div>\n <span class=\"rtsee-moderation-time\">\n {{ item.createdAt | date: 'medium' }}\n </span>\n </div>\n <div class=\"rtsee-moderation-reason-chip\">\n <span class=\"material-icons-outlined\">flag</span>\n <span>{{ item.reason }}</span>\n </div>\n @if (item.explanation) {\n <p class=\"rtsee-moderation-explanation\">\n <strong>Explanation:</strong> {{ item.explanation }}\n </p>\n }\n @if (item.messageText) {\n <div class=\"rtsee-moderation-message-quote\">\n <span>Reported message:</span> \"{{ item.messageText }}\"\n </div>\n }\n </div>\n }\n </div>\n\n <div class=\"rtsee-moderation-pagination\">\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasPrevReportsPage || reportsManager.reportsLoading\"\n (click)=\"reportsManager.prevReportsPage()\"\n >\n Previous\n </button>\n <span>\n Page {{ reportsManager.reportsPage }} of {{ reportsManager.reportsTotalPages }}\n ({{ reportsManager.reportsTotal }} total)\n </span>\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasNextReportsPage || reportsManager.reportsLoading\"\n (click)=\"reportsManager.nextReportsPage()\"\n >\n Next\n </button>\n </div>\n }\n </div>\n }\n\n @if (activeTab === 'blocks' && reportsManager) {\n <div class=\"rtsee-moderation-panel\">\n @if (reportsManager.blocksLoading) {\n <div class=\"rtsee-moderation-empty\">Loading blocks...</div>\n } @else if (!reportsManager.blocks.length) {\n <div class=\"rtsee-moderation-empty\">No active user blocks recorded.</div>\n } @else {\n <div class=\"rtsee-moderation-list\">\n @for (block of reportsManager.blocks; track block.id) {\n <div class=\"rtsee-moderation-card\">\n <div class=\"rtsee-moderation-card-top\">\n <div class=\"rtsee-moderation-actors\">\n <span class=\"actor-label\">Blocked by:</span>\n <strong>{{ block.blocker.name }}</strong>\n <span class=\"actor-arrow\">\u2192</span>\n <span class=\"actor-label\">Blocked user:</span>\n <strong>{{ block.blockedUser.name }}</strong>\n </div>\n <span class=\"rtsee-moderation-time\">\n {{ block.createdAt | date: 'medium' }}\n </span>\n </div>\n <div class=\"rtsee-moderation-reason-chip rtsee-block-chip\">\n <span class=\"material-icons-outlined\">block</span>\n <span>{{ block.reason }}</span>\n </div>\n @if (block.explanation) {\n <p class=\"rtsee-moderation-explanation\">\n <strong>Explanation:</strong> {{ block.explanation }}\n </p>\n }\n </div>\n }\n </div>\n\n <div class=\"rtsee-moderation-pagination\">\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasPrevBlocksPage || reportsManager.blocksLoading\"\n (click)=\"reportsManager.prevBlocksPage()\"\n >\n Previous\n </button>\n <span>\n Page {{ reportsManager.blocksPage }} of {{ reportsManager.blocksTotalPages }}\n ({{ reportsManager.blocksTotal }} total)\n </span>\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasNextBlocksPage || reportsManager.blocksLoading\"\n (click)=\"reportsManager.nextBlocksPage()\"\n >\n Next\n </button>\n </div>\n }\n </div>\n }\n\n @if (activeTab === 'tips' && canViewTips && tipsManager) {\n <div class=\"rtsee-moderation-panel\">\n @if (tipsManager.tipsLoading) {\n <div class=\"rtsee-moderation-empty\">Loading tips...</div>\n } @else if (!tipsManager.tips.length) {\n <div class=\"rtsee-moderation-empty\">No supporter tips have been recorded yet.</div>\n } @else {\n <div class=\"rtsee-tips-table-wrapper\">\n <table class=\"rtsee-tips-table\">\n <thead>\n <tr>\n <th>Date</th>\n <th>Amount</th>\n <th>Email</th>\n <th>User</th>\n <th>Device ID</th>\n <th>Product / Transaction</th>\n </tr>\n </thead>\n <tbody>\n @for (tip of tipsManager.tips; track tip.id) {\n <tr>\n <td class=\"rtsee-tip-date\">\n {{ tip.createdAt | date: 'medium' }}\n </td>\n <td>\n <span class=\"rtsee-tip-amount-badge\">\n {{ formatTipAmount(tip.amount, tip.currency) }}\n </span>\n @if (tip.quantity > 1) {\n <span class=\"rtsee-tip-qty\">\u00D7{{ tip.quantity }}</span>\n }\n </td>\n <td>\n @if (tip.email) {\n <span class=\"rtsee-tip-email\">{{ tip.email }}</span>\n } @else {\n <span class=\"rtsee-tip-muted\">Guest</span>\n }\n </td>\n <td>\n <div class=\"rtsee-tip-cell-stack\">\n <span>{{ tip.user?.name || (tip.userId ? 'Guest' : '\u2014') }}</span>\n @if (tip.userId) {\n <code class=\"rtsee-tip-mono\">{{ tip.userId }}</code>\n }\n </div>\n </td>\n <td>\n @if (tip.deviceId) {\n <code class=\"rtsee-tip-mono\">{{ tip.deviceId }}</code>\n } @else {\n <span class=\"rtsee-tip-muted\">\u2014</span>\n }\n </td>\n <td>\n <div class=\"rtsee-tip-cell-stack\">\n <span>{{ tip.productId || tip.platform }}</span>\n @if (tip.transactionId) {\n <code class=\"rtsee-tip-mono\">tx: {{ tip.transactionId }}</code>\n }\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <div class=\"rtsee-moderation-pagination\">\n <button\n type=\"button\"\n [disabled]=\"!tipsManager.hasPrevTipsPage || tipsManager.tipsLoading\"\n (click)=\"tipsManager.prevTipsPage()\"\n >\n Previous\n </button>\n <span>\n Page {{ tipsManager.tipsPage }} of {{ tipsManager.tipsTotalPages }}\n ({{ tipsManager.tipsTotal }} total)\n </span>\n <button\n type=\"button\"\n [disabled]=\"!tipsManager.hasNextTipsPage || tipsManager.tipsLoading\"\n (click)=\"tipsManager.nextTipsPage()\"\n >\n Next\n </button>\n </div>\n }\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: RtseeEventsDashboardClientThumbnailComponent, selector: "ngx-rtsee-events-dashboard-client-thumbnail", inputs: ["dashboard", "client"] }, { kind: "pipe", type: DatePipe, name: "date" }] }); }
|
|
8481
8513
|
}
|
|
8482
8514
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: RtseeEventsDashboardComponent, decorators: [{
|
|
8483
8515
|
type: Component,
|
|
8484
|
-
args: [{ selector: 'rtsee-events-dashboard', imports: [NgClass, DatePipe, RtseeEventsDashboardClientThumbnailComponent], standalone: true, template: "<div class=\"rtsee-events-dashboard\"\n [ngClass]=\"{\n 'rtsee-events-dashboard-framed': framed || isFramed,\n 'rts-messenger-framed': framed || isFramed\n }\"\n>\n <div class=\"rtsee-events-dashboard-tabs\">\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'sessions'\"\n (click)=\"selectTab('sessions')\"\n >\n <span class=\"material-icons-outlined\">sensors</span>\n <span>Sessions</span>\n </button>\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'reports'\"\n (click)=\"selectTab('reports')\"\n >\n <span class=\"material-icons-outlined\">flag</span>\n <span>Reports</span>\n @if (reportsManager && reportsManager.reportsTotal > 0) {\n <span class=\"rtsee-events-dashboard-badge\">{{ reportsManager.reportsTotal }}</span>\n }\n </button>\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'blocks'\"\n (click)=\"selectTab('blocks')\"\n >\n <span class=\"material-icons-outlined\">block</span>\n <span>Blocks</span>\n @if (reportsManager && reportsManager.blocksTotal > 0) {\n <span class=\"rtsee-events-dashboard-badge\">{{ reportsManager.blocksTotal }}</span>\n }\n </button>\n\n @if (activeTab !== 'sessions') {\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-refresh-btn\"\n (click)=\"refreshModerationTab()\"\n title=\"Refresh list\"\n >\n <span class=\"material-icons-outlined\">refresh</span>\n </button>\n }\n </div>\n\n @if (activeTab === 'sessions') {\n <div class=\"rtsee-events-dashboard-client-thumbnails\">\n @for (client of eventsDashboard.clients; track client.id) {\n <div class=\"rtsee-events-dashboard-client-thumbnail-wrapper\">\n <ngx-rtsee-events-dashboard-client-thumbnail\n [client]=\"client\"\n [dashboard]=\"eventsDashboard\"\n ></ngx-rtsee-events-dashboard-client-thumbnail>\n </div>\n }\n </div>\n\n @if (eventsDashboard?.hasMoreClients) {\n <div class=\"rtsee-events-dashboard-load-more\">\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-load-more-btn\"\n [disabled]=\"eventsDashboard.isLoadingMore\"\n (click)=\"loadMore()\"\n >\n @if (eventsDashboard.isLoadingMore) {\n <span class=\"material-icons-outlined spin-icon\">sync</span>\n <span>Loading...</span>\n } @else {\n <span class=\"material-icons-outlined\">expand_more</span>\n <span>Load More Sessions</span>\n }\n </button>\n </div>\n }\n }\n\n @if (activeTab === 'reports' && reportsManager) {\n <div class=\"rtsee-moderation-panel\">\n @if (reportsManager.reportsLoading) {\n <div class=\"rtsee-moderation-empty\">Loading reports...</div>\n } @else if (!reportsManager.reports.length) {\n <div class=\"rtsee-moderation-empty\">No content reports have been submitted yet.</div>\n } @else {\n <div class=\"rtsee-moderation-list\">\n @for (item of reportsManager.reports; track item.id) {\n <div class=\"rtsee-moderation-card\">\n <div class=\"rtsee-moderation-card-top\">\n <div class=\"rtsee-moderation-actors\">\n <span class=\"actor-label\">Reporter:</span>\n <strong>{{ item.reporter.name }}</strong>\n <span class=\"actor-arrow\">\u2192</span>\n <span class=\"actor-label\">Reported:</span>\n <strong>{{ item.reportedUser?.name || 'Unknown User' }}</strong>\n </div>\n <span class=\"rtsee-moderation-time\">\n {{ item.createdAt | date: 'medium' }}\n </span>\n </div>\n <div class=\"rtsee-moderation-reason-chip\">\n <span class=\"material-icons-outlined\">flag</span>\n <span>{{ item.reason }}</span>\n </div>\n @if (item.explanation) {\n <p class=\"rtsee-moderation-explanation\">\n <strong>Explanation:</strong> {{ item.explanation }}\n </p>\n }\n @if (item.messageText) {\n <div class=\"rtsee-moderation-message-quote\">\n <span>Reported message:</span> \"{{ item.messageText }}\"\n </div>\n }\n </div>\n }\n </div>\n\n <div class=\"rtsee-moderation-pagination\">\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasPrevReportsPage || reportsManager.reportsLoading\"\n (click)=\"reportsManager.prevReportsPage()\"\n >\n Previous\n </button>\n <span>\n Page {{ reportsManager.reportsPage }} of {{ reportsManager.reportsTotalPages }}\n ({{ reportsManager.reportsTotal }} total)\n </span>\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasNextReportsPage || reportsManager.reportsLoading\"\n (click)=\"reportsManager.nextReportsPage()\"\n >\n Next\n </button>\n </div>\n }\n </div>\n }\n\n @if (activeTab === 'blocks' && reportsManager) {\n <div class=\"rtsee-moderation-panel\">\n @if (reportsManager.blocksLoading) {\n <div class=\"rtsee-moderation-empty\">Loading blocks...</div>\n } @else if (!reportsManager.blocks.length) {\n <div class=\"rtsee-moderation-empty\">No active user blocks recorded.</div>\n } @else {\n <div class=\"rtsee-moderation-list\">\n @for (block of reportsManager.blocks; track block.id) {\n <div class=\"rtsee-moderation-card\">\n <div class=\"rtsee-moderation-card-top\">\n <div class=\"rtsee-moderation-actors\">\n <span class=\"actor-label\">Blocked by:</span>\n <strong>{{ block.blocker.name }}</strong>\n <span class=\"actor-arrow\">\u2192</span>\n <span class=\"actor-label\">Blocked user:</span>\n <strong>{{ block.blockedUser.name }}</strong>\n </div>\n <span class=\"rtsee-moderation-time\">\n {{ block.createdAt | date: 'medium' }}\n </span>\n </div>\n <div class=\"rtsee-moderation-reason-chip rtsee-block-chip\">\n <span class=\"material-icons-outlined\">block</span>\n <span>{{ block.reason }}</span>\n </div>\n @if (block.explanation) {\n <p class=\"rtsee-moderation-explanation\">\n <strong>Explanation:</strong> {{ block.explanation }}\n </p>\n }\n </div>\n }\n </div>\n\n <div class=\"rtsee-moderation-pagination\">\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasPrevBlocksPage || reportsManager.blocksLoading\"\n (click)=\"reportsManager.prevBlocksPage()\"\n >\n Previous\n </button>\n <span>\n Page {{ reportsManager.blocksPage }} of {{ reportsManager.blocksTotalPages }}\n ({{ reportsManager.blocksTotal }} total)\n </span>\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasNextBlocksPage || reportsManager.blocksLoading\"\n (click)=\"reportsManager.nextBlocksPage()\"\n >\n Next\n </button>\n </div>\n }\n </div>\n }\n</div>\n" }]
|
|
8516
|
+
args: [{ selector: 'rtsee-events-dashboard', imports: [NgClass, DatePipe, RtseeEventsDashboardClientThumbnailComponent], standalone: true, template: "<div class=\"rtsee-events-dashboard\"\n [ngClass]=\"{\n 'rtsee-events-dashboard-framed': framed || isFramed,\n 'rts-messenger-framed': framed || isFramed\n }\"\n>\n <div class=\"rtsee-events-dashboard-tabs\">\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'sessions'\"\n (click)=\"selectTab('sessions')\"\n >\n <span class=\"material-icons-outlined\">sensors</span>\n <span>Sessions</span>\n </button>\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'reports'\"\n (click)=\"selectTab('reports')\"\n >\n <span class=\"material-icons-outlined\">flag</span>\n <span>Reports</span>\n @if (reportsManager && reportsManager.reportsTotal > 0) {\n <span class=\"rtsee-events-dashboard-badge\">{{ reportsManager.reportsTotal }}</span>\n }\n </button>\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'blocks'\"\n (click)=\"selectTab('blocks')\"\n >\n <span class=\"material-icons-outlined\">block</span>\n <span>Blocks</span>\n @if (reportsManager && reportsManager.blocksTotal > 0) {\n <span class=\"rtsee-events-dashboard-badge\">{{ reportsManager.blocksTotal }}</span>\n }\n </button>\n @if (canViewTips) {\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-tab\"\n [class.active]=\"activeTab === 'tips'\"\n (click)=\"selectTab('tips')\"\n >\n <span class=\"material-icons-outlined\">volunteer_activism</span>\n <span>Tips</span>\n @if (tipsManager && tipsManager.tipsTotal > 0) {\n <span class=\"rtsee-events-dashboard-badge rtsee-tips-badge\">{{ tipsManager.tipsTotal }}</span>\n }\n </button>\n }\n\n @if (activeTab !== 'sessions') {\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-refresh-btn\"\n (click)=\"refreshModerationTab()\"\n title=\"Refresh list\"\n >\n <span class=\"material-icons-outlined\">refresh</span>\n </button>\n }\n </div>\n\n @if (activeTab === 'sessions') {\n <div class=\"rtsee-events-dashboard-client-thumbnails\">\n @for (client of eventsDashboard.clients; track client.id) {\n <div class=\"rtsee-events-dashboard-client-thumbnail-wrapper\">\n <ngx-rtsee-events-dashboard-client-thumbnail\n [client]=\"client\"\n [dashboard]=\"eventsDashboard\"\n ></ngx-rtsee-events-dashboard-client-thumbnail>\n </div>\n }\n </div>\n\n @if (eventsDashboard?.hasMoreClients) {\n <div class=\"rtsee-events-dashboard-load-more\">\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-load-more-btn\"\n [disabled]=\"eventsDashboard.isLoadingMore\"\n (click)=\"loadMore()\"\n >\n @if (eventsDashboard.isLoadingMore) {\n <span class=\"material-icons-outlined spin-icon\">sync</span>\n <span>Loading...</span>\n } @else {\n <span class=\"material-icons-outlined\">expand_more</span>\n <span>Load More Sessions</span>\n }\n </button>\n </div>\n }\n }\n\n @if (activeTab === 'reports' && reportsManager) {\n <div class=\"rtsee-moderation-panel\">\n @if (reportsManager.reportsLoading) {\n <div class=\"rtsee-moderation-empty\">Loading reports...</div>\n } @else if (!reportsManager.reports.length) {\n <div class=\"rtsee-moderation-empty\">No content reports have been submitted yet.</div>\n } @else {\n <div class=\"rtsee-moderation-list\">\n @for (item of reportsManager.reports; track item.id) {\n <div class=\"rtsee-moderation-card\">\n <div class=\"rtsee-moderation-card-top\">\n <div class=\"rtsee-moderation-actors\">\n <span class=\"actor-label\">Reporter:</span>\n <strong>{{ item.reporter.name }}</strong>\n <span class=\"actor-arrow\">\u2192</span>\n <span class=\"actor-label\">Reported:</span>\n <strong>{{ item.reportedUser?.name || 'Unknown User' }}</strong>\n </div>\n <span class=\"rtsee-moderation-time\">\n {{ item.createdAt | date: 'medium' }}\n </span>\n </div>\n <div class=\"rtsee-moderation-reason-chip\">\n <span class=\"material-icons-outlined\">flag</span>\n <span>{{ item.reason }}</span>\n </div>\n @if (item.explanation) {\n <p class=\"rtsee-moderation-explanation\">\n <strong>Explanation:</strong> {{ item.explanation }}\n </p>\n }\n @if (item.messageText) {\n <div class=\"rtsee-moderation-message-quote\">\n <span>Reported message:</span> \"{{ item.messageText }}\"\n </div>\n }\n </div>\n }\n </div>\n\n <div class=\"rtsee-moderation-pagination\">\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasPrevReportsPage || reportsManager.reportsLoading\"\n (click)=\"reportsManager.prevReportsPage()\"\n >\n Previous\n </button>\n <span>\n Page {{ reportsManager.reportsPage }} of {{ reportsManager.reportsTotalPages }}\n ({{ reportsManager.reportsTotal }} total)\n </span>\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasNextReportsPage || reportsManager.reportsLoading\"\n (click)=\"reportsManager.nextReportsPage()\"\n >\n Next\n </button>\n </div>\n }\n </div>\n }\n\n @if (activeTab === 'blocks' && reportsManager) {\n <div class=\"rtsee-moderation-panel\">\n @if (reportsManager.blocksLoading) {\n <div class=\"rtsee-moderation-empty\">Loading blocks...</div>\n } @else if (!reportsManager.blocks.length) {\n <div class=\"rtsee-moderation-empty\">No active user blocks recorded.</div>\n } @else {\n <div class=\"rtsee-moderation-list\">\n @for (block of reportsManager.blocks; track block.id) {\n <div class=\"rtsee-moderation-card\">\n <div class=\"rtsee-moderation-card-top\">\n <div class=\"rtsee-moderation-actors\">\n <span class=\"actor-label\">Blocked by:</span>\n <strong>{{ block.blocker.name }}</strong>\n <span class=\"actor-arrow\">\u2192</span>\n <span class=\"actor-label\">Blocked user:</span>\n <strong>{{ block.blockedUser.name }}</strong>\n </div>\n <span class=\"rtsee-moderation-time\">\n {{ block.createdAt | date: 'medium' }}\n </span>\n </div>\n <div class=\"rtsee-moderation-reason-chip rtsee-block-chip\">\n <span class=\"material-icons-outlined\">block</span>\n <span>{{ block.reason }}</span>\n </div>\n @if (block.explanation) {\n <p class=\"rtsee-moderation-explanation\">\n <strong>Explanation:</strong> {{ block.explanation }}\n </p>\n }\n </div>\n }\n </div>\n\n <div class=\"rtsee-moderation-pagination\">\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasPrevBlocksPage || reportsManager.blocksLoading\"\n (click)=\"reportsManager.prevBlocksPage()\"\n >\n Previous\n </button>\n <span>\n Page {{ reportsManager.blocksPage }} of {{ reportsManager.blocksTotalPages }}\n ({{ reportsManager.blocksTotal }} total)\n </span>\n <button\n type=\"button\"\n [disabled]=\"!reportsManager.hasNextBlocksPage || reportsManager.blocksLoading\"\n (click)=\"reportsManager.nextBlocksPage()\"\n >\n Next\n </button>\n </div>\n }\n </div>\n }\n\n @if (activeTab === 'tips' && canViewTips && tipsManager) {\n <div class=\"rtsee-moderation-panel\">\n @if (tipsManager.tipsLoading) {\n <div class=\"rtsee-moderation-empty\">Loading tips...</div>\n } @else if (!tipsManager.tips.length) {\n <div class=\"rtsee-moderation-empty\">No supporter tips have been recorded yet.</div>\n } @else {\n <div class=\"rtsee-tips-table-wrapper\">\n <table class=\"rtsee-tips-table\">\n <thead>\n <tr>\n <th>Date</th>\n <th>Amount</th>\n <th>Email</th>\n <th>User</th>\n <th>Device ID</th>\n <th>Product / Transaction</th>\n </tr>\n </thead>\n <tbody>\n @for (tip of tipsManager.tips; track tip.id) {\n <tr>\n <td class=\"rtsee-tip-date\">\n {{ tip.createdAt | date: 'medium' }}\n </td>\n <td>\n <span class=\"rtsee-tip-amount-badge\">\n {{ formatTipAmount(tip.amount, tip.currency) }}\n </span>\n @if (tip.quantity > 1) {\n <span class=\"rtsee-tip-qty\">\u00D7{{ tip.quantity }}</span>\n }\n </td>\n <td>\n @if (tip.email) {\n <span class=\"rtsee-tip-email\">{{ tip.email }}</span>\n } @else {\n <span class=\"rtsee-tip-muted\">Guest</span>\n }\n </td>\n <td>\n <div class=\"rtsee-tip-cell-stack\">\n <span>{{ tip.user?.name || (tip.userId ? 'Guest' : '\u2014') }}</span>\n @if (tip.userId) {\n <code class=\"rtsee-tip-mono\">{{ tip.userId }}</code>\n }\n </div>\n </td>\n <td>\n @if (tip.deviceId) {\n <code class=\"rtsee-tip-mono\">{{ tip.deviceId }}</code>\n } @else {\n <span class=\"rtsee-tip-muted\">\u2014</span>\n }\n </td>\n <td>\n <div class=\"rtsee-tip-cell-stack\">\n <span>{{ tip.productId || tip.platform }}</span>\n @if (tip.transactionId) {\n <code class=\"rtsee-tip-mono\">tx: {{ tip.transactionId }}</code>\n }\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <div class=\"rtsee-moderation-pagination\">\n <button\n type=\"button\"\n [disabled]=\"!tipsManager.hasPrevTipsPage || tipsManager.tipsLoading\"\n (click)=\"tipsManager.prevTipsPage()\"\n >\n Previous\n </button>\n <span>\n Page {{ tipsManager.tipsPage }} of {{ tipsManager.tipsTotalPages }}\n ({{ tipsManager.tipsTotal }} total)\n </span>\n <button\n type=\"button\"\n [disabled]=\"!tipsManager.hasNextTipsPage || tipsManager.tipsLoading\"\n (click)=\"tipsManager.nextTipsPage()\"\n >\n Next\n </button>\n </div>\n }\n </div>\n }\n</div>\n" }]
|
|
8485
8517
|
}], propDecorators: { eventsDashboard: [{
|
|
8486
8518
|
type: Input
|
|
8487
8519
|
}], framed: [{
|
|
@@ -11458,6 +11490,58 @@ class RTSeeContainerComponent {
|
|
|
11458
11490
|
this.isSidenavFullScreen = false;
|
|
11459
11491
|
this.isWideScreen = false;
|
|
11460
11492
|
this.lastNonMessengerUrl = '/';
|
|
11493
|
+
this.onRemotePresentationNavigation = (payload) => {
|
|
11494
|
+
const presentation = this.rtsee?.presentation;
|
|
11495
|
+
if (!presentation || !payload?.action) {
|
|
11496
|
+
return;
|
|
11497
|
+
}
|
|
11498
|
+
const cleanPath = (this.router.url || '/').split('?')[0].split('#')[0].replace(/\/+$/, '') ||
|
|
11499
|
+
'/';
|
|
11500
|
+
const storyPrefix = (presentation.routePrefix || '/story').replace(/\/+$/, '');
|
|
11501
|
+
const listPrefix = (presentation.listRoutePrefix || '/list').replace(/\/+$/, '');
|
|
11502
|
+
const homeUrl = presentation.homePage || this.getHomeUrl();
|
|
11503
|
+
if (payload.action === 'open-details' && (payload.slug || payload.storyId)) {
|
|
11504
|
+
const targetSlug = payload.slug || payload.storyId;
|
|
11505
|
+
const targetPath = `${storyPrefix}/${targetSlug}`;
|
|
11506
|
+
this.rtsee.setActiveTab('presentation');
|
|
11507
|
+
if (cleanPath !== targetPath && cleanPath !== `/ua${targetPath}`) {
|
|
11508
|
+
void this.router.navigate([storyPrefix, targetSlug]).catch(() => { });
|
|
11509
|
+
}
|
|
11510
|
+
return;
|
|
11511
|
+
}
|
|
11512
|
+
if (payload.action === 'open-list' && (payload.slug || payload.listId)) {
|
|
11513
|
+
const targetSlug = payload.slug || payload.listId;
|
|
11514
|
+
const targetPath = `${listPrefix}/${targetSlug}`;
|
|
11515
|
+
this.rtsee.setActiveTab('presentation');
|
|
11516
|
+
if (cleanPath !== targetPath && cleanPath !== `/ua${targetPath}`) {
|
|
11517
|
+
void this.router.navigate([listPrefix, targetSlug]).catch(() => { });
|
|
11518
|
+
}
|
|
11519
|
+
return;
|
|
11520
|
+
}
|
|
11521
|
+
if (payload.action === 'close-details' ||
|
|
11522
|
+
payload.action === 'close-list' ||
|
|
11523
|
+
payload.action === 'close-story') {
|
|
11524
|
+
if (cleanPath.startsWith(storyPrefix) ||
|
|
11525
|
+
cleanPath.startsWith(listPrefix) ||
|
|
11526
|
+
cleanPath.startsWith(`/ua${storyPrefix}`) ||
|
|
11527
|
+
cleanPath.startsWith(`/ua${listPrefix}`)) {
|
|
11528
|
+
void this.router.navigateByUrl(homeUrl).catch(() => { });
|
|
11529
|
+
}
|
|
11530
|
+
return;
|
|
11531
|
+
}
|
|
11532
|
+
if (payload.action === 'slide-nav') {
|
|
11533
|
+
this.rtsee.setActiveTab('presentation');
|
|
11534
|
+
if (this.isMessengerRouteUrl(cleanPath) && !this.isMessengerSidebarActive) {
|
|
11535
|
+
const targetSlug = payload.slug || payload.storyId;
|
|
11536
|
+
if (targetSlug) {
|
|
11537
|
+
void this.router.navigate([storyPrefix, targetSlug]).catch(() => { });
|
|
11538
|
+
}
|
|
11539
|
+
else {
|
|
11540
|
+
void this.router.navigateByUrl(homeUrl).catch(() => { });
|
|
11541
|
+
}
|
|
11542
|
+
}
|
|
11543
|
+
}
|
|
11544
|
+
};
|
|
11461
11545
|
this.onWindowResize = () => {
|
|
11462
11546
|
const wasWide = this.isWideScreen;
|
|
11463
11547
|
this.isWideScreen = this.checkIsWideScreen();
|
|
@@ -11525,8 +11609,10 @@ class RTSeeContainerComponent {
|
|
|
11525
11609
|
}
|
|
11526
11610
|
});
|
|
11527
11611
|
this.subscribeToHtmlEvents();
|
|
11612
|
+
this.rtsee?.presentation?.on?.('remote-navigation', this.onRemotePresentationNavigation);
|
|
11528
11613
|
}
|
|
11529
11614
|
ngOnDestroy() {
|
|
11615
|
+
this.rtsee?.presentation?.off?.('remote-navigation', this.onRemotePresentationNavigation);
|
|
11530
11616
|
this.routeSubscription?.unsubscribe();
|
|
11531
11617
|
if (typeof window !== 'undefined') {
|
|
11532
11618
|
window.removeEventListener('resize', this.onWindowResize);
|