diff --git a/lib/core/src/lib/about/about-github-link/about-github-link.component.html b/lib/core/src/lib/about/about-github-link/about-github-link.component.html deleted file mode 100644 index b2cbffa42d..0000000000 --- a/lib/core/src/lib/about/about-github-link/about-github-link.component.html +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/lib/core/src/lib/about/about-github-link/about-github-link.component.scss b/lib/core/src/lib/about/about-github-link/about-github-link.component.scss deleted file mode 100644 index 16d6a6e6ac..0000000000 --- a/lib/core/src/lib/about/about-github-link/about-github-link.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.adf-github-link-container { - padding: 10px; -} diff --git a/lib/core/src/lib/about/about-github-link/about-github-link.component.spec.ts b/lib/core/src/lib/about/about-github-link/about-github-link.component.spec.ts deleted file mode 100644 index 229d08728b..0000000000 --- a/lib/core/src/lib/about/about-github-link/about-github-link.component.spec.ts +++ /dev/null @@ -1,71 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CoreTestingModule } from '../../testing/core.testing.module'; -import { AboutGithubLinkComponent } from './about-github-link.component'; -import { aboutGithubDetails } from '../about.mock'; - -describe('AboutGithubLinkComponent', () => { - let fixture: ComponentFixture; - let component: AboutGithubLinkComponent; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [CoreTestingModule] - }); - fixture = TestBed.createComponent(AboutGithubLinkComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - afterEach(() => { - fixture.destroy(); - }); - - it('Should fetch appName for app.config and display as title', async () => { - component.application = 'mock-application-name'; - fixture.detectChanges(); - await fixture.whenStable(); - const titleElement = fixture.nativeElement.querySelector('[data-automation-id="adf-github-app-title"]'); - expect(titleElement === null).toBeFalsy(); - expect(titleElement.innerText).toEqual('mock-application-name'); - }); - - it('should display version', async () => { - component.version = aboutGithubDetails.version; - fixture.detectChanges(); - await fixture.whenStable(); - const version = fixture.nativeElement.querySelector('[data-automation-id="adf-github-version"]'); - expect(version.innerText).toEqual('ABOUT.VERSION: 0.0.7'); - }); - - it('should display adf github link as default if url is not specified', async () => { - fixture.detectChanges(); - await fixture.whenStable(); - const githubUrl = fixture.nativeElement.querySelector('[data-automation-id="adf-github-url"]'); - expect(githubUrl.innerText).toEqual(aboutGithubDetails.defaultUrl); - }); - - it('should display the github link', async () => { - component.url = aboutGithubDetails.url; - fixture.detectChanges(); - await fixture.whenStable(); - const githubUrl = fixture.nativeElement.querySelector('[data-automation-id="adf-github-url"]'); - expect(githubUrl.innerText).toEqual(aboutGithubDetails.url); - }); -}); diff --git a/lib/core/src/lib/about/about-github-link/about-github-link.component.ts b/lib/core/src/lib/about/about-github-link/about-github-link.component.ts deleted file mode 100644 index f78c1d2e2f..0000000000 --- a/lib/core/src/lib/about/about-github-link/about-github-link.component.ts +++ /dev/null @@ -1,44 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Component, Input, ViewEncapsulation } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { MatCardModule } from '@angular/material/card'; - -@Component({ - selector: 'adf-about-github-link', - templateUrl: './about-github-link.component.html', - encapsulation: ViewEncapsulation.None, - standalone: true, - imports: [CommonModule, TranslateModule, MatCardModule] -}) -export class AboutGithubLinkComponent { - /** Commit corresponding to the version of ADF to be used. */ - @Input() - url = 'https://github.com/Alfresco/alfresco-ng2-components/commits/'; - - /** Current version of the app running */ - @Input() - version: string = ''; - - /** Title of app running */ - @Input() - application: string = ''; - - constructor() {} -} diff --git a/lib/core/src/lib/about/about-platform-version/about-platform-version.component.html b/lib/core/src/lib/about/about-platform-version/about-platform-version.component.html deleted file mode 100644 index 8ae7b475b0..0000000000 --- a/lib/core/src/lib/about/about-platform-version/about-platform-version.component.html +++ /dev/null @@ -1,45 +0,0 @@ - -
-
{{ 'ABOUT.VERSIONS.PROCESS_SERVICE' | translate }}
-

- {{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ process.majorVersion }}.{{process.minorVersion }}.{{ process.revisionVersion }} -

-
-
- - -
-
{{ 'ABOUT.VERSIONS.CONTENT_SERVICE' | translate }}
-

{{ 'ABOUT.VERSIONS.LABELS.EDITION' | translate }}: {{ repository.edition }}

-

{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ repository.version.display }}

-
-
- - -
-
{{ 'ABOUT.VERSIONS.MODELING_SERVICE' | translate }}
-

{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ modeling.version }}

-
-
- - -
-
{{ 'ABOUT.VERSIONS.DEPLOYMENT_SERVICE' | translate }}
-

{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ deployment.version }}

-
-
- - -
-
{{ 'ABOUT.VERSIONS.RB' | translate }}
-

{{ 'ABOUT.VERSIONS.LABELS.EDITION' | translate }}: {{ rb.artifact }}

-

{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ rb.version }}

-
-
- - -
-
{{ 'ABOUT.VERSIONS.QUERY_SERVICE' | translate }}
-

{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ query.version }}

-
-
diff --git a/lib/core/src/lib/about/about-platform-version/about-platform-version.component.ts b/lib/core/src/lib/about/about-platform-version/about-platform-version.component.ts deleted file mode 100644 index e513be0aa8..0000000000 --- a/lib/core/src/lib/about/about-platform-version/about-platform-version.component.ts +++ /dev/null @@ -1,78 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Component, Input, ViewEncapsulation } from '@angular/core'; -import { Observable } from 'rxjs'; - -import { BpmProductVersionModel } from '../../models/product-version.model'; -import { AaeInfoService, ActivitiDependencyInfo } from '../services/aae-info.service'; -import { AppConfigService } from '../../app-config/app-config.service'; -import { CommonModule } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; - -interface VersionInfo { - display: string; -} - -interface RepositoryInfo { - edition: string; - version: VersionInfo; -} - -@Component({ - selector: 'adf-about-platform-version', - templateUrl: './about-platform-version.component.html', - encapsulation: ViewEncapsulation.None, - standalone: true, - imports: [CommonModule, TranslateModule] -}) -export class AboutPlatformVersionComponent { - /** repository info. */ - @Input() - repository: RepositoryInfo = null; - - /** process info. */ - @Input() - process: BpmProductVersionModel = null; - - modeling$: Observable; - deployment$: Observable; - rb$: Observable; - query$: Observable; - - constructor(private aaeInfoService: AaeInfoService, private appConfigService: AppConfigService) { - this.modelingInfo(); - this.deploymentInfo(); - this.rbInfo(); - } - - modelingInfo() { - this.modeling$ = this.aaeInfoService.getServiceVersion('modeling-service'); - } - - deploymentInfo() { - this.deployment$ = this.aaeInfoService.getServiceVersion('deployment-service'); - } - - rbInfo() { - this.rb$ = this.aaeInfoService.getServiceVersion(`${this.appConfigService.get('oauth2.clientId')}/rb`); - } - - queryInfo() { - this.query$ = this.aaeInfoService.getServiceVersion(`${this.appConfigService.get('oauth2.clientId')}/query`); - } -} diff --git a/lib/core/src/lib/about/about-server-settings/about-server-settings.component.spec.ts b/lib/core/src/lib/about/about-server-settings/about-server-settings.component.spec.ts index e97db1409f..ddfc764f5e 100644 --- a/lib/core/src/lib/about/about-server-settings/about-server-settings.component.spec.ts +++ b/lib/core/src/lib/about/about-server-settings/about-server-settings.component.spec.ts @@ -19,7 +19,15 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { CoreTestingModule } from '../../testing/core.testing.module'; import { AboutServerSettingsComponent } from './about-server-settings.component'; import { AppConfigService } from '../../app-config/app-config.service'; -import { aboutGithubDetails } from '../about.mock'; + +const aboutGithubDetails = { + url: 'https://github.com/componany/repository/commits/', + defaultUrl: 'https://github.com/Alfresco/alfresco-ng2-components/commits/', + version: '0.0.7', + ecmHost: 'https://mock.ecmhost.com', + bpmHost: 'https://mock.bpmhost.com', + appName: 'mock-application-name' +}; describe('AboutServerSettingsComponent', () => { let fixture: ComponentFixture; diff --git a/lib/core/src/lib/about/about.component.stories.ts b/lib/core/src/lib/about/about.component.stories.ts index bd06a3ac8b..9ac8a72593 100644 --- a/lib/core/src/lib/about/about.component.stories.ts +++ b/lib/core/src/lib/about/about.component.stories.ts @@ -17,7 +17,7 @@ import { Meta, moduleMetadata, Story } from '@storybook/angular'; import { AboutComponent } from './about.component'; -import { AboutModule } from './about.module'; +import { ABOUT_DIRECTIVES } from './about.module'; import { AuthenticationService } from '../auth/services/authentication.service'; import { AuthenticationMock } from '../auth/mock/authentication.service.mock'; import { AppExtensionService, ExtensionRef, ViewerExtensionRef } from '@alfresco/adf-extensions'; @@ -48,7 +48,7 @@ export default { title: 'Core/About/About', decorators: [ moduleMetadata({ - imports: [CoreStoryModule, AboutModule], + imports: [CoreStoryModule, ...ABOUT_DIRECTIVES], providers: [ { provide: AuthenticationService, useClass: AuthenticationMock }, { provide: AppExtensionService, useClass: AppExtensionServiceMock }, diff --git a/lib/core/src/lib/about/about.mock.ts b/lib/core/src/lib/about/about.mock.ts deleted file mode 100644 index 5779c85952..0000000000 --- a/lib/core/src/lib/about/about.mock.ts +++ /dev/null @@ -1,25 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const aboutGithubDetails = { - url: 'https://github.com/componany/repository/commits/', - defaultUrl: 'https://github.com/Alfresco/alfresco-ng2-components/commits/', - version: '0.0.7', - ecmHost: 'https://mock.ecmhost.com', - bpmHost: 'https://mock.bpmhost.com', - appName: 'mock-application-name' -}; diff --git a/lib/core/src/lib/about/about.module.ts b/lib/core/src/lib/about/about.module.ts index e76f3acf11..26c2a0f610 100644 --- a/lib/core/src/lib/about/about.module.ts +++ b/lib/core/src/lib/about/about.module.ts @@ -16,44 +16,31 @@ */ import { NgModule } from '@angular/core'; -import { AboutGithubLinkComponent } from './about-github-link/about-github-link.component'; import { AboutServerSettingsComponent } from './about-server-settings/about-server-settings.component'; import { AboutExtensionListComponent } from './about-extension-list/about-extension-list.component'; import { AboutLicenseListComponent } from './about-license-list/about-license-list.component'; import { PackageListComponent } from './about-package/package-list.component'; import { AboutStatusListComponent } from './about-status-list/about-status-list.component'; import { ModuleListComponent } from './about-module-list/module-list.component'; -import { AboutPlatformVersionComponent } from './about-platform-version/about-platform-version.component'; import { AboutComponent } from './about.component'; import { AboutPanelDirective } from './about-panel.directive'; import { AboutRepositoryInfoComponent } from './about-repository-info/about-repository-info.component'; +export const ABOUT_DIRECTIVES = [ + AboutExtensionListComponent, + AboutLicenseListComponent, + ModuleListComponent, + AboutRepositoryInfoComponent, + PackageListComponent, + AboutStatusListComponent, + AboutServerSettingsComponent, + AboutPanelDirective, + AboutComponent +] as const; + +/** @deprecated import `ABOUT_DIRECTIVES` or standalone components instead */ @NgModule({ - imports: [ - AboutExtensionListComponent, - AboutGithubLinkComponent, - AboutLicenseListComponent, - ModuleListComponent, - AboutRepositoryInfoComponent, - AboutPlatformVersionComponent, - PackageListComponent, - AboutStatusListComponent, - AboutServerSettingsComponent, - AboutPanelDirective, - AboutComponent - ], - exports: [ - AboutComponent, - AboutPanelDirective, - AboutRepositoryInfoComponent, - AboutPlatformVersionComponent, - AboutGithubLinkComponent, - AboutServerSettingsComponent, - AboutExtensionListComponent, - AboutLicenseListComponent, - PackageListComponent, - AboutStatusListComponent, - ModuleListComponent - ] + imports: [...ABOUT_DIRECTIVES], + exports: [...ABOUT_DIRECTIVES] }) export class AboutModule {} diff --git a/lib/core/src/lib/about/public-api.ts b/lib/core/src/lib/about/public-api.ts index b529988686..e820a96998 100644 --- a/lib/core/src/lib/about/public-api.ts +++ b/lib/core/src/lib/about/public-api.ts @@ -16,11 +16,9 @@ */ export * from './about-extension-list/about-extension-list.component'; -export * from './about-github-link/about-github-link.component'; export * from './about-license-list/about-license-list.component'; export * from './about-module-list/module-list.component'; export * from './about-package/package-list.component'; -export * from './about-platform-version/about-platform-version.component'; export * from './about-server-settings/about-server-settings.component'; export * from './about-status-list/about-status-list.component'; export * from './about.component'; diff --git a/lib/core/src/lib/about/services/aae-info.service.ts b/lib/core/src/lib/about/services/aae-info.service.ts deleted file mode 100644 index 560ee6ef98..0000000000 --- a/lib/core/src/lib/about/services/aae-info.service.ts +++ /dev/null @@ -1,55 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { map } from 'rxjs/operators'; -import { Observable } from 'rxjs'; -import { AppConfigService } from '../../app-config/app-config.service'; - -export interface ActivitiDependencyInfo { - artifact: string; - version: string; - activiti: string; -} - -@Injectable({ - providedIn: 'root' -}) -export class AaeInfoService { - contextRoot = ''; - - constructor(protected httpClient: HttpClient, protected appConfigService: AppConfigService) { - this.contextRoot = appConfigService.get('bpmHost', ''); - } - - getServiceVersion(serviceName: string): Observable { - return this.httpClient.get(`${this.contextRoot}/${serviceName}/actuator/info`).pipe( - map((response: any) => { - let activitiVersion = 'N/A'; - if (response.build.activiti) { - activitiVersion = response.build.activiti.version; - } - return { - artifact: response.build.artifact, - version: response.build.version, - activiti: activitiVersion - }; - }) - ); - } -} diff --git a/lib/core/src/lib/core.module.ts b/lib/core/src/lib/core.module.ts index f3126c8a0e..ed20941b27 100644 --- a/lib/core/src/lib/core.module.ts +++ b/lib/core/src/lib/core.module.ts @@ -21,7 +21,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { TranslateModule, TranslateLoader, TranslateStore, TranslateService } from '@ngx-translate/core'; import { MaterialModule } from './material.module'; -import { AboutModule } from './about/about.module'; +import { ABOUT_DIRECTIVES } from './about/about.module'; import { CardViewModule } from './card-view/card-view.module'; import { ContextMenuModule } from './context-menu/context-menu.module'; import { DataTableModule } from './datatable/datatable.module'; @@ -73,7 +73,7 @@ import { DynamicChipListModule } from './dynamic-chip-list'; imports: [ TranslateModule, ExtensionsModule, - AboutModule, + ...ABOUT_DIRECTIVES, ViewerModule, SidenavLayoutModule, PipeModule, @@ -111,7 +111,7 @@ import { DynamicChipListModule } from './dynamic-chip-list'; }) ], exports: [ - AboutModule, + ...ABOUT_DIRECTIVES, ViewerModule, SidenavLayoutModule, PipeModule, diff --git a/lib/core/src/lib/i18n/en.json b/lib/core/src/lib/i18n/en.json index 4b34fb1d20..17ccf1525d 100644 --- a/lib/core/src/lib/i18n/en.json +++ b/lib/core/src/lib/i18n/en.json @@ -515,26 +515,6 @@ "PROCESS_SERVICE_HOST": "Alfresco Process Services URL: {{ value }}" }, "REPOSITORY": "Repository", - "VERSIONS": { - "TITLE": "Product Versions", - "CONTENT_SERVICE": "Content Services", - "PROCESS_SERVICE": "Process Services", - "MODELING_SERVICE": "Modeling Services", - "DEPLOYMENT_SERVICE": "Deployment Services", - "QUERY_SERVICE": "Deployment Services", - "RB": "Runtime", - "LABELS": { - "EDITION": "Edition", - "VERSION": "Version", - "LICENSE": "License", - "STATUS": "Status", - "MODULES": "Modules" - } - }, - "SOURCE_CODE": { - "TITLE": "Source code", - "DESCRIPTION": "You are running the project based on the following commit:" - }, "PACKAGES": { "TITLE": "Packages", "NAME": "Name",