@noatgnu/cupcake-vanilla 1.2.22 → 1.3.0
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, signal, computed, EventEmitter, inject, Output, Input, Component, effect, ViewChild } from '@angular/core';
|
|
3
3
|
import * as i3 from '@noatgnu/cupcake-core';
|
|
4
|
-
import { BaseApiService, WebSocketService, NotificationService as NotificationService$1, LabGroupService, ToastService, ResourceVisibility } from '@noatgnu/cupcake-core';
|
|
4
|
+
import { BaseApiService, WebSocketService, NotificationService as NotificationService$1, LabGroupService, ToastService, TaskStatus, TaskType, ResourceVisibility } from '@noatgnu/cupcake-core';
|
|
5
5
|
import { switchMap, map, tap, takeUntil, filter as filter$1 } from 'rxjs/operators';
|
|
6
6
|
import { from, Observable, throwError, NEVER, debounceTime, distinctUntilChanged, filter, switchMap as switchMap$1, map as map$1, catchError, of, tap as tap$1, Subject, BehaviorSubject, firstValueFrom, takeUntil as takeUntil$1 } from 'rxjs';
|
|
7
7
|
import jsSHA from 'jssha';
|
|
@@ -502,57 +502,6 @@ function isSdrfColumnRequired(name) {
|
|
|
502
502
|
return column?.isRequired === true;
|
|
503
503
|
}
|
|
504
504
|
|
|
505
|
-
var TaskStatus;
|
|
506
|
-
(function (TaskStatus) {
|
|
507
|
-
TaskStatus["QUEUED"] = "QUEUED";
|
|
508
|
-
TaskStatus["STARTED"] = "STARTED";
|
|
509
|
-
TaskStatus["SUCCESS"] = "SUCCESS";
|
|
510
|
-
TaskStatus["FAILURE"] = "FAILURE";
|
|
511
|
-
TaskStatus["CANCELLED"] = "CANCELLED";
|
|
512
|
-
})(TaskStatus || (TaskStatus = {}));
|
|
513
|
-
var TaskType;
|
|
514
|
-
(function (TaskType) {
|
|
515
|
-
TaskType["EXPORT_EXCEL"] = "EXPORT_EXCEL";
|
|
516
|
-
TaskType["EXPORT_SDRF"] = "EXPORT_SDRF";
|
|
517
|
-
TaskType["IMPORT_SDRF"] = "IMPORT_SDRF";
|
|
518
|
-
TaskType["IMPORT_EXCEL"] = "IMPORT_EXCEL";
|
|
519
|
-
TaskType["EXPORT_MULTIPLE_SDRF"] = "EXPORT_MULTIPLE_SDRF";
|
|
520
|
-
TaskType["EXPORT_MULTIPLE_EXCEL"] = "EXPORT_MULTIPLE_EXCEL";
|
|
521
|
-
TaskType["VALIDATE_TABLE"] = "VALIDATE_TABLE";
|
|
522
|
-
TaskType["REORDER_TABLE_COLUMNS"] = "REORDER_TABLE_COLUMNS";
|
|
523
|
-
TaskType["REORDER_TEMPLATE_COLUMNS"] = "REORDER_TEMPLATE_COLUMNS";
|
|
524
|
-
TaskType["TRANSCRIBE_AUDIO"] = "TRANSCRIBE_AUDIO";
|
|
525
|
-
TaskType["TRANSCRIBE_VIDEO"] = "TRANSCRIBE_VIDEO";
|
|
526
|
-
})(TaskType || (TaskType = {}));
|
|
527
|
-
// Helper constants
|
|
528
|
-
const TASK_TYPE_LABELS = {
|
|
529
|
-
[TaskType.EXPORT_EXCEL]: 'Export Excel Template',
|
|
530
|
-
[TaskType.EXPORT_SDRF]: 'Export SDRF File',
|
|
531
|
-
[TaskType.IMPORT_SDRF]: 'Import SDRF File',
|
|
532
|
-
[TaskType.IMPORT_EXCEL]: 'Import Excel File',
|
|
533
|
-
[TaskType.EXPORT_MULTIPLE_SDRF]: 'Export Multiple SDRF Files',
|
|
534
|
-
[TaskType.EXPORT_MULTIPLE_EXCEL]: 'Export Multiple Excel Templates',
|
|
535
|
-
[TaskType.VALIDATE_TABLE]: 'Validate Metadata Table',
|
|
536
|
-
[TaskType.REORDER_TABLE_COLUMNS]: 'Reorder Table Columns',
|
|
537
|
-
[TaskType.REORDER_TEMPLATE_COLUMNS]: 'Reorder Template Columns',
|
|
538
|
-
[TaskType.TRANSCRIBE_AUDIO]: 'Transcribe Audio',
|
|
539
|
-
[TaskType.TRANSCRIBE_VIDEO]: 'Transcribe Video',
|
|
540
|
-
};
|
|
541
|
-
const TASK_STATUS_LABELS = {
|
|
542
|
-
[TaskStatus.QUEUED]: 'Queued',
|
|
543
|
-
[TaskStatus.STARTED]: 'In Progress',
|
|
544
|
-
[TaskStatus.SUCCESS]: 'Completed',
|
|
545
|
-
[TaskStatus.FAILURE]: 'Failed',
|
|
546
|
-
[TaskStatus.CANCELLED]: 'Cancelled',
|
|
547
|
-
};
|
|
548
|
-
const TASK_STATUS_COLORS = {
|
|
549
|
-
[TaskStatus.QUEUED]: 'secondary',
|
|
550
|
-
[TaskStatus.STARTED]: 'primary',
|
|
551
|
-
[TaskStatus.SUCCESS]: 'success',
|
|
552
|
-
[TaskStatus.FAILURE]: 'danger',
|
|
553
|
-
[TaskStatus.CANCELLED]: 'warning',
|
|
554
|
-
};
|
|
555
|
-
|
|
556
505
|
class MetadataTableService extends BaseApiService {
|
|
557
506
|
/**
|
|
558
507
|
* Get all metadata tables with optional filtering
|
|
@@ -1269,8 +1218,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
|
|
|
1269
1218
|
class Websocket extends WebSocketService {
|
|
1270
1219
|
constructor(authService) {
|
|
1271
1220
|
super(authService);
|
|
1272
|
-
this.endpoint = '
|
|
1273
|
-
this.config.endpoint = '
|
|
1221
|
+
this.endpoint = 'notifications';
|
|
1222
|
+
this.config.endpoint = 'notifications';
|
|
1274
1223
|
this.config.url = this.getWebSocketUrl();
|
|
1275
1224
|
}
|
|
1276
1225
|
getMetadataTableUpdates() {
|
|
@@ -1536,6 +1485,12 @@ class NotificationService extends NotificationService$1 {
|
|
|
1536
1485
|
case 'REORDER_TEMPLATE_COLUMNS':
|
|
1537
1486
|
operation = 'Template Column Reordering';
|
|
1538
1487
|
break;
|
|
1488
|
+
case 'TRANSCRIBE_AUDIO':
|
|
1489
|
+
operation = 'Audio Transcription';
|
|
1490
|
+
break;
|
|
1491
|
+
case 'TRANSCRIBE_VIDEO':
|
|
1492
|
+
operation = 'Video Transcription';
|
|
1493
|
+
break;
|
|
1539
1494
|
}
|
|
1540
1495
|
switch (status) {
|
|
1541
1496
|
case 'QUEUED':
|
|
@@ -3947,27 +3902,31 @@ class AsyncTaskUIService {
|
|
|
3947
3902
|
taskCompleted$ = this.taskCompletedSubject.asObservable();
|
|
3948
3903
|
exportTaskCompleted$ = this.exportTaskCompletedSubject.asObservable();
|
|
3949
3904
|
constructor() {
|
|
3950
|
-
this.initializeService();
|
|
3951
3905
|
}
|
|
3952
3906
|
ngOnDestroy() {
|
|
3953
3907
|
this.destroy$.next();
|
|
3954
3908
|
this.destroy$.complete();
|
|
3955
3909
|
}
|
|
3956
|
-
initializeService() {
|
|
3957
|
-
this.startRealtimeUpdates();
|
|
3958
|
-
}
|
|
3959
3910
|
startRealtimeUpdates() {
|
|
3960
3911
|
if (this.isSubscribed) {
|
|
3912
|
+
console.log('AsyncTaskUIService: Already subscribed to real-time updates');
|
|
3961
3913
|
return;
|
|
3962
3914
|
}
|
|
3915
|
+
console.log('AsyncTaskUIService: Starting real-time updates');
|
|
3963
3916
|
this.isSubscribed = true;
|
|
3964
3917
|
if (!this.websocket.connectionState$() || this.websocket.connectionState$() === 'disconnected') {
|
|
3918
|
+
console.log('AsyncTaskUIService: WebSocket not connected, connecting now...');
|
|
3965
3919
|
this.websocket.connect();
|
|
3966
3920
|
}
|
|
3921
|
+
else {
|
|
3922
|
+
console.log('AsyncTaskUIService: WebSocket already connected');
|
|
3923
|
+
}
|
|
3967
3924
|
this.websocket.isConnected$.pipe(takeUntil(this.destroy$), filter$1(connected => connected)).subscribe(() => {
|
|
3925
|
+
console.log('AsyncTaskUIService: WebSocket connected, subscribing to async_task_updates');
|
|
3968
3926
|
this.websocket.subscribe('async_task_updates');
|
|
3969
3927
|
});
|
|
3970
3928
|
this.websocket.filterMessages('async_task.update').pipe(takeUntil(this.destroy$)).subscribe((message) => {
|
|
3929
|
+
console.log('AsyncTaskUIService: Received async_task.update message:', message);
|
|
3971
3930
|
this.handleTaskUpdate(message);
|
|
3972
3931
|
});
|
|
3973
3932
|
this.getTasks().subscribe({
|
|
@@ -3981,6 +3940,7 @@ class AsyncTaskUIService {
|
|
|
3981
3940
|
});
|
|
3982
3941
|
}
|
|
3983
3942
|
stopRealtimeUpdates() {
|
|
3943
|
+
console.log('AsyncTaskUIService: Stopping real-time updates');
|
|
3984
3944
|
this.isSubscribed = false;
|
|
3985
3945
|
this.destroy$.next();
|
|
3986
3946
|
}
|
|
@@ -9925,5 +9885,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
|
|
|
9925
9885
|
* Generated bundle index. Do not edit.
|
|
9926
9886
|
*/
|
|
9927
9887
|
|
|
9928
|
-
export { AdminWebSocketService, AsyncExportService, AsyncImportService, AsyncTaskService, AsyncTaskUIService, AsyncValidationService, COLUMN_TYPE_CONFIGS, ChunkedImportService, ChunkedUploadService, ColumnEditModal, ColumnTemplateEditModal, ColumnTemplates, ColumnType, CupcakeVanilla, ElectronService, ExcelExportModalComponent, FavoriteManagement, FavouriteMetadataOptionService, MSTermType, MetadataColumnAutofillModal, MetadataColumnHistoryModal, MetadataColumnService, MetadataColumnTemplateService, MetadataColumnTemplateShareService, MetadataManagementService, MetadataTableDetails, MetadataTableEditModal, MetadataTableService, MetadataTableTemplateEditModal, MetadataTableTemplateService, MetadataTableTemplates, MetadataValidationModal, MetadataValueEditModal, NotificationService, NotificationType, OFFICIAL_SDRF_COLUMNS, ONTOLOGY_TYPE_CONFIGS, OntologySearchService, OntologyType, OntologyTypeLabels, OntologyUtils, SDRFDefaultsService, SamplePoolCreateModal, SamplePoolDetailsModal, SamplePoolEditModal, SamplePoolService, SchemaSelectionModal, SchemaService, SdrfAgeInput, SdrfCleavageInput, SdrfColumnCategory, SdrfModificationInput, SdrfSpikedCompoundInput, SdrfSyntaxService, SearchReplaceModal,
|
|
9888
|
+
export { AdminWebSocketService, AsyncExportService, AsyncImportService, AsyncTaskService, AsyncTaskUIService, AsyncValidationService, COLUMN_TYPE_CONFIGS, ChunkedImportService, ChunkedUploadService, ColumnEditModal, ColumnTemplateEditModal, ColumnTemplates, ColumnType, CupcakeVanilla, ElectronService, ExcelExportModalComponent, FavoriteManagement, FavouriteMetadataOptionService, MSTermType, MetadataColumnAutofillModal, MetadataColumnHistoryModal, MetadataColumnService, MetadataColumnTemplateService, MetadataColumnTemplateShareService, MetadataManagementService, MetadataTableDetails, MetadataTableEditModal, MetadataTableService, MetadataTableTemplateEditModal, MetadataTableTemplateService, MetadataTableTemplates, MetadataValidationModal, MetadataValueEditModal, NotificationService, NotificationType, OFFICIAL_SDRF_COLUMNS, ONTOLOGY_TYPE_CONFIGS, OntologySearchService, OntologyType, OntologyTypeLabels, OntologyUtils, SDRFDefaultsService, SamplePoolCreateModal, SamplePoolDetailsModal, SamplePoolEditModal, SamplePoolService, SchemaSelectionModal, SchemaService, SdrfAgeInput, SdrfCleavageInput, SdrfColumnCategory, SdrfModificationInput, SdrfSpikedCompoundInput, SdrfSyntaxService, SearchReplaceModal, TableCreationModalComponent, TemplatePermissionLabels, TemplatePermissionLevel, TemplateSchemaSelectionModal, ValidationResultsModal, Websocket, getRequiredSdrfColumns, getSdrfColumnByName, getSdrfColumnsByCategory, isSdrfColumnRequired, isUnimodFullData };
|
|
9929
9889
|
//# sourceMappingURL=noatgnu-cupcake-vanilla.mjs.map
|