cloud-ide-layout 1.0.16 → 1.0.18

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.
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { Injectable, inject, signal, computed, effect, Component, ElementRef, HostListener, ViewContainerRef, ViewChild, ViewChildren, InjectionToken, PLATFORM_ID } from '@angular/core';
3
3
  import { HttpClient } from '@angular/common/http';
4
4
  import { cidePath, hostManagerRoutesUrl, coreRoutesUrl, designConfigRoutesUrl } from 'cloud-ide-lms-model';
5
- import { throwError, of, BehaviorSubject, interval, take as take$1 } from 'rxjs';
5
+ import { Observable, throwError, of, BehaviorSubject, interval, take as take$1 } from 'rxjs';
6
6
  import { map, filter, tap, catchError, shareReplay, take, distinctUntilChanged } from 'rxjs/operators';
7
7
  import * as i2 from '@angular/router';
8
8
  import { Router, NavigationEnd, RouteReuseStrategy, RouterModule } from '@angular/router';
@@ -12,6 +12,7 @@ import * as i1 from '@angular/common';
12
12
  import { CommonModule, NgClass, NgFor, NgIf, isPlatformBrowser } from '@angular/common';
13
13
  import { trigger, state, transition, style, animate } from '@angular/animations';
14
14
  import { merge } from 'lodash';
15
+ import { authGuard } from 'cloud-ide-auth';
15
16
 
16
17
  class CloudIdeLayoutService {
17
18
  constructor() { }
@@ -53,7 +54,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
53
54
  class CideLytFileManagerService {
54
55
  http = inject(HttpClient);
55
56
  getFileDetails(body) {
56
- return this.http.post(cidePath.join([hostManagerRoutesUrl.cideSuiteHost, coreRoutesUrl?.module, coreRoutesUrl?.getFileDetails]), body);
57
+ return this.http.post(cidePath.join([hostManagerRoutesUrl.cideSuiteHost, coreRoutesUrl?.module, coreRoutesUrl?.fileManager]), body);
58
+ }
59
+ uploadFile(file, additionalData) {
60
+ // Convert file to base64
61
+ return new Observable(observer => {
62
+ const reader = new FileReader();
63
+ reader.onload = () => {
64
+ const base64String = reader.result;
65
+ const base64Data = base64String.split(',')[1]; // Remove data:image/jpeg;base64, prefix
66
+ const payload = {
67
+ cyfm_name: file.name,
68
+ cyfm_alt_text: additionalData?.altText || file.name,
69
+ cyfm_path: '', // Will be set by backend
70
+ cyfm_size_in_byte: file.size,
71
+ cyfm_type: file.type,
72
+ cyfm_creation_dt: new Date().toISOString(),
73
+ cyfm_id_user: additionalData?.userId || '',
74
+ cyfm_permissions: additionalData?.permissions || [],
75
+ cyfm_tags: additionalData?.tags || [],
76
+ cyfm_version: 1,
77
+ cyfm_file_status_sygmt: additionalData?.fileStatus || 'active',
78
+ cyfm_isactive: true,
79
+ fileData: base64Data, // Base64 file data
80
+ ...additionalData
81
+ };
82
+ this.http.post(cidePath.join([hostManagerRoutesUrl.cideSuiteHost, coreRoutesUrl?.module, 'upload']), payload)
83
+ .subscribe({
84
+ next: (response) => observer.next(response),
85
+ error: (error) => observer.error(error)
86
+ });
87
+ };
88
+ reader.onerror = () => observer.error('Failed to read file');
89
+ reader.readAsDataURL(file);
90
+ });
57
91
  }
58
92
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideLytFileManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
59
93
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideLytFileManagerService, providedIn: 'root' });
@@ -2493,8 +2527,8 @@ class CideLytSidedrawerWrapperComponent {
2493
2527
  }
2494
2528
  ngOnInit() {
2495
2529
  // Initialize the component map (You'd likely populate this from a config or service)
2496
- this.componentMap['drowar_notes'] = () => import('./cloud-ide-layout-sidedrawer-notes.component-CR5Lu8Ql.mjs').then(m => m.CideLytSidedrawerNotesComponent);
2497
- this.componentMap['drawer_theme'] = () => import('./cloud-ide-layout-drawer-theme.component-Djcie0s4.mjs').then(m => m.CideLytDrawerThemeComponent);
2530
+ this.componentMap['drowar_notes'] = () => import('./cloud-ide-layout-sidedrawer-notes.component-CbAOqthZ.mjs').then(m => m.CideLytSidedrawerNotesComponent);
2531
+ this.componentMap['drawer_theme'] = () => import('./cloud-ide-layout-drawer-theme.component-DMSGo6TQ.mjs').then(m => m.CideLytDrawerThemeComponent);
2498
2532
  }
2499
2533
  async loadComponent(configFor) {
2500
2534
  console.log('🔍 SIDEDRAWER - Loading component:', configFor, 'Current tab:', this.currentTabId);
@@ -2857,7 +2891,7 @@ var cloudIdeLayout_component = /*#__PURE__*/Object.freeze({
2857
2891
  const layoutRoutes = {
2858
2892
  path: "control-panel",
2859
2893
  loadComponent: () => Promise.resolve().then(function () { return cloudIdeLayout_component; }).then(c => c.CloudIdeLayoutComponent),
2860
- // canActivate: [authGuard]
2894
+ canActivate: [authGuard]
2861
2895
  };
2862
2896
  const layoutControlPannelChildRoutes = [{
2863
2897
  path: "",
@@ -2866,21 +2900,13 @@ const layoutControlPannelChildRoutes = [{
2866
2900
  },
2867
2901
  {
2868
2902
  path: "home",
2869
- loadComponent: () => import('./cloud-ide-layout-home-wrapper.component-BRXwSlxW.mjs').then(c => c.CideLytHomeWrapperComponent),
2903
+ loadComponent: () => import('./cloud-ide-layout-home-wrapper.component-CBwmG9lX.mjs').then(c => c.CideLytHomeWrapperComponent),
2904
+ canActivate: [authGuard],
2870
2905
  data: {
2871
2906
  reuseTab: true, // For CustomRouteReuseStrategy
2872
2907
  sypg_page_code: "cide_lyt_home" // Used by RequestService to fetch tab properties
2873
2908
  }
2874
2909
  }];
2875
- // {
2876
- // path: "admin-home",
2877
- // loadComponent: () => import('../../../cloud-ide-admin/src/lib/admin-module/home/home-wrapper/cide-adm-home-wrapper.component').then(c => c.CideAdmHomeWrapperComponent),
2878
- // data: {
2879
- // reuseTab: true, // For CustomRouteReuseStrategy
2880
- // sypg_page_code: "cide_adm_home" // Example: Ensure this page code is configured in your backend
2881
- // }
2882
- // }];
2883
- // ]
2884
2910
 
2885
2911
  // Define an InjectionToken for the environment configuration
2886
2912
  // This is needed to inject environment variables into services provided in 'root'
@@ -3139,5 +3165,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
3139
3165
  * Generated bundle index. Do not edit.
3140
3166
  */
3141
3167
 
3142
- export { AppStateHelperService as A, CideLytSharedWrapperComponent as C, ENVIRONMENT_CONFIG as E, CideLytSidebarService as a, CideLytRequestService as b, CideLytSidedrawerService as c, CideLytThemeService as d, CloudIdeLayoutService as e, CloudIdeLayoutComponent as f, CideLytSharedService as g, layoutControlPannelChildRoutes as h, CustomRouteReuseStrategy as i, AppStateService as j, CideLytUserStatusService as k, layoutRoutes as l, CacheManagerService as m, processThemeVariable as p, setCSSVariable as s, themeFactory as t };
3143
- //# sourceMappingURL=cloud-ide-layout-cloud-ide-layout-BTk05Q0R.mjs.map
3168
+ export { AppStateHelperService as A, CideLytSharedWrapperComponent as C, ENVIRONMENT_CONFIG as E, CideLytSidebarService as a, CideLytRequestService as b, CideLytSidedrawerService as c, CideLytThemeService as d, CloudIdeLayoutService as e, CloudIdeLayoutComponent as f, CideLytSharedService as g, layoutControlPannelChildRoutes as h, CustomRouteReuseStrategy as i, AppStateService as j, CideLytUserStatusService as k, layoutRoutes as l, CacheManagerService as m, CideLytFileManagerService as n, processThemeVariable as p, setCSSVariable as s, themeFactory as t };
3169
+ //# sourceMappingURL=cloud-ide-layout-cloud-ide-layout-DMcYKxZa.mjs.map