mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[MIGRATION] - Something happened on the way to heaven
This commit is contained in:
@@ -9,3 +9,4 @@ scripts
|
|||||||
/angular.json
|
/angular.json
|
||||||
docs/**/*.md
|
docs/**/*.md
|
||||||
lib/js-api/docs/**/*.md
|
lib/js-api/docs/**/*.md
|
||||||
|
.storybook
|
||||||
|
8
.github/workflows/release-branch.yml
vendored
8
.github/workflows/release-branch.yml
vendored
@@ -127,15 +127,15 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -u;
|
set -u;
|
||||||
./scripts/update-version.sh -gnu || exit 1;
|
./scripts/update-version.sh -gnu || exit 1;
|
||||||
npx nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" --skip-nx-cache
|
npx nx affected:build --base=origin/develop --head=HEAD --prod --exclude="demoshell" --skip-nx-cache
|
||||||
npx nx affected $NX_CALCULATION_FLAGS --target=pretheme
|
npx nx affected --base=origin/develop --head=HEAD --target=pretheme
|
||||||
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
||||||
name: release libraries GH registry
|
name: release libraries GH registry
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
registry-url: 'https://npm.pkg.github.com'
|
registry-url: 'https://npm.pkg.github.com'
|
||||||
scope: '@alfresco'
|
scope: '@alfresco'
|
||||||
- run: npx nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=branch|| exit 1
|
- run: npx nx affected --target=npm-publish --base=origin/develop --head=HEAD --tag=branch|| exit 1
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.PAT_WRITE_PKG }}
|
NODE_AUTH_TOKEN: ${{ secrets.PAT_WRITE_PKG }}
|
||||||
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
||||||
@@ -144,7 +144,7 @@ jobs:
|
|||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}'
|
registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}'
|
||||||
scope: '@alfresco'
|
scope: '@alfresco'
|
||||||
- run: npx nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=branch || exit 1
|
- run: npx nx affected --target=npm-publish --base=origin/develop --head=HEAD --tag=branch || exit 1
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
@@ -75,7 +75,9 @@ export class TaskDetailsCloudDemoComponent {
|
|||||||
try {
|
try {
|
||||||
errorMessage = JSON.parse(error).message || JSON.parse(error).entry?.message;
|
errorMessage = JSON.parse(error).message || JSON.parse(error).entry?.message;
|
||||||
errorMessage = JSON.parse(errorMessage).message;
|
errorMessage = JSON.parse(errorMessage).message;
|
||||||
} catch {}
|
} catch {
|
||||||
|
/* empty */
|
||||||
|
}
|
||||||
this.notificationService.showError(errorMessage || error);
|
this.notificationService.showError(errorMessage || error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
import { ContentAuthLoaderService } from './content-auth-loader.service';
|
import { ContentAuthLoaderService } from './content-auth-loader.service';
|
||||||
|
|
||||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
|
||||||
/**
|
/**
|
||||||
* Create a content auth factory
|
* Create a content auth factory
|
||||||
*
|
*
|
||||||
|
@@ -114,7 +114,9 @@ export class RenditionService {
|
|||||||
try {
|
try {
|
||||||
await this.renditionsApi.createRendition(nodeId, { id: renditionId });
|
await this.renditionsApi.createRendition(nodeId, { id: renditionId });
|
||||||
rendition = await this.waitRendition(nodeId, renditionId, 0);
|
rendition = await this.waitRendition(nodeId, renditionId, 0);
|
||||||
} catch {}
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new Promise<RenditionEntry>((resolve) => resolve(rendition));
|
return new Promise<RenditionEntry>((resolve) => resolve(rendition));
|
||||||
|
@@ -238,7 +238,9 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
statusCode = JSON.parse(error.message).error.statusCode;
|
statusCode = JSON.parse(error.message).error.statusCode;
|
||||||
} catch {}
|
} catch {
|
||||||
|
/* empty */
|
||||||
|
}
|
||||||
|
|
||||||
let message = `METADATA.ERRORS.${statusCode}`;
|
let message = `METADATA.ERRORS.${statusCode}`;
|
||||||
|
|
||||||
|
@@ -252,7 +252,9 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
statusCode = JSON.parse(error.message).error.statusCode;
|
statusCode = JSON.parse(error.message).error.statusCode;
|
||||||
} catch {}
|
} catch {
|
||||||
|
/* empty */
|
||||||
|
}
|
||||||
|
|
||||||
if (statusCode === 403) {
|
if (statusCode === 403) {
|
||||||
message = 'SHARE.UNSHARE_PERMISSION_ERROR';
|
message = 'SHARE.UNSHARE_PERMISSION_ERROR';
|
||||||
|
@@ -1049,7 +1049,9 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
|
|||||||
if (JSON.parse(err.message).error.statusCode === 403) {
|
if (JSON.parse(err.message).error.statusCode === 403) {
|
||||||
this.noPermission = true;
|
this.noPermission = true;
|
||||||
}
|
}
|
||||||
} catch (error) {}
|
} catch (error) {
|
||||||
|
/* empty */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.setLoadingState(false);
|
this.setLoadingState(false);
|
||||||
this.error.emit(err);
|
this.error.emit(err);
|
||||||
|
@@ -25,7 +25,6 @@ import { TreeViewService } from '../services/tree-view.service';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TreeViewDataSource {
|
export class TreeViewDataSource {
|
||||||
|
|
||||||
treeNodes: TreeBaseNode[];
|
treeNodes: TreeBaseNode[];
|
||||||
dataChange = new BehaviorSubject<TreeBaseNode[]>([]);
|
dataChange = new BehaviorSubject<TreeBaseNode[]>([]);
|
||||||
childrenSubscription = null;
|
childrenSubscription = null;
|
||||||
@@ -40,15 +39,13 @@ export class TreeViewDataSource {
|
|||||||
this.dataChange.next(value);
|
this.dataChange.next(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(private treeControl: FlatTreeControl<TreeBaseNode>,
|
constructor(private treeControl: FlatTreeControl<TreeBaseNode>, private treeViewService: TreeViewService) {
|
||||||
private treeViewService: TreeViewService) {
|
this.dataChange.subscribe((treeNodes) => (this.treeNodes = treeNodes));
|
||||||
this.dataChange.subscribe((treeNodes) => this.treeNodes = treeNodes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(collectionViewer: CollectionViewer): Observable<TreeBaseNode[]> {
|
connect(collectionViewer: CollectionViewer): Observable<TreeBaseNode[]> {
|
||||||
this.changeSubscription = this.treeControl.expansionModel.changed.subscribe((change) => {
|
this.changeSubscription = this.treeControl.expansionModel.changed.subscribe((change) => {
|
||||||
if ((change as SelectionChange<TreeBaseNode>).added &&
|
if ((change as SelectionChange<TreeBaseNode>).added && (change as SelectionChange<TreeBaseNode>).added.length > 0) {
|
||||||
(change as SelectionChange<TreeBaseNode>).added.length > 0) {
|
|
||||||
this.expandTreeNodes(change as SelectionChange<TreeBaseNode>);
|
this.expandTreeNodes(change as SelectionChange<TreeBaseNode>);
|
||||||
} else if ((change as SelectionChange<TreeBaseNode>).removed) {
|
} else if ((change as SelectionChange<TreeBaseNode>).removed) {
|
||||||
this.reduceTreeNodes(change as SelectionChange<TreeBaseNode>);
|
this.reduceTreeNodes(change as SelectionChange<TreeBaseNode>);
|
||||||
@@ -71,33 +68,35 @@ export class TreeViewDataSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private reduceTreeNodes(change: SelectionChange<TreeBaseNode>) {
|
private reduceTreeNodes(change: SelectionChange<TreeBaseNode>) {
|
||||||
change.removed.slice().reverse().forEach((node) => this.toggleNode(node));
|
change.removed
|
||||||
|
.slice()
|
||||||
|
.reverse()
|
||||||
|
.forEach((node) => this.toggleNode(node));
|
||||||
}
|
}
|
||||||
|
|
||||||
private expandNode(node: TreeBaseNode) {
|
private expandNode(node: TreeBaseNode) {
|
||||||
this.childrenSubscription = this.treeViewService.getTreeNodes(node.nodeId)
|
this.childrenSubscription = this.treeViewService.getTreeNodes(node.nodeId).subscribe((children) => {
|
||||||
.subscribe((children) => {
|
const index = this.data.indexOf(node);
|
||||||
const index = this.data.indexOf(node);
|
if (!children || index < 0) {
|
||||||
if (!children || index < 0) {
|
node.expandable = false;
|
||||||
node.expandable = false;
|
return;
|
||||||
return;
|
}
|
||||||
}
|
const nodes = children.map((actualNode) => {
|
||||||
const nodes = children.map((actualNode) => {
|
actualNode.level = node.level + 1;
|
||||||
actualNode.level = node.level + 1;
|
return actualNode;
|
||||||
return actualNode;
|
|
||||||
});
|
|
||||||
this.data.splice(index + 1, 0, ...nodes);
|
|
||||||
this.dataChange.next(this.data);
|
|
||||||
});
|
});
|
||||||
|
this.data.splice(index + 1, 0, ...nodes);
|
||||||
|
this.dataChange.next(this.data);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleNode(node: TreeBaseNode) {
|
toggleNode(node: TreeBaseNode) {
|
||||||
const index = this.data.indexOf(node);
|
const index = this.data.indexOf(node);
|
||||||
let count = 0;
|
let count = 0;
|
||||||
for (let i = index + 1; i < this.data.length
|
for (let i = index + 1; i < this.data.length && this.data[i].level > node.level; i++, count++) {
|
||||||
&& this.data[i].level > node.level; i++ , count++) { }
|
/* empty */
|
||||||
|
}
|
||||||
this.data.splice(index + 1, count);
|
this.data.splice(index + 1, count);
|
||||||
this.dataChange.next(this.data);
|
this.dataChange.next(this.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
import { VersionCompatibilityService } from './version-compatibility.service';
|
import { VersionCompatibilityService } from './version-compatibility.service';
|
||||||
|
|
||||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
|
||||||
/**
|
/**
|
||||||
* Create a version compatibility factory
|
* Create a version compatibility factory
|
||||||
*
|
*
|
||||||
|
@@ -53,7 +53,9 @@ export class ClipboardService {
|
|||||||
this.document.execCommand('copy');
|
this.document.execCommand('copy');
|
||||||
}
|
}
|
||||||
this.notify(message);
|
this.notify(message);
|
||||||
} catch {}
|
} catch {
|
||||||
|
/* empty */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +78,9 @@ export class ClipboardService {
|
|||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
}
|
}
|
||||||
this.notify(message);
|
this.notify(message);
|
||||||
} catch {}
|
} catch {
|
||||||
|
/* empty */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private notify(message) {
|
private notify(message) {
|
||||||
|
@@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
import { DirectionalityConfigService } from './directionality-config.service';
|
import { DirectionalityConfigService } from './directionality-config.service';
|
||||||
|
|
||||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
|
||||||
/**
|
/**
|
||||||
* Creates a factory for Angular modules
|
* Creates a factory for Angular modules
|
||||||
*
|
*
|
||||||
|
@@ -22,36 +22,38 @@ export interface FileInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class FileUtils {
|
export class FileUtils {
|
||||||
|
|
||||||
static flatten(folder: any): Promise<FileInfo[]> {
|
static flatten(folder: any): Promise<FileInfo[]> {
|
||||||
const reader = folder.createReader();
|
const reader = folder.createReader();
|
||||||
const files: FileInfo[] = [];
|
const files: FileInfo[] = [];
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const iterations = [];
|
const iterations = [];
|
||||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
|
||||||
(function traverse() {
|
(function traverse() {
|
||||||
reader.readEntries((entries) => {
|
reader.readEntries((entries) => {
|
||||||
if (!entries.length) {
|
if (!entries.length) {
|
||||||
Promise.all(iterations).then(() => resolve(files));
|
Promise.all(iterations).then(() => resolve(files));
|
||||||
} else {
|
} else {
|
||||||
iterations.push(Promise.all(entries.map((entry) => {
|
iterations.push(
|
||||||
if (entry.isFile) {
|
Promise.all(
|
||||||
return new Promise<void>((resolveFile) => {
|
entries.map((entry) => {
|
||||||
entry.file((file: File) => {
|
if (entry.isFile) {
|
||||||
files.push({
|
return new Promise<void>((resolveFile) => {
|
||||||
entry,
|
entry.file((file: File) => {
|
||||||
file,
|
files.push({
|
||||||
relativeFolder: entry.fullPath.replace(/\/[^/]*$/, '')
|
entry,
|
||||||
|
file,
|
||||||
|
relativeFolder: entry.fullPath.replace(/\/[^/]*$/, '')
|
||||||
|
});
|
||||||
|
resolveFile();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
resolveFile();
|
} else {
|
||||||
});
|
return FileUtils.flatten(entry).then((result) => {
|
||||||
});
|
files.push(...result);
|
||||||
} else {
|
});
|
||||||
return FileUtils.flatten(entry).then((result) => {
|
}
|
||||||
files.push(...result);
|
})
|
||||||
});
|
)
|
||||||
}
|
);
|
||||||
})));
|
|
||||||
// Try calling traverse() again for the same dir, according to spec
|
// Try calling traverse() again for the same dir, according to spec
|
||||||
traverse();
|
traverse();
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,6 @@ import { RuleService } from './rule.service';
|
|||||||
import { ExtensionElement } from '../config/extension-element';
|
import { ExtensionElement } from '../config/extension-element';
|
||||||
import { BehaviorSubject, Observable } from 'rxjs';
|
import { BehaviorSubject, Observable } from 'rxjs';
|
||||||
|
|
||||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
|
||||||
/**
|
/**
|
||||||
* The default extensions factory
|
* The default extensions factory
|
||||||
*
|
*
|
||||||
@@ -35,7 +34,7 @@ import { BehaviorSubject, Observable } from 'rxjs';
|
|||||||
*/
|
*/
|
||||||
export function extensionJsonsFactory() {
|
export function extensionJsonsFactory() {
|
||||||
return [];
|
return [];
|
||||||
};
|
}
|
||||||
|
|
||||||
export const EXTENSION_JSONS = new InjectionToken<string[][]>('extension-jsons', {
|
export const EXTENSION_JSONS = new InjectionToken<string[][]>('extension-jsons', {
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
@@ -47,7 +46,6 @@ export const EXTENSION_JSON_VALUES = new InjectionToken<string[][]>('extension-j
|
|||||||
factory: extensionJsonsFactory
|
factory: extensionJsonsFactory
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
|
||||||
/**
|
/**
|
||||||
* Provides the extension json values for the angular modules
|
* Provides the extension json values for the angular modules
|
||||||
*
|
*
|
||||||
@@ -60,7 +58,7 @@ export function provideExtensionConfig(jsons: string[]) {
|
|||||||
useValue: jsons,
|
useValue: jsons,
|
||||||
multi: true
|
multi: true
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the extension json raw values for the angular modules
|
* Provides the extension json raw values for the angular modules
|
||||||
@@ -74,7 +72,7 @@ export function provideExtensionConfigValues(extensionConfigValue: ExtensionConf
|
|||||||
useValue: extensionConfigValue,
|
useValue: extensionConfigValue,
|
||||||
multi: true
|
multi: true
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -109,12 +107,7 @@ export class ExtensionService {
|
|||||||
* @returns The loaded config data
|
* @returns The loaded config data
|
||||||
*/
|
*/
|
||||||
async load(): Promise<ExtensionConfig> {
|
async load(): Promise<ExtensionConfig> {
|
||||||
const config = await this.loader.load(
|
const config = await this.loader.load(this.configPath, this.pluginsPath, this.extensionJsons.flat(), this.extensionJsonValues.flat());
|
||||||
this.configPath,
|
|
||||||
this.pluginsPath,
|
|
||||||
this.extensionJsons.flat(),
|
|
||||||
this.extensionJsonValues.flat()
|
|
||||||
);
|
|
||||||
|
|
||||||
this.setup(config);
|
this.setup(config);
|
||||||
return config;
|
return config;
|
||||||
@@ -209,9 +202,7 @@ export class ExtensionService {
|
|||||||
* @returns Array of auth guards or empty array if none were found
|
* @returns Array of auth guards or empty array if none were found
|
||||||
*/
|
*/
|
||||||
getAuthGuards(ids: string[]): Array<Type<any>> {
|
getAuthGuards(ids: string[]): Array<Type<any>> {
|
||||||
return (ids || [])
|
return (ids || []).map((id) => this.authGuards[id]).filter((guard) => guard);
|
||||||
.map((id) => this.authGuards[id])
|
|
||||||
.filter((guard) => guard);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -272,12 +263,12 @@ export class ExtensionService {
|
|||||||
* @param context Parameter object for the expression with details of app state
|
* @param context Parameter object for the expression with details of app state
|
||||||
* @returns Result of evaluated expression, if found, or the literal value otherwise
|
* @returns Result of evaluated expression, if found, or the literal value otherwise
|
||||||
*/
|
*/
|
||||||
runExpression(value: string | any , context?: any) {
|
runExpression(value: string | any, context?: any) {
|
||||||
if (typeof value === 'string' ) {
|
if (typeof value === 'string') {
|
||||||
return this.evaluateExpression(value, context);
|
return this.evaluateExpression(value, context);
|
||||||
} else {
|
} else {
|
||||||
const duplicate = Object.assign({}, value);
|
const duplicate = Object.assign({}, value);
|
||||||
Object.keys(duplicate).forEach( (key) => {
|
Object.keys(duplicate).forEach((key) => {
|
||||||
duplicate[key] = this.evaluateExpression(duplicate[key], context);
|
duplicate[key] = this.evaluateExpression(duplicate[key], context);
|
||||||
});
|
});
|
||||||
return duplicate;
|
return duplicate;
|
||||||
|
@@ -4,11 +4,7 @@ module.exports = {
|
|||||||
rootMain: rootPath,
|
rootMain: rootPath,
|
||||||
stories: [...rootPath.stories, '../**/*.stories.@(js|jsx|ts|tsx)'],
|
stories: [...rootPath.stories, '../**/*.stories.@(js|jsx|ts|tsx)'],
|
||||||
|
|
||||||
staticDirs: [
|
staticDirs: [...rootPath.staticDirs, { from: __dirname + '/../src/lib/i18n', to: 'assets/adf-core/i18n' }],
|
||||||
...rootPath.staticDirs,
|
|
||||||
{ from: __dirname + '/../src/lib/i18n', to: 'assets/adf-core/i18n' },
|
|
||||||
{ from: __dirname + '/../src/lib/assets/images', to: 'assets/images' }
|
|
||||||
],
|
|
||||||
|
|
||||||
addons: ['@storybook/addon-essentials', ...rootPath.addons],
|
addons: ['@storybook/addon-essentials', ...rootPath.addons],
|
||||||
|
|
||||||
|
@@ -66,7 +66,9 @@ export class ContentCloudNodeSelectorService {
|
|||||||
if (destinationFolderPath.alias && destinationFolderPath.path) {
|
if (destinationFolderPath.alias && destinationFolderPath.path) {
|
||||||
try {
|
try {
|
||||||
return await this.getNodeId(destinationFolderPath.alias, destinationFolderPath.path).toPromise();
|
return await this.getNodeId(destinationFolderPath.alias, destinationFolderPath.path).toPromise();
|
||||||
} catch {}
|
} catch {
|
||||||
|
/*empty*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.getNodeId(destinationFolderPath.alias).toPromise();
|
return this.getNodeId(destinationFolderPath.alias).toPromise();
|
||||||
@@ -82,7 +84,9 @@ export class ContentCloudNodeSelectorService {
|
|||||||
if (nodeId) {
|
if (nodeId) {
|
||||||
try {
|
try {
|
||||||
isExistingNode = await this.getNodeId(nodeId).pipe(mapTo(true)).toPromise();
|
isExistingNode = await this.getNodeId(nodeId).pipe(mapTo(true)).toPromise();
|
||||||
} catch {}
|
} catch {
|
||||||
|
/*empty*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return isExistingNode;
|
return isExistingNode;
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,6 @@ import { Logger } from '../../utils/logger';
|
|||||||
import { browser } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
|
|
||||||
export class GroupIdentityService {
|
export class GroupIdentityService {
|
||||||
|
|
||||||
api: ApiService;
|
api: ApiService;
|
||||||
|
|
||||||
constructor(api: ApiService) {
|
constructor(api: ApiService) {
|
||||||
@@ -75,9 +74,11 @@ export class GroupIdentityService {
|
|||||||
|
|
||||||
Logger.log(`Data ${JSON.stringify(data)}`);
|
Logger.log(`Data ${JSON.stringify(data)}`);
|
||||||
|
|
||||||
return data[0]; Logger.error('Group not found');
|
return data[0];
|
||||||
|
Logger.error('Group not found');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Logger.error('Group not found');
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -135,5 +136,4 @@ export class GroupIdentityService {
|
|||||||
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||||
return data[0].id;
|
return data[0].id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -388,7 +388,9 @@ export class DataTableComponentPage {
|
|||||||
this.rootElement.element(by.tagName(materialLocators.Progress.spinner.root)),
|
this.rootElement.element(by.tagName(materialLocators.Progress.spinner.root)),
|
||||||
MAX_LOADING_TIME
|
MAX_LOADING_TIME
|
||||||
);
|
);
|
||||||
} catch (error) {}
|
} catch (error) {
|
||||||
|
Logger.error('Loading spinner is not present');
|
||||||
|
}
|
||||||
|
|
||||||
if (await this.isEmpty()) {
|
if (await this.isEmpty()) {
|
||||||
Logger.log('empty page');
|
Logger.log('empty page');
|
||||||
@@ -414,7 +416,9 @@ export class DataTableComponentPage {
|
|||||||
try {
|
try {
|
||||||
Logger.log('wait datatable loading spinner is present');
|
Logger.log('wait datatable loading spinner is present');
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.bar.root)));
|
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.bar.root)));
|
||||||
} catch (error) {}
|
} catch (error) {
|
||||||
|
Logger.error('Infinite pagination spinner is not present');
|
||||||
|
}
|
||||||
if (await this.isEmpty()) {
|
if (await this.isEmpty()) {
|
||||||
Logger.log('empty page');
|
Logger.log('empty page');
|
||||||
} else {
|
} else {
|
||||||
|
@@ -43,6 +43,7 @@ export class LoginPage {
|
|||||||
try {
|
try {
|
||||||
currentUrl = await browser.getCurrentUrl();
|
currentUrl = await browser.getCurrentUrl();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
/* do nothing */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!currentUrl || currentUrl.indexOf(this.loginUrl) === -1) {
|
if (!currentUrl || currentUrl.indexOf(this.loginUrl) === -1) {
|
||||||
@@ -87,7 +88,7 @@ export class LoginPage {
|
|||||||
if (oauth2 && oauth2.silentLogin === false) {
|
if (oauth2 && oauth2.silentLogin === false) {
|
||||||
Logger.log(`Login SSO`);
|
Logger.log(`Login SSO`);
|
||||||
await this.clickOnSSOButton();
|
await this.clickOnSSOButton();
|
||||||
}else{
|
} else {
|
||||||
Logger.log(`Login SSO silent login`);
|
Logger.log(`Login SSO silent login`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -42,7 +42,9 @@ export class SettingsPage {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
currentUrl = await browser.getCurrentUrl();
|
currentUrl = await browser.getCurrentUrl();
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
/* do nothing */
|
||||||
|
}
|
||||||
|
|
||||||
if (!currentUrl || currentUrl.indexOf(this.settingsURL) === -1) {
|
if (!currentUrl || currentUrl.indexOf(this.settingsURL) === -1) {
|
||||||
await browser.get(this.settingsURL);
|
await browser.get(this.settingsURL);
|
||||||
|
@@ -75,7 +75,9 @@ export class ViewerPage {
|
|||||||
Logger.log('wait spinner is present');
|
Logger.log('wait spinner is present');
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.spinner.root)));
|
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.spinner.root)));
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName(materialLocators.Progress.spinner.root)), MAX_LOADING_TIME);
|
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName(materialLocators.Progress.spinner.root)), MAX_LOADING_TIME);
|
||||||
} catch (error) {}
|
} catch (error) {
|
||||||
|
Logger.error('Spinner is not present');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user