[ACS-10117] Deprecate ADF Storybook and custom Docker builds (#11207)

This commit is contained in:
dominikiwanekhyland
2025-09-18 15:13:01 +02:00
committed by GitHub
parent 4964ae94c5
commit 591934db0e
133 changed files with 2860 additions and 12298 deletions
@@ -1,61 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 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, OnInit, OnChanges } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { DownloadZipDialogComponent } from './download-zip.dialog';
import { zipNode, downloadEntry } from './mock/download-zip-data.mock';
import { FileDownloadStatus } from '@alfresco/js-api';
import { MatButtonModule } from '@angular/material/button';
@Component({
selector: 'adf-download-zip-dialog-storybook',
template: `<button mat-raised-button (click)="openDialog()">Open dialog</button>`,
standalone: true,
imports: [MatButtonModule]
})
export class DownloadZipDialogStorybookComponent implements OnInit, OnChanges {
@Input()
showLoading: boolean;
constructor(private dialog: MatDialog) {}
ngOnInit(): void {
this.setEntryStatus(this.showLoading);
}
ngOnChanges(): void {
this.setEntryStatus(this.showLoading);
}
setEntryStatus(isLoading: boolean) {
if (!isLoading) {
downloadEntry.entry.status = FileDownloadStatus.DONE;
} else {
downloadEntry.entry.status = FileDownloadStatus.IN_PROGRESS;
}
}
openDialog() {
this.dialog.open(DownloadZipDialogComponent, {
minWidth: '50%',
data: {
nodeIds: [zipNode.entry.id]
}
});
}
}
@@ -1,84 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 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 { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
import { MatButtonModule } from '@angular/material/button';
import { DownloadZipDialogStorybookComponent } from './download-zip.dialog.stories.component';
import { AlfrescoApiServiceMock, ContentApiMock, DownloadZipMockService, NodesApiMock } from './mock/download-zip-service.mock';
import { DownloadZipService } from './services/download-zip.service';
import { ContentService } from '../../common/services/content.service';
import { NodesApiService } from '../../common/services/nodes-api.service';
import { MatDialogModule } from '@angular/material/dialog';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { importProvidersFrom } from '@angular/core';
import { CoreStoryModule } from '../../../../../core/src/public-api';
import { AlfrescoApiService } from '../../services';
export default {
component: DownloadZipDialogStorybookComponent,
title: 'Core/Dialog/Download ZIP Dialog',
decorators: [
moduleMetadata({
imports: [MatButtonModule, MatDialogModule, HttpClientTestingModule, DownloadZipDialogStorybookComponent],
providers: [
{
provide: AlfrescoApiService,
useClass: AlfrescoApiServiceMock
},
{
provide: DownloadZipService,
useClass: DownloadZipMockService
},
{
provide: ContentService,
useClass: ContentApiMock
},
{
provide: NodesApiService,
useClass: NodesApiMock
}
]
}),
applicationConfig({
providers: [importProvidersFrom(CoreStoryModule)]
})
],
argTypes: {
showLoading: {
control: {
type: 'boolean'
},
table: {
category: 'Story controls',
type: {
summary: 'boolean'
},
defaultValue: {
summary: 'false'
}
}
}
},
args: {
showLoading: false
}
} as Meta<DownloadZipDialogStorybookComponent>;
export const DownloadZIPDialog: StoryFn<DownloadZipDialogStorybookComponent> = (args) => ({
props: args
});
DownloadZIPDialog.parameters = { layout: 'centered' };
@@ -1,33 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 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 { DownloadEntry } from '@alfresco/js-api';
export const zipNode = {
entry: {
name: 'files.zip',
contentUrl: './assets/files.zip',
id: 'files_in_zip'
}
};
export const downloadEntry: DownloadEntry = {
entry: {
id: 'entryId',
status: 'DONE'
}
};
@@ -1,93 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 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 { DownloadBodyCreate, DownloadEntry, DownloadsApi, Node } from '@alfresco/js-api';
import { from, Observable, of, ReplaySubject, Subject } from 'rxjs';
import { catchError } from 'rxjs/internal/operators/catchError';
import { zipNode, downloadEntry } from './download-zip-data.mock';
export class AlfrescoApiServiceMock {
nodeUpdated = new Subject<Node>();
alfrescoApiInitialized = new ReplaySubject<boolean>(1);
alfrescoApi = new AlfrescoApiMock();
load() {}
getInstance = () => this.alfrescoApi;
}
class AlfrescoApiMock {
core = new CoreMock();
content = new ContentApiMock();
isOauthConfiguration = () => true;
isLoggedIn = () => true;
isEcmConfiguration = () => true;
}
export class ContentApiMock {
getContentUrl = (): string => zipNode.entry.contentUrl;
}
class CoreMock {
downloadsApi = new DownloadsApiMock();
nodesApi = new NodesApiMock();
}
export class NodesApiMock {
getNode = (): any => of(zipNode.entry);
}
class DownloadsApiMock extends DownloadsApi {
createDownload = (): Promise<DownloadEntry> => Promise.resolve(downloadEntry);
getDownload = (): Promise<DownloadEntry> => Promise.resolve(downloadEntry);
cancelDownload = () => Promise.resolve(true);
}
export class DownloadZipMockService {
private _downloadsApi: DownloadsApi;
get downloadsApi(): DownloadsApi {
this._downloadsApi = this._downloadsApi ?? new DownloadsApiMock();
return this._downloadsApi;
}
createDownload(payload: DownloadBodyCreate): Observable<DownloadEntry> {
return from(this.downloadsApi.createDownload(payload)).pipe(catchError((err) => of(err)));
}
getDownload(downloadId: string): Observable<DownloadEntry> {
return from(this.downloadsApi.getDownload(downloadId));
}
cancelDownload(downloadId: string) {
this.downloadsApi.cancelDownload(downloadId);
}
download(url: string, fileName: string) {
if (url && fileName) {
const link = document.createElement('a');
link.style.display = 'none';
link.download = fileName;
link.href = url;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
}
}
@@ -15,9 +15,7 @@
* limitations under the License.
*/
import { CommentModel, User } from '@alfresco/adf-core';
import { EcmCompanyModel } from '../../common/models/ecm-company.model';
import { EcmUserModel } from '../../common/models/ecm-user.model';
import { User } from '@alfresco/adf-core';
export const fakeUser1 = new User({
enabled: true,
@@ -90,120 +88,3 @@ export const fakeContentComment = {
content: 'fake-comment-message'
}
};
const fakeCompany: EcmCompanyModel = {
organization: '',
address1: '',
address2: '',
address3: '',
postcode: '',
telephone: '',
fax: '',
email: ''
};
const johnDoe: EcmUserModel = {
id: '1',
email: 'john.doe@alfresco.com',
firstName: 'John',
lastName: 'Doe',
company: fakeCompany,
enabled: true,
isAdmin: undefined,
avatarId: '001'
};
const janeEod: EcmUserModel = {
id: '2',
email: 'jane.eod@alfresco.com',
firstName: 'Jane',
lastName: 'Eod',
company: fakeCompany,
enabled: true,
isAdmin: undefined
};
const robertSmith: EcmUserModel = {
id: '3',
email: 'robert.smith@alfresco.com',
firstName: 'Robert',
lastName: 'Smith',
company: fakeCompany,
enabled: true,
isAdmin: undefined
};
export const testUser: EcmUserModel = {
id: '44',
email: 'test.user@hyland.com',
firstName: 'Test',
lastName: 'User',
company: fakeCompany,
enabled: true,
isAdmin: undefined,
avatarId: '044'
};
export const getDateXMinutesAgo = (minutes: number) => new Date(new Date().getTime() - minutes * 60000);
export const commentsNodeData: CommentModel[] = [
new CommentModel({
id: 1,
message: `I've done this component, is it cool?`,
created: getDateXMinutesAgo(30),
createdBy: new User(johnDoe),
isSelected: false
}),
new CommentModel({
id: 2,
message: 'Yeah',
created: getDateXMinutesAgo(15),
createdBy: new User(janeEod),
isSelected: false
}),
new CommentModel({
id: 3,
message: '+1',
created: getDateXMinutesAgo(12),
createdBy: new User(robertSmith),
isSelected: false
}),
new CommentModel({
id: 4,
message: 'ty',
created: new Date(),
createdBy: new User(johnDoe),
isSelected: false
})
];
export const commentsTaskData: CommentModel[] = [
new CommentModel({
id: 1,
message: `I've done this task, what's next?`,
created: getDateXMinutesAgo(30),
createdBy: new User(johnDoe),
isSelected: false
}),
new CommentModel({
id: 2,
message: `I've assigned you another one 🤠`,
created: getDateXMinutesAgo(15),
createdBy: new User(janeEod),
isSelected: false
}),
new CommentModel({
id: 3,
message: '+1',
created: getDateXMinutesAgo(12),
createdBy: new User(robertSmith),
isSelected: false
}),
new CommentModel({
id: 4,
message: 'Cheers',
created: new Date(),
createdBy: new User(johnDoe),
isSelected: false
})
];