Skip to content

Commit

Permalink
removed plugin as deployment option
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed Jan 14, 2025
1 parent bd85366 commit e5aeceb
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
18 changes: 10 additions & 8 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,37 @@ Make sure that you subscribe the microservice to your tenant when prompted

### Web app

The frontend can be used in two variants in your tenant:
The frontend can be deployed in your tenant:

1. As a **UI Plugin** to extend existing applications
2. As a **Blueprint** standalone Application selectable from the App switcher
1. As a **Blueprint** standalone Application selectable from the App switcher

> **_NOTE:_** The option to deploy the dynamic mapper as plugin is deprecated.
#### Community store (Preferred)

The Web App is part of the community store and should be available directly in your tenant under
"Administration" -> "Ecosystem" -> "Extensions" -> "Dynamic-mapping". Here you have the choice to install it as a plugin or as a blueprint app.

##### Plugin
> **_NOTE:_** The option to deploy the dynamic mapper as plugin is deprecated.
##### ~~Plugin~~

> **_NOTE:_** For a plugin we need to clone the Administration app to add the plugin to it
> **_NOTE:_** ~~For a plugin we need to clone the Administration app to add the plugin to i~~
Go to "All Applications" and click on "Add Application". Select "Duplicate existing application" and afterward "Administration".
~~Go to "All Applications" and click on "Add Application". Select "Duplicate existing application" and afterward "Administration".~~

<p align="center">
<img src="resources/image/Dynamic_Mapper_DuplicateApp.png" style="width: 40%;" />
</p>
<br/>

Now select the cloned Administration App and go to the "Plugin" Tab. Click on "Install Plugin" and select "Dynamic Data Mapper Widget"
~~Now select the cloned Administration App and go to the "Plugin" Tab. Click on "Install Plugin" and select "Dynamic Data Mapper Widget"~~

<p align="center">
<img src="resources/image/Dynamic_Mapper_Installation_Plugin.png" style="width: 50%;" />
</p>
<br/>

After successfully adding the plugin you need to refresh the Administration App by pressing F5 and you should see a new navigation entry "Dynamic Mapping"
~~After successfully adding the plugin you need to refresh the Administration App by pressing F5 and you should see a new navigation entry "Dynamic Mapping"~~

<p align="center">
<img src="resources/image/Dynamic_Mapper_WebAppPlugin.png" style="width: 40%;" />
Expand Down
16 changes: 8 additions & 8 deletions dynamic-mapping-ui/cumulocity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ export default {
noAppSwitcher: false,
package: 'blueprint',
isPackage: true,
exports: [
{
name: 'Dynamic Mapping Mapper Plugin',
module: 'DynamicMappingModule',
path: './src/dynamic-mapping.module.ts',
description: 'Adds a Dynamic Mapping Mapper Plugin'
}
]
// exports: [
// {
// name: 'Dynamic Mapping Mapper Plugin',
// module: 'DynamicMappingModule',
// path: './src/dynamic-mapping.module.ts',
// description: 'Adds a Dynamic Mapping Mapper Plugin'
// }
// ]
},
buildTime: {
copy: [
Expand Down
18 changes: 17 additions & 1 deletion dynamic-mapping-ui/src/mapping/shared/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,25 @@ export const TOKEN_CONTEXT_DATA = '_CONTEXT_DATA_';
export const CONTEXT_DATA_KEY_NAME = 'key';
export const TIME = 'time';

// export function splitTopicExcludingSeparator(topic: string): string[] {
// let topix = topic;
// topix = topix.trim().replace(/(\/{1,}$)|(^\/{1,})/g, '');
// return topix.split(/\//g);
// }

export function splitTopicExcludingSeparator(topic: string): string[] {
let topix = topic;
topix = topix.trim().replace(/(\/{1,}$)|(^\/{1,})/g, '');
topix = topix.trim().replace(/(\/{1,}$)/g, ''); // Remove trailing slashes
if (topix.startsWith('//')) { // If there are multiple leading slashes
topix = '/' + topix.replace(/^\/+/, ''); // Replace with single slash
}

// Special handling for the first slash
if (topix.startsWith('/')) {
const parts = topix.substring(1).split(/\//g);
return ['/'].concat(parts);
}

return topix.split(/\//g);
}

Expand Down

0 comments on commit e5aeceb

Please sign in to comment.