Skip to content

Commit

Permalink
Merge branch 'release/6.4.0' into NAE-2011
Browse files Browse the repository at this point in the history
  • Loading branch information
machacjozef authored Nov 22, 2024
2 parents 2929a45 + e6219b0 commit 815273e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Full Changelog: [https://github.com/netgrif/components/commits/v6.4.0](https://github.com/netgrif/components/commits/v6.4.0)

## [6.4.0](https://github.com/netgrif/components/releases/tag/v6.4.0) (2024-09-26)
## [6.4.0](https://github.com/netgrif/components/releases/tag/v6.4.0) (2024-11-07)

### Fixed
- [NAE-1915] TaskRef behaviour handling for multiple level
Expand All @@ -21,7 +21,7 @@ Full Changelog: [https://github.com/netgrif/components/commits/v6.4.0](https://g
- [NAE-1983] Public view file handling
- [NAE-1999] Broken pagination on paged case view
- [NAE-2005] Field behavior change does not work correctly with multiple references using taskRef

- [NAE-2013] Autocomplete options are set to the first dropdown

### Added
- [NAE-1890] Data field component register
Expand All @@ -46,6 +46,7 @@ Full Changelog: [https://github.com/netgrif/components/commits/v6.4.0](https://g
- [NAE-1957] Allow filter to caseRef field and variants
- [NAE-1958] Make component properties changeable
- [NAE-1949] Allowed Types for Filefield
- [NAE-2016] Global roles for menu items permissions


## [6.3.3](https://github.com/netgrif/components/releases/tag/v6.3.3) (2024-01-19)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netgrif/components-project",
"version": "6.4.0-rc.3",
"version": "6.4.0-rc.6",
"description": "Netgrif Application Engine Frontend project. Project includes angular libraries as base for NAE applications.",
"homepage": "https://components.netgrif.com",
"license": "SEE LICENSE IN LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion projects/netgrif-components-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netgrif/components-core",
"version": "6.4.0-rc.3",
"version": "6.4.0-rc.6",
"description": "Netgrif Application engine frontend core Angular library",
"homepage": "https://components.netgrif.com",
"license": "SEE LICENSE IN LICENSE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ export abstract class TaskContentService implements OnDestroy {
Object.keys(chFields).forEach(changedField => {
if (chFields.taskId === this._task.stringId && this.isFieldInTask(chFields.taskId, changedField)) {
this.updateField(chFields, this.taskFieldsIndex[chFields.taskId].fields[changedField], frontendActions);
} else if (!!this.getReferencedTaskId(changedField)) {
this.updateField(chFields, this.taskFieldsIndex[this.getReferencedTaskId(changedField)].fields[changedField], frontendActions, true);
} else if (!!this.getReferencedTaskId(changedField, chFields)) {
this.updateField(chFields, this.taskFieldsIndex[this.getReferencedTaskId(changedField, chFields)].fields[changedField], frontendActions, true);
}
});

Expand All @@ -253,7 +253,7 @@ export abstract class TaskContentService implements OnDestroy {
if (!referenced && updatedField.behavior[this._task.transitionId]) {
field.behavior = updatedField.behavior[this._task.transitionId];
} else if (referenced) {
const taskId = this.getReferencedTaskId(field.stringId);
const taskId = this.getReferencedTaskId(field.stringId, chFields);
const taskRef = this.findTaskRefId(taskId, this.taskFieldsIndex[this._task.stringId].fields);
const transitionId = this.taskFieldsIndex[taskId].transitionId;
if (!!transitionId && transitionId !== '' && updatedField.behavior[transitionId])
Expand Down Expand Up @@ -303,19 +303,10 @@ export abstract class TaskContentService implements OnDestroy {
&& !!this.taskFieldsIndex[taskId].fields[changedField]
}

protected getReferencedTaskId(changedField: string): string {
protected getReferencedTaskId(changedField: string, chFields: ChangedFields): string {
return !!this.taskFieldsIndex ?
Object.keys(this.taskFieldsIndex).find(taskId => taskId !== this.task.stringId && Object.keys(this.taskFieldsIndex[taskId].fields).includes(changedField)) : undefined;
}

protected getReferencedTransitionId(changedField: string): string {
if (!!this.taskFieldsIndex) {
const taskFieldsIndexId = this.getReferencedTaskId(changedField);
if (!!this.taskFieldsIndex[taskFieldsIndexId]) {
return this.taskFieldsIndex[taskFieldsIndexId].transitionId;
}
}
return undefined;
(Object.keys(this.taskFieldsIndex).find(taskId => taskId !== this.task.stringId && taskId === chFields.taskId && Object.keys(this.taskFieldsIndex[taskId].fields).includes(changedField))
|| Object.keys(this.taskFieldsIndex).find(taskId => taskId !== this.task.stringId && Object.keys(this.taskFieldsIndex[taskId].fields).includes(changedField))) : undefined;
}

protected findTaskRefId(taskId: string, fields: { [fieldId: string]: DataField<any>}): DataField<any> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export class UserService implements OnDestroy {
protected _subAnonym: Subscription;
private _publicLoadCalled: boolean;

public readonly GLOBAL_ROLE_PREFIX = 'global_';

constructor(protected _authService: AuthenticationService,
protected _userResource: UserResourceService,
protected _userTransform: UserTransformer,
Expand Down Expand Up @@ -118,16 +120,23 @@ export class UserService implements OnDestroy {
}

/**
* Checks whether the user has role with the specified identifier in a process with the specified identifier (any version)
* Checks whether the user has a role with the specified identifier in a process with the specified identifier (any version),
* or if the role is global (with prefix 'global_').
* @param roleIdentifier identifier (import ID) of the role we want to check
* @param netIdentifier identifier (import ID) of the process the role is defined in
*/
public hasRoleByIdentifier(roleIdentifier: string, netIdentifier: string): boolean {
const user = this._user.getSelfOrImpersonated();
if (!roleIdentifier || !netIdentifier || !user.roles) {
if (!roleIdentifier || !user.roles) {
return false;
}
return user.roles.some(r => r.netImportId === netIdentifier && r.importId === roleIdentifier);

return user.roles.some(r => {
const matchesRole = r.importId === roleIdentifier;
const isGlobalRole = r.importId.startsWith(this.GLOBAL_ROLE_PREFIX);
const matchesNet = r.netImportId === netIdentifier;
return matchesRole && (isGlobalRole || matchesNet);
});
}

/**
Expand Down
4 changes: 2 additions & 2 deletions projects/netgrif-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netgrif/components",
"version": "6.4.0-rc.3",
"version": "6.4.0-rc.6",
"description": "Netgrif Application Engine frontend Angular components",
"homepage": "https://components.netgrif.com",
"license": "SEE LICENSE IN LICENSE",
Expand Down Expand Up @@ -29,7 +29,7 @@
"nae frontend"
],
"peerDependencies": {
"@netgrif/components-core": "6.4.0-rc.3",
"@netgrif/components-core": "6.4.0-rc.6",
"@angular-material-components/datetime-picker": "~7.0.1",
"@angular-material-components/moment-adapter": "~7.0.0",
"@angular/animations": "~13.3.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div fxFlex fxLayout="row" fxLayoutAlign="center center">
<div fxFlex="20" class="divider-line"
<div *ngIf='!!dataField.value?.defaultValue && dataField.value?.defaultValue.length > 0' fxFlex="20" class="divider-line"
[ngClass]="{'divider-line-lgbt': isDividerLGBTQ(), 'primary-background-color': !checkPropertyInComponent('dividerColor')}"
[ngStyle]="checkPropertyInComponent('dividerColor') && {'background': getDividerColor()}"></div>
<span *ngIf='!!dataField.value' [ngClass]="{'margin-default': dataField.value?.defaultValue !== ''}"
Expand Down

0 comments on commit 815273e

Please sign in to comment.