diff --git a/src/app/core/config/api-config.ts b/src/app/core/config/api-config.ts index dab1cb1fe6ba4daf7645fdb7861900132c833609..75c38fce6f29c940bfaa8614c9d9fa47f4d203bb 100644 --- a/src/app/core/config/api-config.ts +++ b/src/app/core/config/api-config.ts @@ -70,4 +70,28 @@ export const apiConfig = { withdrawPublishRequestUrl: '/api/publish/request/withdraw/', urlCatalogPath: '/api/catalog', urlSiteConfig: '/api/admin/config', + //design studio urls + urlDesignStudioBase: '/dsce/dsce/', + urlDesignStudioCatalog: 'solution/getSolutions', + urlDesignStudioTypeInfo: 'artifact/fetchJsonTOSCA', + urlDesignStudioCreate: 'solution/createNewCompositeSolution', + urlDesignStudioAddNode: 'solution/addNode', + urlDesignStudioAddLink: 'solution/addLink', + urlDesignStudioSave: 'solution/saveCompositeSolution', + urlDesignStudioValidate: 'solution/validateCompositeSolution', + urlDesignStudioSetProbe: 'solution/setProbeIndicator', + urlDesignStudioRead: 'solution/readCompositeSolutionGraph', + urlDesignStudioCatFormat: 'graphene', + urlDesignStudioSolution: '', + urlDesignStudioDeleteNode: 'solution/deleteNode', + urlDesignStudioDeleteLink: 'solution/deleteLink', + urlDesignStudioCloseCompositeSolution: 'solution/closeCompositeSolution ', + urlDesignStudioModifyNode: 'solution/modifyNode', + urlDesignStudioModifyLink: 'solution/modifyLink', + urlDesignStudioDeleteCompositeSolution: 'solution/deleteCompositeSolution', + urlDesignStudioClearCompositeSolution: 'solution/clearCompositeSolution', + urlDesignStudioGetCompositeSolutions: 'solution/getCompositeSolutions', + urlDesignStudioProtobuf: 'artifact/fetchProtoBufJSON', + urlDesignStudioGetMatchingModels: 'solution/getMatchingModels', + urlDesignStudioVersion: 'admin/getVersion', }; diff --git a/src/app/core/services/design-studio.service.ts b/src/app/core/services/design-studio.service.ts new file mode 100644 index 0000000000000000000000000000000000000000..bcf87a352354a06ffac4e01fe2ab9d54ae902703 --- /dev/null +++ b/src/app/core/services/design-studio.service.ts @@ -0,0 +1,1473 @@ +import { Injectable } from '@angular/core'; +import { HttpSharedService } from '../http-shared/http-shared.service'; +import { HttpClient } from '@angular/common/http'; +import { apiConfig } from '../config'; +import { UrlBuildService } from './url-build.service'; +import { + catchError, + firstValueFrom, + map, + Observable, + tap, + throwError, +} from 'rxjs'; +import { BrowserStorageService } from './storage/browser-storage.service'; + +@Injectable({ + providedIn: 'root', +}) +export class DesignStudioService { + userId$: Observable<string | undefined>; + userId!: string; + constructor( + private readonly _httpSharedService: HttpSharedService, + private urlBuildService: UrlBuildService, + private http: HttpClient, + private browserStorageService: BrowserStorageService, + ) { + this.userId$ = this.browserStorageService.getUserDetails().pipe( + map((details) => { + console.log({ details }); + this.userId = details?.userId || ''; + return details?.userId; + }), + ); + } + + getSiteConfig() { + return new Promise((resolve, reject) => { + try { + const response = { + status: null, + status_code: 0, + response_detail: 'SiteConfiguration fetched Successfully', + response_code: null, + response_body: { + created: '2021-09-15T20:11:30Z', + modified: '2023-11-06T21:36:24Z', + configKey: 'site_config', + configValue: + '{"fields":[{"type":"text","name":"siteInstanceName","label":"Site Instance Name","required":"true","data":"Graphene Dev02"},{"type":"heading","name":"ConnectionConfig","label":"Connection Configuration","required":"true","subFields":[{"type":"text","name":"socketTimeout","label":"Socket Timeout","required":"true","data":"300"},{"type":"text","name":"connectionTimeout","label":"Connection Timeout","required":"true","data":"10"}]},{"type":"select","name":"enableOnBoarding","label":"Enable On-Boarding","options":[{"name":"Enabled"},{"name":"Disabled"}],"required":true,"data":{"name":"Enabled"}},{"type":"select","name":"EnableDCAE","label":"Enable DCAE","options":[{"name":"Enabled"},{"name":"Disabled"}],"required":true,"data":{"name":"Disabled"}}]}', + userId: '12345678-abcd-90ab-cdef-1234567890ab', + }, + content: null, + error_code: '100', + }; + resolve(response); + } catch (error) { + reject(error); + } + }); + } + + getVersion() { + return new Promise((resolve, reject) => { + try { + const response = 3.1; + resolve(response); + } catch (error) { + reject(error); + } + }); + } + + getCloudEnabled() { + return new Promise((resolve, reject) => { + try { + const response = { + status: true, + status_code: 200, + response_detail: 'Success', + response_code: null, + response_body: + '[ { "cloudEnabled": "true", "cloudName": "azure", "cloudDisplayText": "Microsoft Azure", "imageUrl": "/images/deploy-cloud/microsoft_azure.png" }, { "cloudEnabled": "false", "cloudName": "gcp", "cloudDisplayText": "Google Cloud Platform", "imageUrl": "/images/deploy-cloud/google_cloud_platform.png" }, { "cloudEnabled": "true", "cloudName": "deploylocal", "cloudDisplayText": "Deploy To Local", "imageUrl": "/images/deploy-cloud/deploy_to_local.png" }, { "cloudEnabled": "false", "cloudName": "whitebox", "cloudDisplayText": "Deploy To White Box", "imageUrl": "/images/deploy-cloud/deploy_to_whitebox.png" }]', + content: null, + error_code: null, + }; + resolve(response); + } catch (error) { + reject(error); + } + }); + } + + getModeltype() { + return new Promise((resolve, reject) => { + try { + const response = { + status: null, + status_code: 0, + response_detail: 'ML Solutions Categories fetched Successfully', + response_code: null, + response_body: [ + { + code: 'DS', + name: 'Data Sources', + }, + { + code: 'DN', + name: 'Deep Neural Network', + }, + { + code: 'SY', + name: 'Symbolic', + }, + { + code: 'UT', + name: 'Utility', + }, + { + code: 'LL', + name: 'LLM', + }, + { + code: 'GA', + name: 'GenAI', + }, + { + code: 'CL', + name: 'Classification', + }, + { + code: 'DT', + name: 'Data Transformer', + }, + { + code: 'PR', + name: 'Prediction', + }, + { + code: 'RG', + name: 'Regression', + }, + ], + content: null, + error_code: '100', + }; + resolve(response); + } catch (error) { + reject(error); + } + }); + } + + getToolkitType() { + return new Promise((resolve, reject) => { + try { + const response = { + status: null, + status_code: 0, + response_detail: 'ML Solutions Categories fetched Successfully', + response_code: null, + response_body: [ + { + code: 'CP', + name: 'Composite Solution', + }, + { + code: 'MN', + name: 'Model Node', + }, + { + code: 'SF', + name: 'Shared Folder', + }, + { + code: 'DB', + name: 'Database', + }, + { + code: 'ME', + name: 'Metrics', + }, + { + code: 'BR', + name: 'Data Broker', + }, + { + code: 'CC', + name: 'C/C++', + }, + { + code: 'CO', + name: 'Collator', + }, + { + code: 'DA', + name: 'Data Source', + }, + { + code: 'DS', + name: 'Design Studio', + }, + { + code: 'H2', + name: 'H2O', + }, + { + code: 'IN', + name: 'Initializer', + }, + { + code: 'JS', + name: 'Java Spark', + }, + { + code: 'ON', + name: 'ONAP', + }, + { + code: 'OR', + name: 'Orchestrator', + }, + { + code: 'OX', + name: 'ONNX', + }, + { + code: 'PB', + name: 'Probe', + }, + { + code: 'PF', + name: 'PFA', + }, + { + code: 'RC', + name: 'R', + }, + { + code: 'SK', + name: 'Scikit-Learn', + }, + { + code: 'SP', + name: 'Splitter', + }, + { + code: 'TC', + name: 'Training Client', + }, + { + code: 'TF', + name: 'TensorFlow', + }, + ], + content: null, + error_code: '100', + }; + resolve(response); + } catch (error) { + reject(error); + } + }); + } + + getAccessType() { + return new Promise((resolve, reject) => { + try { + const response = { + status: null, + status_code: 0, + response_detail: 'ML Solutions Access type fetched Successfully', + response_code: null, + response_body: [ + { + code: 'PB', + name: 'Public', + }, + { + code: 'RS', + name: 'Restricted', + }, + ], + content: null, + error_code: '100', + }; + resolve(response); + } catch (error) { + reject(error); + } + }); + } + + getCatalog() { + return new Promise((resolve, reject) => { + try { + const response = { + items: [ + { + solutionId: '070ae960-c96e-458f-a237-6b90eca12169', + solutionRevisionId: 'c27acab6-9da4-41b1-b4a6-3b2b346d6dfe', + solutionName: 'ai4iot-data-source', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Tiago Veiga', + toolKit: 'SK', + category: 'DS', + createdDate: '2022-07-30-18-38-28-000', + duplicateSolution: false, + }, + { + solutionId: '08771a9e-e973-4298-bb77-8583b333adf0', + solutionRevisionId: '71b24b5d-f516-4f7a-9198-5da4efc1d22a', + solutionName: 'ai4iot-visualization', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Tiago Veiga', + toolKit: 'SK', + category: 'DT', + createdDate: '2022-07-30-18-45-38-000', + duplicateSolution: false, + }, + { + solutionId: '1c456769-55e7-479a-aa97-13906642e30a', + solutionRevisionId: '42f15921-d265-4922-8632-cc3907ce8c2a', + solutionName: 'i-nergy-load-forecasting', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: + 'Institute of Communication and Computer Systems. I NERGY', + toolKit: 'SK', + category: 'PR', + createdDate: '2022-07-30-18-29-18-000', + duplicateSolution: false, + }, + { + solutionId: '21dc8806-d59b-4370-96cb-4f189c0346ce', + solutionRevisionId: '6112fcbd-f61a-4ff2-9add-db4051a06115', + solutionName: 'trainer-model', + version: '1.0.0', + onBoarder: 'Swetha Lakshmana Murthy', + author: 'Swetha Lakshmana Murthy', + provider: 'Swetha Lakshmana Murthy', + toolKit: 'TF', + category: 'CL', + createdDate: '2023-07-21-14-48-58-000', + duplicateSolution: false, + }, + { + solutionId: '240bca8d-d223-4e0a-bb9c-5285c47ccf81', + solutionRevisionId: 'd288ef00-3827-457d-a534-e8e5d5728713', + solutionName: 'SharedFolderProvider', + version: '1.0.0', + onBoarder: 'Acumos Admin', + author: 'Acumos Admin', + provider: 'Fraunhofer IAIS', + toolKit: 'SF', + category: 'DT', + createdDate: '2021-09-16-15-39-38-000', + duplicateSolution: false, + }, + { + solutionId: '246833a2-4057-4e07-bea6-5119c68d5e91', + solutionRevisionId: '2b5a145a-ee9d-4471-b626-396654e87fd7', + solutionName: 'aspsolver-clingo-oneshot', + version: '1.0.0', + onBoarder: 'Martin Welss', + author: 'Martin Welss', + provider: 'Peter Schueller', + toolKit: 'SK', + category: 'CL', + createdDate: '2022-07-12-21-26-18-000', + duplicateSolution: false, + }, + { + solutionId: '2ebf4bdd-f4f1-4350-8f36-ea4ecf596fce', + solutionRevisionId: '387bc7a5-c16e-4dd6-a26f-9970a86d7721', + solutionName: 'sentimentanalysisdatabroker', + version: '1.0.0', + onBoarder: 'Chaitali P', + author: 'Chaitali P', + provider: 'Fraunhofer IAIS', + toolKit: 'TF', + category: 'PR', + createdDate: '2021-09-17-13-22-32-000', + duplicateSolution: false, + }, + { + solutionId: '2f9fac17-f401-4b8e-839f-068001a3c2c2', + solutionRevisionId: '3f4f110e-9874-41d9-ae91-a6a376e9d547', + solutionName: 'NewsDatabroker', + version: '1.0.0', + onBoarder: 'Martin Welss', + author: 'Martin Welss', + provider: 'Fraunhofer IAIS', + toolKit: 'SK', + category: 'DS', + createdDate: '2021-09-24-07-49-23-000', + duplicateSolution: false, + }, + { + solutionId: '307981d2-3121-44cc-b5d5-81d775a0cff1', + solutionRevisionId: '4a78e09b-57ab-46d5-bd75-c9de42c3bed8', + solutionName: 'NewsClassifier', + version: '1.0.0', + onBoarder: 'Swetha Lakshmana Murthy', + author: 'Swetha Lakshmana Murthy', + provider: 'Swetha Lakshmana Murthy', + toolKit: 'TF', + category: 'CL', + createdDate: '2023-07-21-14-35-02-000', + duplicateSolution: false, + }, + { + solutionId: '3553c4cf-046d-422c-9103-3a25b31b6de6', + solutionRevisionId: 'e47b8783-d691-4d82-9eb5-280b63cb8c25', + solutionName: 'ai4eu-cuh-medaplus', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'MedaPlus AI for healthcare', + toolKit: 'SK', + category: 'DT', + createdDate: '2022-08-05-15-48-13-000', + duplicateSolution: false, + }, + { + solutionId: '3f8727c5-154c-4ae5-a901-7487bfab530b', + solutionRevisionId: '4d796cd4-860a-4f18-8098-2969aefddcc2', + solutionName: 'sudoku-tutorial-gui-stream', + version: '1.0.0', + onBoarder: 'Martin Welss', + author: 'Martin Welss', + provider: 'Peter Schueller', + toolKit: 'SK', + category: 'DS', + createdDate: '2022-07-13-08-24-49-000', + duplicateSolution: false, + }, + { + solutionId: '40c5f2ba-5cd3-4d02-abd0-bce2bbedc036', + solutionRevisionId: 'bea7f9cf-0b51-430c-b554-2e8c7dfe65d4', + solutionName: 'WorkerCard-Preprocessing', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Kenzo Milleville', + toolKit: 'SK', + category: 'PR', + createdDate: '2022-07-19-07-56-45-000', + duplicateSolution: false, + }, + { + solutionId: '41102815-3c0c-466e-bb2b-46294073802d', + solutionRevisionId: 'cdf2b916-8308-4ab3-9590-2b7dd6e72bb0', + solutionName: 'LionForests', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Ioannis Mollas', + toolKit: 'SK', + category: 'DT', + createdDate: '2022-07-19-08-59-53-000', + duplicateSolution: false, + }, + { + solutionId: '4198b30c-ccdd-461f-97bb-c4fb8842109a', + solutionRevisionId: 'e54f37f3-dac0-4604-8a5e-e2b7dc0b6544', + solutionName: 'ML-Assistant-for-Vibration-Monitoring', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Viking Analytics AB', + toolKit: 'SK', + category: 'CL', + createdDate: '2022-07-04-13-28-23-000', + duplicateSolution: false, + }, + { + solutionId: '440a3fcb-5a20-4800-a829-14bf2531ee0f', + solutionRevisionId: '0c0ac284-955d-446d-9b2b-ff7d46387a6a', + solutionName: 'recognaizepreprocessing', + version: '1.0.1', + onBoarder: 'Tobias Elvermann', + author: 'Tobias Elvermann', + toolKit: 'TF', + category: 'DT', + createdDate: '2022-01-05-07-30-26-000', + duplicateSolution: false, + }, + { + solutionId: '440a3fcb-5a20-4800-a829-14bf2531ee0f', + solutionRevisionId: '2036bbcc-4999-4ec8-a7fe-b64c2aec7724', + solutionName: 'recognaizepreprocessing', + version: '1.0.0', + onBoarder: 'Tobias Elvermann', + author: 'Tobias Elvermann', + provider: 'Fraunhofer IAIS', + toolKit: 'TF', + category: 'DT', + createdDate: '2021-09-17-12-11-49-000', + duplicateSolution: false, + }, + { + solutionId: '47c1e48e-45e5-40f2-8354-578bfc044176', + solutionRevisionId: '46bb648e-c1fd-49c6-a92e-4629d375be7d', + solutionName: 'IoTxKG', + version: '1.0.0', + onBoarder: 'Tobias Elvermann', + author: 'Tobias Elvermann', + provider: 'Sebastian Heil', + toolKit: 'SK', + category: 'CL', + createdDate: '2022-07-04-07-57-09-000', + duplicateSolution: false, + }, + { + solutionId: '4a1b544e-7308-419c-af11-ba4630b7b33e', + solutionRevisionId: 'bfdde331-a136-4b2d-b13b-03b07d786742', + solutionName: 'innerpageanalysis', + version: '1.0.0', + onBoarder: 'Tobias Elvermann', + author: 'Tobias Elvermann', + provider: 'Ehsan Darestani Farahani', + toolKit: 'SK', + category: 'CL', + createdDate: '2022-07-13-12-33-52-000', + duplicateSolution: false, + }, + { + solutionId: '4cf2148e-571f-486c-a87d-18bd8653a5c9', + solutionRevisionId: '718e1b3f-d5c5-4911-834e-d7476436d462', + solutionName: 'recognaizeocr', + version: '1.0.0', + onBoarder: 'Tobias Elvermann', + author: 'Tobias Elvermann', + provider: 'Fraunhofer IAIS', + toolKit: 'TF', + category: 'DT', + createdDate: '2021-09-17-12-13-48-000', + duplicateSolution: false, + }, + { + solutionId: '5d836235-b448-433b-ab2a-8f9db466104a', + solutionRevisionId: '2825c9e9-e5d9-48dd-ab0e-c9f0a33afc97', + solutionName: 'ai4industry-skillmatcher-dummy', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Peter Schueller', + toolKit: 'SK', + category: 'DT', + createdDate: '2022-08-04-10-37-04-000', + duplicateSolution: false, + }, + { + solutionId: '5e627e44-8cf3-4793-b2a5-f63c94024b88', + solutionRevisionId: 'd1358a4a-636f-4944-bd80-392cf0054241', + solutionName: 'YoloV5', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'PhysicalAI', + toolKit: 'SK', + category: 'DS', + createdDate: '2022-08-05-15-03-49-000', + duplicateSolution: false, + }, + { + solutionId: '60957699-97b0-4e19-987b-b5efcd81e283', + solutionRevisionId: 'a3608dd9-22db-431f-8e1c-9bef556751e6', + solutionName: 'AI4Agri-qualitypredictor', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Sergio Salmeron', + toolKit: 'SK', + category: 'PR', + createdDate: '2022-07-30-18-59-12-000', + duplicateSolution: false, + }, + { + solutionId: '6153f0c7-89c8-40b4-b731-ec84ba2c446f', + solutionRevisionId: '017baf91-4d19-4b46-ac6f-c095db1aa7f7', + solutionName: 'hppmodel', + version: '1.0.0', + onBoarder: 'Sangamithra Panneer Selvam', + author: 'Sangamithra Panneer Selvam', + provider: 'Sangamithra Panneer Selvam', + toolKit: 'TF', + category: 'PR', + createdDate: '2023-09-28-18-03-11-000', + duplicateSolution: false, + }, + { + solutionId: '61dec13d-8441-40b1-8019-d68f4cd61370', + solutionRevisionId: '3521f632-b029-4a9f-a159-57525f819fb8', + solutionName: 'ai4industry-gui', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Peter Schueller', + toolKit: 'SK', + category: 'DT', + createdDate: '2022-08-04-09-31-25-000', + duplicateSolution: false, + }, + { + solutionId: '620ec698-4027-414a-8b9f-8d6503cbf35b', + solutionRevisionId: '86e0f4fd-694a-4ba2-ba9f-bb3db1dc850f', + solutionName: 'coverpageanalysis', + version: '1.0.0', + onBoarder: 'Tobias Elvermann', + author: 'Tobias Elvermann', + provider: 'Ehsan Darestani Farahani', + toolKit: 'SK', + category: 'CL', + createdDate: '2022-07-20-06-27-53-000', + duplicateSolution: false, + }, + { + solutionId: '639bc7c3-c1d3-4260-9a0c-d446cb886d9f', + solutionRevisionId: '9fbb5ef6-f443-4953-812d-c13c47eed6ed', + solutionName: 'recognaizeui', + version: '1.0.0', + onBoarder: 'Chaitali P', + author: 'Chaitali P', + provider: 'Fraunhofer IAIS', + toolKit: 'SK', + category: 'DS', + createdDate: '2021-09-17-11-56-34-000', + duplicateSolution: false, + }, + { + solutionId: '639bc7c3-c1d3-4260-9a0c-d446cb886d9f', + solutionRevisionId: 'c4b06844-c41b-4036-9021-e4bddba83591', + solutionName: 'recognaizeui', + version: '1.0.1', + onBoarder: 'Martin Welss', + author: 'Martin Welss', + toolKit: 'SK', + category: 'DS', + createdDate: '2022-08-17-20-16-43-000', + duplicateSolution: false, + }, + { + solutionId: '6958c0df-f06e-44d5-97f5-d0b593f2e186', + solutionRevisionId: '4e0ef62e-e884-4cde-8477-79d6f1b8caab', + solutionName: 'speech2text-en', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Gabriele De Luca', + toolKit: 'SK', + category: 'DT', + createdDate: '2022-07-30-18-12-17-000', + duplicateSolution: false, + }, + { + solutionId: '72cf5390-27f6-4877-b3e5-8d6b339ef5c8', + solutionRevisionId: '556da743-0c0b-44b9-be86-6ac40a45aea1', + solutionName: 'AI4agriNDVI', + version: '1.0.0', + onBoarder: 'Martin Welss', + author: 'Martin Welss', + provider: 'DLR', + toolKit: 'SK', + category: 'RG', + createdDate: '2022-07-01-20-19-11-000', + duplicateSolution: false, + }, + { + solutionId: '7be990b3-1987-4076-9c7c-7c1561deb15b', + solutionRevisionId: 'f27de166-90aa-4be6-ad55-36a6c41f8ecd', + solutionName: + 'traffic-scene-segmentation-deeplab-xception65-cityscapes', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Fraunhofer IAIS', + toolKit: 'SK', + category: 'PR', + createdDate: '2022-08-04-13-23-32-000', + duplicateSolution: false, + }, + { + solutionId: '8b661182-16e0-469b-ae0d-302649fa07d1', + solutionRevisionId: 'a6bc64a4-30b4-4689-8bed-f09f3e2fbdcf', + solutionName: 'sudoku-design-evaluator-stream', + version: '1.0.0', + onBoarder: 'Martin Welss', + author: 'Martin Welss', + provider: 'Peter Schueller', + toolKit: 'SK', + category: 'CL', + createdDate: '2022-07-13-07-56-01-000', + duplicateSolution: false, + }, + { + solutionId: '8bef5404-92fc-47e5-985a-6811cf2bc0d7', + solutionRevisionId: '67054e68-f123-466a-a3cb-de0b21156e2a', + solutionName: 'AI4Agri-frontend', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Javier Villazan', + toolKit: 'SK', + category: 'DS', + createdDate: '2022-07-30-19-09-27-000', + duplicateSolution: false, + }, + { + solutionId: '958390c9-35d5-47a3-9aac-40c9c66014e2', + solutionRevisionId: '628a51da-3b3a-40a2-8785-ec2caf15f209', + solutionName: 'sentimentanalysismodel', + version: '1.0.0', + onBoarder: 'Chaitali P', + author: 'Chaitali P', + provider: 'Fraunhofer IAIS', + toolKit: 'TF', + category: 'PR', + createdDate: '2021-09-17-13-24-01-000', + duplicateSolution: false, + }, + { + solutionId: '9c71947a-8ece-4dff-a466-96752b02d2fe', + solutionRevisionId: 'd36b5ac6-7439-460c-9cdd-43ae6159299b', + solutionName: 'recognaizesegmentation', + version: '1.0.0', + onBoarder: 'Tobias Elvermann', + author: 'Tobias Elvermann', + provider: 'Fraunhofer IAIS', + toolKit: 'TF', + category: 'DT', + createdDate: '2021-09-17-12-06-52-000', + duplicateSolution: false, + }, + { + solutionId: '9f0cb688-4c20-4e95-b15a-0d0bebba66ed', + solutionRevisionId: '07e5d9a9-aa38-4bf3-9967-4b854a8bbf80', + solutionName: 'ai4industry-planner', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Peter Schueller', + toolKit: 'SK', + category: 'DT', + createdDate: '2022-08-04-09-43-58-000', + duplicateSolution: false, + }, + { + solutionId: 'a3fa1b6d-8407-4186-86cf-f827babb61e2', + solutionRevisionId: '96d6c3ad-3438-4991-8669-ce420f68bd1d', + solutionName: 'cnext-decision-intelligence', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Cnext', + toolKit: 'SK', + category: 'PR', + createdDate: '2022-08-04-12-52-53-000', + duplicateSolution: false, + }, + { + solutionId: 'a7838c96-7c2e-4324-96f5-de39e06df849', + solutionRevisionId: '23a1da1a-afdb-4320-abb0-d80eac23a7d1', + solutionName: 'audio-file-broker', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Gabriele De Luca', + toolKit: 'SK', + category: 'DS', + createdDate: '2022-07-30-18-21-22-000', + duplicateSolution: false, + }, + { + solutionId: 'abb19627-1cdc-4666-b048-0259e865da0b', + solutionRevisionId: '547b7f6f-cf1f-42ee-bd51-9e895c935d50', + solutionName: 'ner-trainingconfig', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Fraunhofer IAIS', + toolKit: 'SK', + category: 'DS', + createdDate: '2022-12-05-16-23-12-000', + duplicateSolution: false, + }, + { + solutionId: 'b0baf808-d8a8-4076-98e9-1fd7877c7bc0', + solutionRevisionId: '883f021c-9579-4db7-bc89-786bd8b3c894', + solutionName: 'Time-prediction-for-example-manufacturing', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Joachim Koehler', + toolKit: 'SK', + category: 'RG', + createdDate: '2022-08-04-12-16-07-000', + duplicateSolution: false, + }, + { + solutionId: 'b42b4e1d-6fa1-4252-8485-06ecc449c681', + solutionRevisionId: '4f7938fd-a0df-46d9-976d-274be3fc6b39', + solutionName: 'ai4iot-calibration', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Tiago Veiga', + toolKit: 'SK', + category: 'PR', + createdDate: '2022-07-30-18-52-48-000', + duplicateSolution: false, + }, + { + solutionId: 'd42472f3-eeaf-44d3-a470-f18fa9535e87', + solutionRevisionId: '511c685c-ce9b-4205-8d05-f2c47d1c5028', + solutionName: 'ner-model', + version: '1.0.1', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + toolKit: 'SK', + category: 'PR', + createdDate: '2022-12-13-13-52-07-000', + duplicateSolution: false, + }, + { + solutionId: 'd42472f3-eeaf-44d3-a470-f18fa9535e87', + solutionRevisionId: 'e1a20fad-ba0e-4650-9eb1-e680bdf14a7b', + solutionName: 'ner-model', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Fraunhofer IAIS', + toolKit: 'SK', + category: 'PR', + createdDate: '2022-10-04-08-30-40-000', + duplicateSolution: false, + }, + { + solutionId: 'dcdd71f8-af91-4216-bac6-7ba30ada877f', + solutionRevisionId: '5224634c-c45a-4a22-8cc3-3e79ee2292e5', + solutionName: 'Tensorboard', + version: '1.0.1', + onBoarder: 'Martin Welss', + author: 'Martin Welss', + toolKit: 'TF', + category: 'DT', + createdDate: '2022-07-04-12-51-45-000', + duplicateSolution: false, + }, + { + solutionId: 'dcdd71f8-af91-4216-bac6-7ba30ada877f', + solutionRevisionId: 'e46f4043-7532-40ea-b4b5-6a9c5a80c8f7', + solutionName: 'Tensorboard', + version: '1.0.0', + onBoarder: 'Martin Welss', + author: 'Martin Welss', + provider: 'Fraunhofer IAIS', + toolKit: 'TF', + category: 'DT', + createdDate: '2021-09-24-09-44-38-000', + duplicateSolution: false, + }, + { + solutionId: 'e00358f1-06be-4439-8a46-a3b21d68ee49', + solutionRevisionId: 'ec7123d3-f3ea-4835-b688-05ae82bf7575', + solutionName: 'hppdatabroker', + version: '1.0.0', + onBoarder: 'Sangamithra Panneer Selvam', + author: 'Sangamithra Panneer Selvam', + provider: 'Sangamithra Panneer Selvam', + toolKit: 'TF', + category: 'PR', + createdDate: '2023-09-28-17-59-30-000', + duplicateSolution: false, + }, + { + solutionId: 'f6846b55-5bec-4796-8670-1dd11656c91c', + solutionRevisionId: 'b453c788-f20c-4e4b-a110-6be1f2ab224c', + solutionName: 'ner-databroker', + version: '1.0.0', + onBoarder: 'Andel Gugu', + author: 'Andel Gugu', + provider: 'Fraunhofer IAIS', + toolKit: 'SK', + category: 'DS', + createdDate: '2022-10-04-08-15-15-000', + duplicateSolution: false, + }, + { + solutionId: '0968973f-be2f-414f-ab82-a55ad3201b45', + solutionRevisionId: '03860107-2670-4c73-a19a-3b4bda92824c', + solutionName: 'model-test', + version: '1.0.3', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-06-04-10-20-27-000', + duplicateSolution: false, + }, + { + solutionId: '0968973f-be2f-414f-ab82-a55ad3201b45', + solutionRevisionId: '112a5936-eae0-4c04-ba4d-509bbabc6189', + solutionName: 'model-test', + version: '1.0.10', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-06-04-13-35-15-000', + duplicateSolution: false, + }, + { + solutionId: '0968973f-be2f-414f-ab82-a55ad3201b45', + solutionRevisionId: '2dd0a468-fb06-4e1d-a1e1-e4bcb20aa7d3', + solutionName: 'model-test', + version: '1.0.7', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-06-04-10-37-51-000', + duplicateSolution: false, + }, + { + solutionId: '0968973f-be2f-414f-ab82-a55ad3201b45', + solutionRevisionId: '364b7b17-5141-44fa-a50a-860635713329', + solutionName: 'model-test', + version: '1.0.5', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-06-04-10-34-36-000', + duplicateSolution: false, + }, + { + solutionId: '0968973f-be2f-414f-ab82-a55ad3201b45', + solutionRevisionId: '3fb239b7-4a36-4ca3-abb4-30cd1f831115', + solutionName: 'model-test', + version: '1.0.1', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-05-30-19-29-50-000', + duplicateSolution: false, + }, + { + solutionId: '0968973f-be2f-414f-ab82-a55ad3201b45', + solutionRevisionId: '8372138a-268d-44cc-a0fd-ef3096b6e6bc', + solutionName: 'model-test', + version: '1.0.9', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-06-04-13-22-16-000', + duplicateSolution: false, + }, + { + solutionId: '0968973f-be2f-414f-ab82-a55ad3201b45', + solutionRevisionId: 'a7699e9c-9e88-4c4c-af60-036765d90ef7', + solutionName: 'model-test', + version: '1.0.2', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-05-30-19-31-10-000', + duplicateSolution: false, + }, + { + solutionId: '0968973f-be2f-414f-ab82-a55ad3201b45', + solutionRevisionId: 'b1a9559b-e201-4faa-8692-e6928205b5e2', + solutionName: 'model-test', + version: '1.0.8', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-06-04-13-17-50-000', + duplicateSolution: false, + }, + { + solutionId: '0968973f-be2f-414f-ab82-a55ad3201b45', + solutionRevisionId: 'b70620b1-6a91-45a1-9b68-79e0a13e496e', + solutionName: 'model-test', + version: '1.0.4', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-06-04-10-29-43-000', + duplicateSolution: false, + }, + { + solutionId: '0968973f-be2f-414f-ab82-a55ad3201b45', + solutionRevisionId: 'bffc7d08-7a8a-4429-85cd-f4865e8f76a8', + solutionName: 'model-test', + version: '1.0.0', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-05-30-17-09-16-000', + duplicateSolution: false, + }, + { + solutionId: '0968973f-be2f-414f-ab82-a55ad3201b45', + solutionRevisionId: 'f7573766-3585-4969-a637-88e600730264', + solutionName: 'model-test', + version: '1.0.6', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-06-04-10-37-00-000', + duplicateSolution: false, + }, + { + solutionId: '30ed65c9-1c57-474f-b7a5-65ebe1688ba5', + solutionRevisionId: 'c5e535d3-c5d1-447c-afad-c10fa7924f4c', + solutionName: 'model-test-4', + version: '1.0.0', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + toolKit: 'BR', + category: 'CL', + createdDate: '2024-05-30-19-43-21-000', + duplicateSolution: false, + }, + { + solutionId: '5651d17b-0edb-4770-9d57-5da73ea417f6', + solutionRevisionId: 'bd9e4988-4037-4435-a250-8f5d79a7032f', + solutionName: 'model-test-5-test-5', + version: '1.0.0', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + toolKit: 'BR', + category: 'CL', + createdDate: '2024-05-30-19-44-40-000', + duplicateSolution: false, + }, + { + solutionId: '7d5c891c-0461-4d72-900e-04f2d49d206c', + solutionRevisionId: '447a502f-4da6-43df-a55c-6d80703ad43e', + solutionName: 'model-test-3', + version: '1.0.0', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + createdDate: '2024-05-30-19-40-01-000', + duplicateSolution: false, + }, + { + solutionId: 'a847f714-dfde-4e3c-b295-ef23b770ebe1', + solutionRevisionId: 'c963e827-58ff-45e1-b449-ebe6047321d6', + solutionName: 'model-test6', + version: '1.0.0', + onBoarder: 'Kawtar Laariche', + author: 'Kawtar Laariche', + toolKit: 'BR', + category: 'CL', + createdDate: '2024-06-19-11-13-23-000', + duplicateSolution: false, + }, + ], + }; + resolve(response); + } catch (error) { + reject(error); + } + }); + } + + getCompositeSolutions() { + return new Promise((resolve, reject) => { + try { + const response = { + items: [ + { + solutionId: '409dcaf6-9086-42ff-a6b7-244edf59071d', + solutionName: 'recognaize-solution', + version: '2', + ownerId: 'Martin Welss', + provider: 'Fraunhofer IAIS', + toolKit: 'CP', + category: 'PR', + description: 'null', + visibilityLevel: 'PB', + isDuplicateSolution: 'false', + created: '2022-08-17-20-22-03-000', + icon: 'null', + }, + { + solutionId: '61a33ac7-323f-4492-b3bb-fc9482218af9', + solutionName: 'AI4IndustryPilot', + version: '2', + ownerId: 'Andel Gugu', + provider: 'Raoul Blankertz', + toolKit: 'CP', + category: 'PR', + description: 'null', + visibilityLevel: 'PB', + isDuplicateSolution: 'false', + created: '2022-08-04-12-29-10-000', + icon: 'null', + }, + { + solutionId: '64f3c1d3-fbf4-4de3-a5a4-27eeaf616614', + solutionName: 'Sudoku-Tutorial', + version: '1', + ownerId: 'Martin Welss', + provider: 'Peter Schueller', + toolKit: 'CP', + category: 'PR', + description: 'null', + visibilityLevel: 'PB', + isDuplicateSolution: 'false', + created: '2022-07-13-09-38-05-000', + icon: 'null', + }, + { + solutionId: '9f4b4eb1-d115-4970-9e5f-6d67663efcba', + solutionName: 'houseprice-pipeline', + version: '1', + ownerId: 'Sangamithra Panneer Selvam', + provider: 'Acumos', + toolKit: 'CP', + category: 'PR', + description: 'null', + visibilityLevel: 'PB', + isDuplicateSolution: 'false', + created: '2023-09-28-18-14-08-000', + icon: 'null', + }, + { + solutionId: 'b0b2eae5-d722-4a5a-9818-f726eb07af86', + solutionName: 'TrainingPipeline', + version: 'v2', + ownerId: 'Swetha Lakshmana Murthy', + provider: 'Swetha Lakshmana Murthy', + toolKit: 'CP', + category: 'CL', + description: 'null', + visibilityLevel: 'PB', + isDuplicateSolution: 'false', + created: '2023-07-24-07-22-43-000', + icon: 'null', + }, + { + solutionId: 'bda223d1-2f0a-487c-92e2-9ac6202f2591', + solutionName: 'named-entity-recognition', + version: '1.0', + ownerId: 'Andel Gugu', + provider: 'Fraunhofer IAIS', + toolKit: 'CP', + category: 'PR', + description: 'null', + visibilityLevel: 'PB', + isDuplicateSolution: 'false', + created: '2023-01-04-10-15-53-000', + icon: 'null', + }, + { + solutionId: 'fb13977a-6d91-4bb0-8077-c0f08cfa7b01', + solutionName: 'sentiment-analysis-pipeline', + version: '1', + ownerId: 'Martin Welss', + provider: 'Fraunhofer IAIS', + toolKit: 'CP', + category: 'CL', + description: 'null', + visibilityLevel: 'PB', + isDuplicateSolution: 'false', + created: '2022-08-21-21-03-53-000', + icon: 'null', + }, + ], + }; + resolve(response); + } catch (error) { + reject(error); + } + }); + } + + createNewCompositeSolution() { + return new Promise((resolve, reject) => { + try { + const response = { + cid: '12d23d23d-d23c23c2c-2c223-gb34f5h', + success: 'true', + errorMessage: '', + }; + resolve(response); + } catch (error) { + reject(error); + } + }); + } + + displayProperties() { + return new Promise((resolve, reject) => { + try { + const response = { + self: { + version: '1.0.0', + name: 'ai4eu-cuh-medaplus', + description: {}, + component_type: 'Docker', + }, + streams: {}, + services: { + calls: [ + { + config_key: 'getData', + request: { + streaming: false, + format: [ + { + messageName: 'Response', + messageargumentList: [ + { role: '', name: 'data', tag: '1', type: 'string' }, + ], + }, + ], + version: '', + }, + response: { format: [], version: '' }, + }, + { + config_key: 'mountVolume', + request: { + streaming: false, + format: [ + { + messageName: 'SharedFolderStatus', + messageargumentList: [ + { role: '', name: 'success', tag: '1', type: 'bool' }, + ], + }, + ], + version: '', + }, + response: { format: [], version: '' }, + }, + ], + provides: [ + { + route: 'getData', + request: { + streaming: false, + format: [ + { + messageName: 'Request', + messageargumentList: [ + { role: '', name: 'path', tag: '1', type: 'string' }, + ], + }, + ], + version: '', + }, + response: { format: [], version: '' }, + }, + { + route: 'mountVolume', + request: { + streaming: false, + format: [ + { + messageName: 'SharedFolderRequest', + messageargumentList: [ + { role: '', name: 'path', tag: '1', type: 'string' }, + ], + }, + ], + version: '', + }, + response: { format: [], version: '' }, + }, + ], + }, + parameters: [], + auxiliary: {}, + artifacts: [], + }; + resolve(response); + } catch (error) { + reject(error); + } + }); + } + + async getProtoBufJSON(solutionId: string, version: string): Promise<any> { + // Retrieve the userId from the Observable + const userId = await firstValueFrom(this.userId$); + + // Handle the case where userId is undefined + if (!userId) { + throw new Error('User ID is undefined'); + } + + const url = this.urlBuildService.buildUrl( + apiConfig.urlDesignStudioProtobuf, + { + userId, + solutionId, + version, + }, + ); + + return firstValueFrom( + this._httpSharedService + .get(url) + .pipe(catchError((error) => throwError(error))), + ); + } + + getTypeInfo() { + return new Promise((resolve, reject) => { + try { + const response = { + self: { + version: '1.0.0', + name: 'ai4eu-cuh-medaplus', + description: {}, + component_type: 'Docker', + }, + streams: {}, + services: { + calls: [ + { + config_key: 'getData', + request: { + streaming: false, + format: [ + { + messageName: 'Response', + messageargumentList: [ + { role: '', name: 'data', tag: '1', type: 'string' }, + ], + }, + ], + version: '', + }, + response: { format: [], version: '' }, + }, + { + config_key: 'mountVolume', + request: { + streaming: false, + format: [ + { + messageName: 'SharedFolderStatus', + messageargumentList: [ + { role: '', name: 'success', tag: '1', type: 'bool' }, + ], + }, + ], + version: '', + }, + response: { format: [], version: '' }, + }, + ], + provides: [ + { + route: 'getData', + request: { + streaming: false, + format: [ + { + messageName: 'Request', + messageargumentList: [ + { role: '', name: 'path', tag: '1', type: 'string' }, + ], + }, + ], + version: '', + }, + response: { format: [], version: '' }, + }, + { + route: 'mountVolume', + request: { + streaming: false, + format: [ + { + messageName: 'SharedFolderRequest', + messageargumentList: [ + { role: '', name: 'path', tag: '1', type: 'string' }, + ], + }, + ], + version: '', + }, + response: { format: [], version: '' }, + }, + ], + }, + parameters: [], + auxiliary: {}, + artifacts: [], + }; + resolve(response); + } catch (error) { + reject(error); + } + }); + } + + async getFetchJsonTOSCA(solutionId: string, version: string): Promise<any> { + // Retrieve the userId from the Observable + const userId = await firstValueFrom(this.userId$); + + // Handle the case where userId is undefined + if (!userId) { + throw new Error('User ID is undefined'); + } + + const url = this.urlBuildService.buildUrl( + apiConfig.urlDesignStudioTypeInfo, + { userId, solutionId, version }, + ); + + return firstValueFrom( + this._httpSharedService + .get(url) + .pipe(catchError((error) => throwError(error))), + ); + } + + buildURlGetFetchJsonTOSCA(solutionId: string, version: string): string { + const userId = this.userId; + + // Handle the case where userId is undefined + if (!userId) { + throw new Error('User ID is undefined'); + } + return this.urlBuildService.buildUrl(apiConfig.urlDesignStudioTypeInfo, { + userId, + solutionId, + version, + }); + } + + async addNode(solutionId: string, version: string): Promise<any> { + // Retrieve the userId from the Observable + const userId = await firstValueFrom(this.userId$); + + // Handle the case where userId is undefined + if (!userId) { + throw new Error('User ID is undefined'); + } + + const url = this.urlBuildService.buildUrl( + apiConfig.urlDesignStudioAddNode, + { userId, solutionId, version }, + ); + + return firstValueFrom( + this._httpSharedService + .get(url) + .pipe(catchError((error) => throwError(error))), + ); + } + + httpGet(url: string, params: any) { + console.log({ url }); + console.log({ params }); + + return firstValueFrom( + this._httpSharedService + .get(apiConfig.apiBackendURL + '/' + url, params) + .pipe( + tap((result) => { + console.log({ result }); + }), + ), + ); + } + + httpPost(url: string, body: any) { + console.log({ url }); + console.log({ body }); + const urlPost = apiConfig.apiBackendURL + '/' + url; + return firstValueFrom(this._httpSharedService.post(urlPost, body)); + } +} diff --git a/src/app/core/services/url-build.service.spec.ts b/src/app/core/services/url-build.service.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..3bbd831f8209dda0d7d381eb6ea0de45a164d9c1 --- /dev/null +++ b/src/app/core/services/url-build.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { UrlBuildService } from './url-build.service'; + +describe('UrlBuildService', () => { + let service: UrlBuildService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(UrlBuildService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/core/services/url-build.service.ts b/src/app/core/services/url-build.service.ts new file mode 100644 index 0000000000000000000000000000000000000000..0da3114d68bb229281f546f6742a8d47a84acd88 --- /dev/null +++ b/src/app/core/services/url-build.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@angular/core'; +import { apiConfig } from '../config'; + +@Injectable({ + providedIn: 'root', +}) +export class UrlBuildService { + constructor() {} + + buildUrl(verb: string, params: any): string { + return `${apiConfig.apiBackendURL}${ + apiConfig.urlDesignStudioBase + }${verb}?${Object.keys(params) + .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`) + .join('&')}`; + } +} diff --git a/src/app/features/dashboard/design-studio/design-studio.component.html b/src/app/features/dashboard/design-studio/design-studio.component.html index a5bc2e1a84b992db2a5c7d2c4a9162874228ac7b..8a84afff8dca5026f310b59ab8f4d6cb2a1cf95a 100644 --- a/src/app/features/dashboard/design-studio/design-studio.component.html +++ b/src/app/features/dashboard/design-studio/design-studio.component.html @@ -1 +1 @@ -<p>design-studio works!</p> +<div ng-view></div> diff --git a/src/app/features/dashboard/design-studio/design-studio.component.ts b/src/app/features/dashboard/design-studio/design-studio.component.ts index 64f626cc6f496b0c428b57560039bf53b06b5832..0b8409aaab2272c349d4191b00f5994ba852dd0e 100644 --- a/src/app/features/dashboard/design-studio/design-studio.component.ts +++ b/src/app/features/dashboard/design-studio/design-studio.component.ts @@ -1,13 +1,22 @@ -import { Component } from '@angular/core'; -import { CommonModule } from '@angular/common'; +import { Component, OnInit } from '@angular/core'; +import { UpgradeModule } from '@angular/upgrade/static'; +import { downgradeInjectable } from '@angular/upgrade/static'; +import { DesignStudioService } from 'src/app/core/services/design-studio.service'; + +declare var angular: any; +angular + .module('designStudio') + .factory('ApiService', downgradeInjectable(DesignStudioService)); @Component({ - selector: 'gp-design-studio', - standalone: true, - imports: [CommonModule], + selector: 'app-design-studio', templateUrl: './design-studio.component.html', - styleUrl: './design-studio.component.scss' + styleUrl: './design-studio.component.scss', }) -export class DesignStudioComponent { +export class DesignStudioComponent implements OnInit { + constructor(private upgrade: UpgradeModule) {} + ngOnInit(): void { + this.upgrade.bootstrap(document.body, ['designStudio']); + } } diff --git a/src/app/features/dashboard/design-studio/design-studio.module.ts b/src/app/features/dashboard/design-studio/design-studio.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..d2e8a7e55a5d40393ff43f13c95bc595a4f007a7 --- /dev/null +++ b/src/app/features/dashboard/design-studio/design-studio.module.ts @@ -0,0 +1,25 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { DesignStudioComponent } from './design-studio.component'; +import { UpgradeModule } from '@angular/upgrade/static'; +import { RouterModule, Routes } from '@angular/router'; + +const routes: Routes = [ + { + path: '', + component: DesignStudioComponent, + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class AppRoutingModule {} + +@NgModule({ + declarations: [DesignStudioComponent], + imports: [CommonModule, UpgradeModule, AppRoutingModule], + exports: [DesignStudioComponent], +}) +export class DesignStudioModule {}