[MIGRATION] - Solving a funny comment issue part 2

This commit is contained in:
VitoAlbano
2024-08-06 00:52:07 +01:00
parent 3e00a1fe65
commit 530b2be382
5 changed files with 64 additions and 31 deletions

View File

@@ -133,7 +133,7 @@ describe('NodeRestoreDirective', () => {
describe('notification', () => {
it('should notify on multiple fails', (done) => {
const error = { message: '{ "error": { /* empty */ } }' };
const error = { message: '{ "error": { } }' };
directiveInstance.restore.subscribe((event: any) => {
expect(event.message).toEqual('CORE.RESTORE_NODE.PARTIAL_PLURAL');

View File

@@ -176,7 +176,9 @@ export class TagsCreatorComponent implements OnInit, OnDestroy {
@ViewChild('tagNameInput')
private tagNameInputElement: ElementRef;
constructor(private tagService: TagService, private notificationService: NotificationService) { /* empty */ }
constructor(private tagService: TagService, private notificationService: NotificationService) {
/* empty */
}
ngOnInit(): void {
this.tagNameControl.valueChanges
@@ -374,7 +376,7 @@ export class TagsCreatorComponent implements OnInit, OnDestroy {
}
private validateSpecialCharacters(tagNameControl: FormControl<string>): TagNameControlErrors | null {
const specialSymbolsRegex = /[{ /* empty */ }()^':"\\|<>/?]/;
const specialSymbolsRegex = /[{}()^':"\\|<>/?]/;
return tagNameControl.value.length && specialSymbolsRegex.test(tagNameControl.value) ? { specialCharacters: true } : null;
}

View File

@@ -32,8 +32,12 @@ import { StorageService } from '@alfresco/adf-core';
@Injectable()
export class StorageFeaturesService implements IFeaturesService, IWritableFeaturesService {
private currentFlagState: WritableFlagChangeset = { /* empty */ };
private flags = new BehaviorSubject<WritableFlagChangeset>({ /* empty */ });
private currentFlagState: WritableFlagChangeset = {
/* empty */
};
private flags = new BehaviorSubject<WritableFlagChangeset>({
/* empty */
});
private flags$ = this.flags.asObservable();
constructor(
@@ -51,7 +55,7 @@ export class StorageFeaturesService implements IFeaturesService, IWritableFeatur
}
init(): Observable<WritableFlagChangeset> {
const storedFlags = JSON.parse(this.storageService.getItem(this.storageKey) || '{ /* empty */ }');
const storedFlags = JSON.parse(this.storageService.getItem(this.storageKey) || '{}');
const initialFlagChangeSet = FlagSetParser.deserialize(storedFlags);
this.flags.next(initialFlagChangeSet);
return of(initialFlagChangeSet);
@@ -70,11 +74,17 @@ export class StorageFeaturesService implements IFeaturesService, IWritableFeatur
}
setFlag(key: string, value: any): void {
let fictive = { /* empty */ };
let fictive = {
/* empty */
};
if (!this.currentFlagState[key]) {
fictive = { fictive: true };
} else {
fictive = this.currentFlagState[key]?.fictive ? { fictive: true } : { /* empty */ };
fictive = this.currentFlagState[key]?.fictive
? { fictive: true }
: {
/* empty */
};
}
this.flags.next({
@@ -104,13 +114,16 @@ export class StorageFeaturesService implements IFeaturesService, IWritableFeatur
fictive: true
}
}),
{ /* empty */ }
{
/* empty */
}
)
);
}
mergeFlags(flags: FlagChangeset): void {
const mergedFlags: WritableFlagChangeset = Object.keys(flags).reduce((acc, key) => {
const mergedFlags: WritableFlagChangeset = Object.keys(flags).reduce(
(acc, key) => {
const current = this.currentFlagState[key]?.current;
return {
...acc,
@@ -119,7 +132,11 @@ export class StorageFeaturesService implements IFeaturesService, IWritableFeatur
previous: current ?? null
}
};
}, { /* empty */ });
},
{
/* empty */
}
);
Object.keys(this.currentFlagState)
.filter((key) => !flags[key])

View File

@@ -22,7 +22,6 @@ import { Logger } from '../../utils/logger';
import { browser } from 'protractor';
export class GroupIdentityService {
api: ApiService;
constructor(api: ApiService) {
@@ -42,7 +41,9 @@ export class GroupIdentityService {
async createGroup(groupName: string): Promise<any> {
const path = '/groups';
const method = 'POST';
const queryParams = { /* empty */ };
const queryParams = {
/* empty */
};
const postBody = {
name: `${groupName}-${browser.params.groupSuffix}`
};
@@ -53,8 +54,12 @@ export class GroupIdentityService {
async deleteGroup(groupId: string): Promise<any> {
const path = `/groups/${groupId}`;
const method = 'DELETE';
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
const queryParams = {
/* empty */
};
const postBody = {
/* empty */
};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data;
}
@@ -69,15 +74,18 @@ export class GroupIdentityService {
const path = `/groups`;
const method = 'GET';
const queryParams = { search: groupName };
const postBody = { /* empty */ };
const postBody = {
/* empty */
};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
Logger.log(`Data ${JSON.stringify(data)}`);
return data[0]; Logger.error('Group not found');
return data[0];
Logger.error('Group not found');
} catch (error) {
/* ignore */
}
};
@@ -89,7 +97,9 @@ export class GroupIdentityService {
const path = `/groups/${groupId}/role-mappings/realm`;
const method = 'POST';
const queryParams = { /* empty */ };
const queryParams = {
/* empty */
};
const postBody = [{ id: roleId, name: roleName }];
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
@@ -107,7 +117,9 @@ export class GroupIdentityService {
async addClientRole(groupId: string, clientId: string, roleId: string, roleName: string): Promise<any> {
const path = `/groups/${groupId}/role-mappings/clients/${clientId}`;
const method = 'POST';
const queryParams = { /* empty */ };
const queryParams = {
/* empty */
};
const postBody = [
{
id: roleId,
@@ -130,10 +142,11 @@ export class GroupIdentityService {
const path = `/clients`;
const method = 'GET';
const queryParams = { clientId: applicationName };
const postBody = { /* empty */ };
const postBody = {
/* empty */
};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data[0].id;
}
}

View File

@@ -43,6 +43,7 @@ export class LoginPage {
try {
currentUrl = await browser.getCurrentUrl();
} catch (e) {
/* empty */
}
if (!currentUrl || currentUrl.indexOf(this.loginUrl) === -1) {