Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.1.1 release #100

Merged
merged 156 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
c959a0f
Non-working- upgraded with 1013
DarpanLalani May 2, 2022
d67f171
initial commit
DarpanLalani Aug 23, 2022
287d3f3
initial commit 2
DarpanLalani Aug 23, 2022
d520542
Merge remote-tracking branch 'origin/dev' into 1.4.0-dev-1
DarpanLalani Aug 23, 2022
c8947cf
updated version and image fix
DarpanLalani Aug 23, 2022
86c6f5e
optimized AppService calls
DarpanLalani Aug 29, 2022
8a52afc
updated with 1015
DarpanLalani Sep 5, 2022
1453de0
updated with plugin support in widget catalog
DarpanLalani Sep 5, 2022
52983fa
Added validation for simulators
SheethalJR Sep 8, 2022
4a2b1b2
Merge branch '1.4.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Sep 8, 2022
3c6af3a
widget catalog upgraded to support plugins
DarpanLalani Sep 8, 2022
3f74007
reverted code in simulator manager service
DarpanLalani Sep 8, 2022
5e292cc
Merge branch '1.4.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
DarpanLalani Sep 8, 2022
59c8b28
ngx-echart added as part of app builder core build
DarpanLalani Sep 12, 2022
ce4b62c
Added plugin specific code changes in widget details component
SheethalJR Sep 13, 2022
6af0b02
Merge branch '1.4.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Sep 13, 2022
9895d84
plugin verfication feature implemented
DarpanLalani Sep 14, 2022
d059198
Merge branch '1.4.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
DarpanLalani Sep 14, 2022
1b49aaf
Added progress indicator while installing,updating and deleting plugins
SheethalJR Sep 14, 2022
1e48f20
Merge branch '1.4.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Sep 14, 2022
fcfb965
updated plugin verification logic
DarpanLalani Sep 14, 2022
fc39502
Merge branch '1.4.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
DarpanLalani Sep 14, 2022
ac69b2e
Hide progress modal after uninstall
SheethalJR Sep 14, 2022
5b74b98
Merge branch '1.4.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Sep 14, 2022
17cca46
upgraded timeout
DarpanLalani Sep 14, 2022
a70faf6
Merge branch '1.4.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
DarpanLalani Sep 14, 2022
5778164
updated delaytimeout
DarpanLalani Sep 14, 2022
d391a39
removed echart widget module
DarpanLalani Sep 14, 2022
1517218
CSS Changes in widget catalog
SheethalJR Sep 14, 2022
e7cd04e
Merge branch '1.4.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Sep 14, 2022
c321a2b
Added pluginType entry in grid and list view, fixed simulator issue
SheethalJR Sep 19, 2022
501d70d
Dashboard Catalog Changes to Support Plugins
SheethalJR Sep 20, 2022
c856a4d
Code changes w.r.t Plugin Install/Uninstall/Update
SheethalJR Sep 26, 2022
6de6f0a
Lock Dashboard, Search Dashboard and Branding Issue related code changes
SheethalJR Oct 6, 2022
9d82b7b
updated for seamless upgrade from 1.3.x to 1.4.x
DarpanLalani Oct 10, 2022
7b56c72
Merge branch 'dev' of https://github.com/SoftwareAG/cumulocity-app-bu…
DarpanLalani Oct 10, 2022
ac526ab
updated package.json
DarpanLalani Oct 10, 2022
746d512
updated with dev branch and verify widget update for seamless upgrade…
DarpanLalani Oct 10, 2022
7e86197
Search Dashboard With Reordering Issue Fixed
SheethalJR Oct 11, 2022
4d5bc94
Merge branch 'dev' of https://github.com/SoftwareAG/cumulocity-app-bu…
SheethalJR Oct 11, 2022
11aff58
Branding issue fixed
SheethalJR Oct 11, 2022
17dae50
Lock Dashboard code issue fix
SheethalJR Oct 11, 2022
7438d9a
Lock Unlock icon css, branding issue fix when primary color is white
SheethalJR Oct 11, 2022
63e1bf6
Drag and drop issue fixed
SheethalJR Oct 12, 2022
8215d4c
Drag and Drop issue fix on search
SheethalJR Oct 17, 2022
ebdec4b
plugin installation
DarpanLalani Oct 18, 2022
3c4f030
search dashboard issue fix and simulator code change to add required …
SheethalJR Oct 18, 2022
9cd6328
Branding issue w.r.t pagination
SheethalJR Oct 18, 2022
014c35f
added overall progress bar and changed widget catalog to plugin catalog
DarpanLalani Oct 19, 2022
8200feb
updated with upgrade changes
DarpanLalani Oct 20, 2022
fb2ca6f
updated with plugin message
DarpanLalani Oct 21, 2022
7787e8e
added context-path condition to restict app builder upgrade notification
DarpanLalani Oct 21, 2022
0130409
dashboard catalog changes
SheethalJR Oct 21, 2022
b62816f
Merge branch 'dev' of https://github.com/SoftwareAG/cumulocity-app-bu…
SheethalJR Oct 21, 2022
ab5482e
initial commit with version upgrade
DarpanLalani Dec 5, 2022
5f29ff7
1.3.2 dev (#76)
SheethalJR Dec 7, 2022
b3ef53d
updated with new plugin service api integration
DarpanLalani Dec 8, 2022
629ae6c
updated readme for 1.3.2 release
DarpanLalani Dec 8, 2022
e02fda5
updated readme
DarpanLalani Dec 8, 2022
323d7a2
1.3.2 dev (#77)
SheethalJR Dec 8, 2022
cc33f9b
updated readme
DarpanLalani Dec 9, 2022
06ef13d
1.3.2 dev (#78)
SheethalJR Dec 9, 2022
0310be2
updated version
DarpanLalani Dec 13, 2022
8be5d7a
updated for dev testing
DarpanLalani Dec 13, 2022
f9ca6bd
Merge remote-tracking branch 'origin/dev' into 2.0.0-dev-1
DarpanLalani Dec 14, 2022
1cd194b
update with remove unused binary and upgrade service merge fixed
DarpanLalani Dec 14, 2022
d298dd7
Fixed issues
SheethalJR Dec 30, 2022
5b860f6
added code for c8y1015 compatibility
DarpanLalani Jan 10, 2023
da9f946
Reverted catalog name to widget catalog
DarpanLalani Jan 10, 2023
ed72ff3
external asset service updated
DarpanLalani Jan 11, 2023
dca9a71
updated error handling in template catalog json
DarpanLalani Jan 12, 2023
7d79a7e
code updated for preprod branch
DarpanLalani Jan 13, 2023
b75b87e
Dynamic select of dev/preprod branch, css fix in widget catalog and e…
SheethalJR Jan 17, 2023
a522473
Upgraded c8y to 1016.0.93
SheethalJR Jan 24, 2023
a25fa3d
updated by removing basic auth in simulator
DarpanLalani Jan 24, 2023
f612787
Merge branch '2.0.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
DarpanLalani Jan 24, 2023
6738700
Fixed undefined error in Applications page
SheethalJR Jan 27, 2023
0aaeb09
updated with subscribe tenant fix. error handling incase of widget is…
DarpanLalani Feb 1, 2023
8b6bd64
updated message for subscribed app builder
DarpanLalani Feb 2, 2023
ae2756d
updated to 1016.0.109
DarpanLalani Feb 6, 2023
2eb291d
updated with selectable dashboard path
DarpanLalani Feb 8, 2023
743461f
url modified for template details
DarpanLalani Feb 8, 2023
6ec6117
added support for assets in dashboard catalog
DarpanLalani Feb 9, 2023
5d20a19
updated error handling in verify plugin
DarpanLalani Feb 9, 2023
ca127b7
Added Under Maintenance Code
SheethalJR Feb 9, 2023
0ba0d88
Merge branch '2.0.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Feb 9, 2023
2bf277a
Updated under maintenance check
SheethalJR Feb 9, 2023
c2e6a5e
Merge branch 'master' into dev
DarpanLalani Feb 15, 2023
a8c1ea0
1.3.3 dev (#81)
SheethalJR Feb 16, 2023
a4a1dc8
change label
DarpanLalani Feb 20, 2023
1439cb6
demo catalog multiple version support added
DarpanLalani Feb 21, 2023
139d17e
added support for multiple demo catalog version
DarpanLalani Feb 21, 2023
59ea15c
added iscompatible check
SheethalJR Feb 21, 2023
9e9bd5e
Custom Branding and Branding Issue Code Changes
SheethalJR Feb 22, 2023
dbf3cf4
Merge branch '2.0.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Feb 22, 2023
c8e5835
Changes in app list component
SheethalJR Feb 23, 2023
570f6ae
Fixed issue in verify widget compatibility method
SheethalJR Feb 23, 2023
2576dc7
Custom Branding issue fixed
SheethalJR Feb 24, 2023
add6dcc
Fixed Custom Branding Issue
SheethalJR Feb 24, 2023
94d2cdc
Updated condition in findInstalledWidget method
SheethalJR Mar 2, 2023
b5a5342
RC flag removed
DarpanLalani Mar 6, 2023
7d44b30
updated readme
DarpanLalani Mar 6, 2023
51c4631
Updated readme for 1.3.3 release
DarpanLalani Mar 6, 2023
6705378
update implementation to get list of packages
DarpanLalani Mar 7, 2023
1db3a9d
Custom Branding Code Changes and fixed other issues
SheethalJR Mar 7, 2023
8bdcfcf
Merge branch '2.0.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Mar 7, 2023
4ded912
Code Changes w.r.t direct install of app builder from administration
SheethalJR Mar 14, 2023
f844993
Merge branch 'master' into dev
DarpanLalani Mar 20, 2023
55ff160
Bug fix for app with context path (#83)
DarpanLalani Mar 23, 2023
415549b
bug fix for app with context path
DarpanLalani Mar 23, 2023
2ef5d20
Changes while uninstalling widgets
SheethalJR Mar 23, 2023
4dd2223
Branding Issue fixed
SheethalJR Mar 24, 2023
becaae4
App Builder Home page changes
SheethalJR Mar 24, 2023
4a81641
Merge branch '2.0.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Mar 24, 2023
073edeb
Added await and changes while installing plugins
SheethalJR Mar 24, 2023
a493223
Changes in direct install of app builder
SheethalJR Mar 27, 2023
c5d502e
Changes in direct install method
SheethalJR Mar 28, 2023
238026d
added exception handling
DarpanLalani Mar 28, 2023
96fd7b4
added changes for clone app logic
DarpanLalani Mar 28, 2023
0485fb4
Changes in app builder direct install
SheethalJR Mar 28, 2023
ea4cd19
Merge branch '2.0.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Mar 28, 2023
9650b20
Default view changed to list view for dashboards
SheethalJR Mar 29, 2023
ff501a4
css issue fixed in list view
SheethalJR Mar 29, 2023
6b67bb4
Improved simulator locking behaviour.
DarpanLalani Mar 29, 2023
c93e109
White line branding issue and App builder direct install code fix
SheethalJR Mar 30, 2023
83c5a46
Merge branch '2.0.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Mar 30, 2023
f141386
updated messaging text
DarpanLalani Mar 30, 2023
131171f
Changes w.r.t app builder external assets
SheethalJR Mar 31, 2023
549beea
Merge branch '2.0.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Mar 31, 2023
4e806ff
removed duplicate code
DarpanLalani Mar 31, 2023
2bf16a3
Merge branch '2.0.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
DarpanLalani Mar 31, 2023
5304d9d
Branding Issue and Dashboard Config issue fixed
SheethalJR Apr 3, 2023
0e8bfb4
Merge branch '2.0.0-dev-1' of https://github.com/SoftwareAG/cumulocit…
SheethalJR Apr 3, 2023
2ac3752
Dashboard General Code Changes
SheethalJR Apr 4, 2023
8638753
fix dashboard config issue
DarpanLalani Apr 5, 2023
bbbf693
RC tag removed
DarpanLalani Apr 6, 2023
06d58ac
Merge branch 'master' into dev
DarpanLalani Apr 6, 2023
09a812a
Merge remote-tracking branch 'origin/2.0.0-dev-1' into dev
DarpanLalani Apr 7, 2023
b0c4d10
updated based on latest changes in 2.0
DarpanLalani Apr 7, 2023
ec97b35
updated with label changed
DarpanLalani Apr 10, 2023
11dbb41
2.0.0 dev 1 (#87)
SheethalJR Apr 14, 2023
b0bb3cd
2.0.0 dev 1 (#88)
SheethalJR Apr 17, 2023
6c33eea
update packages
DarpanLalani Apr 20, 2023
0b865fc
2.0.0 dev 1 (#89)
DarpanLalani Apr 20, 2023
df97a3a
Updated Readme
DarpanLalani Apr 21, 2023
9ab81e0
Updated readme
DarpanLalani Apr 21, 2023
9925143
Updated with video link
DarpanLalani Apr 27, 2023
cf8f46f
2.1.0 dev merge (#98)
DarpanLalani Nov 21, 2023
aadbe2c
Merge branch 'master' into dev
DarpanLalani Nov 22, 2023
f1c53d3
updated image and css
DarpanLalani Nov 22, 2023
fa9dfe9
updated version
DarpanLalani Nov 22, 2023
10b0274
Device availability issue fixed for browser based simulator
DarpanLalani Nov 27, 2023
ede6685
updated headers for simulator
DarpanLalani Nov 27, 2023
ab99029
Merge remote-tracking branch 'origin/master' into dev
DarpanLalani May 9, 2024
956d3ae
updated endpoint urls
DarpanLalani Jun 7, 2024
c428149
updated readme
DarpanLalani Jun 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Application Builder is an open-source tool for you to create web applications 
* **Enhanced dashboard catalog:** Now you can create dashboard based on device group and asset/device type using pre-design dashboard templates.
* **Dashboard catalog reloaded:** Experience the next level with our latest dashboard templates for Predictive Maintenance, Smart Field Services, and Smart Billing—Now with one-click Microservice installation!
* **Enhanced Branding:** Various improvement in overall branding.
* **Cumulocity upgrade:** Application Builder is now based on Cumulocity 1018.0.125
* **Cumulocity upgrade:** Application Builder is now based on Cumulocity 1018.0.x
* **Various bug fixes**

## Features
Expand Down
Binary file removed binary/app-builder-external-assets-3.2.0.tgz
Binary file not shown.
Binary file added binary/app-builder-external-assets-3.3.0.tgz
Binary file not shown.
97 changes: 56 additions & 41 deletions builder/app-builder-upgrade/app-builder-upgrade.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { AppBuilderConfig, VersionInfo } from "./app-builder-upgrade.model";
import { AppIdService } from "../app-id.service";
import { catchError, delay, first } from "rxjs/operators";
import * as semver from "semver";
import { IApplication } from "@c8y/client";
import { FetchClient, IApplication } from "@c8y/client";
import * as _ from 'lodash';
import { WidgetCatalogService } from "./../widget-catalog/widget-catalog.service";
import { WidgetCatalog, WidgetModel } from "./../widget-catalog/widget-catalog.model";
Expand Down Expand Up @@ -62,25 +62,44 @@ export class AppBuilderUpgradeService {
public appVersion: string = appVersion;
public newVersion: boolean = false;
public errorReported = false;
private readonly CUMULOCITY_COMMUNITY_MS_HEALTH_URL = '/service/c8y-community-utils/health';

constructor(private http: HttpClient, public rendererFactory: RendererFactory2, @Inject(DOCUMENT) private _document: Document,
private modalService: BsModalService, private progressIndicatorService: ProgressIndicatorService,
private modalService: BsModalService, private progressIndicatorService: ProgressIndicatorService, private client: FetchClient,
private appService: ApplicationService, private externalService: AppBuilderExternalAssetsService,
private settingService: SettingsService, private userService: UserService, private appStateService: AppStateService,
appIdService: AppIdService, private alertService: AlertService, private widgetCatalogService: WidgetCatalogService) {
this.GATEWAY_URL_GitHubAsset = this.externalService.getURL('GITHUB', 'gatewayURL_GitHubAsset');
private appIdService: AppIdService, private alertService: AlertService, private widgetCatalogService: WidgetCatalogService) {

this.GATEWAY_URL_GitHubAsset = 'service/c8y-community-utils/githubAsset?path=';
this.GATEWAY_URL_GitHubAPI_FallBack = this.externalService.getURL('GITHUB', 'gatewayURL_Github_Fallback');
this.GATEWAY_URL_GitHubAPI = this.externalService.getURL('GITHUB', 'gatewayURL_Github');
this.GATEWAY_URL_Labcase = this.externalService.getURL('DBCATALOG', 'gatewayURL');
this.GATEWAY_URL_Labcase = 'service/c8y-community-utils/labcaseAsset?id=';
this.GATEWAY_URL_GitHubAPI_FallBack = this.externalService.getURL('GITHUB', 'gatewayURL_Github_Fallback');
this.GATEWAY_URL_GitHubAsset_FallBack = this.externalService.getURL('GITHUB', 'gatewayURL_GitHubAsset_Fallback');
this.GATEWAY_URL_Labcase_FallBack = this.externalService.getURL('DBCATALOG', 'gatewayURL_Fallback');
this.GATEWAY_URL_GitHubAsset_FallBack = 'service/c8y-community-utils/githubAsset?path=';
this.GATEWAY_URL_Labcase_FallBack = 'service/c8y-community-utils/labcaseAsset?id=';


appIdService.appIdDelayedUntilAfterLogin$.pipe(first()).subscribe(() => {
// this.GATEWAY_URL_GitHubAsset = this.externalService.getURL('GITHUB', 'gatewayURL_GitHubAsset');
// this.GATEWAY_URL_Labcase = this.externalService.getURL('DBCATALOG', 'gatewayURL');
// this.GATEWAY_URL_GitHubAsset_FallBack = this.externalService.getURL('GITHUB', 'gatewayURL_GitHubAsset_Fallback');
// this.GATEWAY_URL_Labcase_FallBack = this.externalService.getURL('DBCATALOG', 'gatewayURL_Fallback');

this.appIdService.appIdDelayedUntilAfterLogin$.pipe(first()).subscribe(() => {
this.userHasAdminRights = userService.hasRole(appStateService.currentUser.value, "ROLE_APPLICATION_MANAGEMENT_ADMIN")
this.appStateService.currentApplication.subscribe(app => {
this.currentApp = app;
this.verifyPlugins();
});

this.getCumulocityCommunityMSHealth().then(response => {
if(response && response.status === "UP") {
this.appIdService.isCommunityMSExist = true;
} else {
this.appIdService.isCommunityMSExist = false;
}
}).catch(err => {
this.appIdService.isCommunityMSExist = false;
})
});
}

Expand Down Expand Up @@ -235,14 +254,16 @@ export class AppBuilderUpgradeService {
this.errorReported = true;
return;
}
if(!this.appIdService.isCommunityMSExist) {
this.widgetCatalogService.loadErrorMessageDialog();
this.errorReported = true;
return;
}
this.progressIndicatorService.setProgress(40);
let appC8yJson;
let binaryFile;
try {
const data: ArrayBuffer = await this.downloadBinary(binaryLocation, isGithub);
const blob = new Blob([data], {
type: 'application/zip'
});
const blob = await this.downloadBinary(binaryLocation, isGithub);
binaryFile = new File([blob], fileName, { type: "'application/zip'" })
this.progressIndicatorService.setProgress(50);
this.progressIndicatorService.setProgress(60);
Expand Down Expand Up @@ -335,25 +356,24 @@ export class AppBuilderUpgradeService {
});
}
}
private downloadBinary(binaryId: string, isGithub: boolean): Promise<ArrayBuffer> {
let url = `${this.GATEWAY_URL_GitHubAsset}${binaryId}`;
if (!isGithub) {
url = `${this.GATEWAY_URL_Labcase}${binaryId}`
private async downloadBinary(binaryId: string, isGithub: boolean): Promise<any> {
if(this.appIdService.isCommunityMSExist) {
let url = `${this.GATEWAY_URL_GitHubAsset}${binaryId}`;
if (!isGithub) {
url = `${this.GATEWAY_URL_Labcase}${binaryId}`
}
const response = await this.client.fetch(`${url}`);
if(response && response.ok) {
return (await response.blob());
} else {
this.alertService.danger("Unable to download binary! Please try after sometime. If problem persists, please contact the administrator.");
}

} else {
this.hideProgressModalDialog();
this.widgetCatalogService.loadErrorMessageDialog();

}
return this.http.get(url, {
responseType: 'arraybuffer'
})
.pipe(catchError(err => {
console.log('App Builder Upgrade Binary: Error in primary endpoint! using fallback...');
let url = `${this.GATEWAY_URL_GitHubAsset_FallBack}${binaryId}`;
if (!isGithub) {
url = `${this.GATEWAY_URL_Labcase_FallBack}${binaryId}`
}
return this.http.get(url, {
responseType: 'arraybuffer'
})
}))
.toPromise();
}

fetchAppBuilderConfig(): Observable<AppBuilderConfig> {
Expand Down Expand Up @@ -443,22 +463,14 @@ export class AppBuilderUpgradeService {
this.progressIndicatorService.setProgress(10);
let binary = null;
let fileName = '';
let blob = null;
if (pluginBinary.binaryLink && pluginBinary.binaryLink !== '') {
binary = await new Promise(resolve => this.widgetCatalogService.downloadBinary(pluginBinary.binaryLink)
.subscribe(binaryData => resolve(binaryData), error => {
this.logError();
})) as any;
blob = await this.widgetCatalogService.downloadBinary(pluginBinary.binaryLink);
fileName = pluginBinary.binaryLink.replace(/^.*[\\\/]/, '');
} else {
binary = await new Promise(resolve => this.widgetCatalogService.downloadBinaryFromLabcase(pluginBinary.link)
.subscribe(binaryData => resolve(binaryData), error => {
this.logError();
})) as any;
blob = await this.widgetCatalogService.downloadBinaryFromLabcase(pluginBinary.link)
fileName = pluginBinary.fileName;
}
const blob = new Blob([binary], {
type: 'application/zip'
});
const fileOfBlob = new File([blob], fileName);
await this.widgetCatalogService.installPackage(fileOfBlob);
appConfigUpdated = true;
Expand Down Expand Up @@ -617,4 +629,7 @@ export class AppBuilderUpgradeService {
const major = '>=' + semver.major(widget.installedVersion) + '.0.0';
return semver.satisfies(widget.version, major);
}
async getCumulocityCommunityMSHealth() {
return (await (await this.client.fetch(`${this.CUMULOCITY_COMMUNITY_MS_HEALTH_URL}`)).json());
}
}
2 changes: 2 additions & 0 deletions builder/app-id.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export class AppIdService {
/** same as the appId$ but the value is pended until after the user logs in */
readonly appIdDelayedUntilAfterLogin$: Observable<string|undefined>;

isCommunityMSExist = false;

constructor(router: Router, appStateService: AppStateService) {
router.events.pipe(
filter(event => event instanceof ActivationEnd),
Expand Down
1 change: 1 addition & 0 deletions builder/branding/standard-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export function standardTheme(branding: any) {
--c8y-component-spinner-color:${_lighter_text_Hex};
--c8y-component-color-text-muted: ${_text_Hex};
--c8y-component-background-hover: ${_lighter_primary_Hex_1_1};
--c8y-dropdown-background-default: ${_lighter_primary_Hex};

--c8y-level-0: ${_lighter_primary_Hex};
--c8y-level-1-custom: ${_lighter_primary_Hex_1_1};
Expand Down
41 changes: 30 additions & 11 deletions builder/template-catalog/template-catalog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DeviceSelectorModalComponent } from "../utils/device-selector-modal/dev
import { BsModalRef, BsModalService } from "ngx-bootstrap/modal";
import { DependencyDescription, TemplateCatalogEntry, TemplateDetails } from "./template-catalog.model";
import { TemplateCatalogService } from "./template-catalog.service";
import { AlertService, DynamicComponentDefinition, DynamicComponentService } from "@c8y/ngx-components";
import { AlertService, DynamicComponentDefinition, DynamicComponentService, PluginsService } from "@c8y/ngx-components";
import { Subject, Subscription, interval } from "rxjs";
import { ProgressIndicatorModalComponent } from "../utils/progress-indicator-modal/progress-indicator-modal.component";

Expand All @@ -31,6 +31,7 @@ import { catchError } from "rxjs/operators";
import { AccessRightsService } from "../../builder/access-rights.service";
import { ProgressIndicatorService } from "../../builder/utils/progress-indicator-modal/progress-indicator.service";
import { ApplicationBinaryService } from "../../builder/application-binary.service";
import { AlertMessageModalComponent } from "../../builder/utils/alert-message-modal/alert-message-modal.component";


enum TemplateCatalogStep {
Expand Down Expand Up @@ -101,7 +102,7 @@ export class TemplateCatalogModalComponent implements OnInit {
constructor(private modalService: BsModalService, private modalRef: BsModalRef, private appService: ApplicationService,
private catalogService: TemplateCatalogService, private componentService: DynamicComponentService,
private alertService: AlertService, private widgetCatalogService: WidgetCatalogService,
private applicationBinaryService: ApplicationBinaryService,
private applicationBinaryService: ApplicationBinaryService, private pluginsService: PluginsService,
private accessRightsService: AccessRightsService, private progressIndicatorService: ProgressIndicatorService) {
this.onSave = new Subject();
this.onCancel = new Subject();
Expand Down Expand Up @@ -325,15 +326,13 @@ export class TemplateCatalogModalComponent implements OnInit {
}
});
this.catalogService.downloadBinary(dependency.link)
.subscribe(async data => {
.then(async blob => {
let createdApp = null;
this.microserviceDownloadProgress$.unsubscribe();
try {
this.progressIndicatorService.setProgress(40);
this.progressIndicatorService.setMessage(`Installing ${dependency.title}`);
const blob = new Blob([data], {
type: 'application/zip'
});

const fileName = dependency.link.replace(/^.*[\\\/]/, '');
const fileOfBlob = new File([blob], fileName);

Expand All @@ -358,10 +357,15 @@ export class TemplateCatalogModalComponent implements OnInit {
this.alertService.danger("There is some technical error! Please try after sometime.");
console.error(ex.message);
}
}).catch(err => {
this.hideProgressModalDialog();
this.loadErrorMessageDialog();
});

} else { // installing plugin
const widgetBinaryFound = this.appList.find(app => app.manifest?.isPackage && (app.name.toLowerCase() === dependency.title?.toLowerCase() ||

const packageList = await this.pluginsService.listPackages();
const widgetBinaryFound = packageList.find(app => (app.name.toLowerCase() === dependency.title?.toLowerCase() ||
(app.contextPath && app.contextPath?.toLowerCase() === dependency?.contextPath?.toLowerCase())));
this.showProgressModalDialog(`Installing ${dependency.title}`);
this.progressIndicatorService.setProgress(10);
Expand All @@ -380,11 +384,8 @@ export class TemplateCatalogModalComponent implements OnInit {
} else {
this.progressIndicatorService.setProgress(10);
this.catalogService.downloadBinary(dependency.link)
.subscribe(data => {
.then(blob => {
this.progressIndicatorService.setProgress(20);
const blob = new Blob([data], {
type: 'application/zip'
});
const fileName = dependency.link.replace(/^.*[\\\/]/, '');
const fileOfBlob = new File([blob], fileName);
this.widgetCatalogService.installPackage(fileOfBlob).then(async () => {
Expand All @@ -396,6 +397,9 @@ export class TemplateCatalogModalComponent implements OnInit {
this.alertService.danger("There is some technical error! Please try after sometime.");
console.error(error);
});
}).catch(err => {
this.hideProgressModalDialog();
this.loadErrorMessageDialog();
});
}
}
Expand Down Expand Up @@ -460,4 +464,19 @@ export class TemplateCatalogModalComponent implements OnInit {
}

}
private loadErrorMessageDialog() {
const alertMessage = {
title: 'Microservice needed!',
description: `'Cumulocity Community Utils' microservice is not installed or subscribed. Please download the microservice, then install and subscribe to it by navigating to Administration -> Ecosystems -> Microservices. `,
type: 'danger',
externalLink: "https://labcase.softwareag.com/storage/d/a02221e54739758ccb1ab839ce09e2cc",
externalLinkLabel: "Download the microservice now.",
alertType: 'info' //info|confirm
}
this.alertModalDialog(alertMessage);
}

alertModalDialog(message: any): BsModalRef {
return this.modalService.show(AlertMessageModalComponent, { class: 'c8y-wizard', initialState: { message } });
}
}
Loading
Loading