Fix: fix cf ownership requirement

This commit is contained in:
shamoon 2025-02-10 18:58:45 -08:00
parent 4e61c2b2e6
commit fdfea68576

View File

@ -75,7 +75,7 @@
<pngx-custom-fields-dropdown <pngx-custom-fields-dropdown
*pngxIfPermissions="{ action: PermissionAction.View, type: PermissionType.CustomField }" *pngxIfPermissions="{ action: PermissionAction.View, type: PermissionType.CustomField }"
[documentId]="documentId" [documentId]="documentId"
[disabled]="!userIsOwner || !userCanEdit" [disabled]="!userCanEdit"
[existingFields]="document?.custom_fields" [existingFields]="document?.custom_fields"
(created)="refreshCustomFields()" (created)="refreshCustomFields()"
(added)="addField($event)"> (added)="addField($event)">
@ -127,7 +127,7 @@
@case (CustomFieldDataType.String) { @case (CustomFieldDataType.String) {
<pngx-input-text formControlName="value" <pngx-input-text formControlName="value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name" [title]="getCustomFieldFromInstance(fieldInstance)?.name"
[removable]="userIsOwner && userCanEdit" [removable]="userCanEdit"
(removed)="removeField(fieldInstance)" (removed)="removeField(fieldInstance)"
[horizontal]="true" [horizontal]="true"
[error]="getCustomFieldError(i)"></pngx-input-text> [error]="getCustomFieldError(i)"></pngx-input-text>
@ -135,7 +135,7 @@
@case (CustomFieldDataType.Date) { @case (CustomFieldDataType.Date) {
<pngx-input-date formControlName="value" <pngx-input-date formControlName="value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name" [title]="getCustomFieldFromInstance(fieldInstance)?.name"
[removable]="userIsOwner && userCanEdit" [removable]="userCanEdit"
(removed)="removeField(fieldInstance)" (removed)="removeField(fieldInstance)"
[horizontal]="true" [horizontal]="true"
[error]="getCustomFieldError(i)"></pngx-input-date> [error]="getCustomFieldError(i)"></pngx-input-date>
@ -143,7 +143,7 @@
@case (CustomFieldDataType.Integer) { @case (CustomFieldDataType.Integer) {
<pngx-input-number formControlName="value" <pngx-input-number formControlName="value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name" [title]="getCustomFieldFromInstance(fieldInstance)?.name"
[removable]="userIsOwner && userCanEdit" [removable]="userCanEdit"
(removed)="removeField(fieldInstance)" (removed)="removeField(fieldInstance)"
[horizontal]="true" [horizontal]="true"
[showAdd]="false" [showAdd]="false"
@ -152,7 +152,7 @@
@case (CustomFieldDataType.Float) { @case (CustomFieldDataType.Float) {
<pngx-input-number formControlName="value" <pngx-input-number formControlName="value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name" [title]="getCustomFieldFromInstance(fieldInstance)?.name"
[removable]="userIsOwner && userCanEdit" [removable]="userCanEdit"
(removed)="removeField(fieldInstance)" (removed)="removeField(fieldInstance)"
[horizontal]="true" [horizontal]="true"
[showAdd]="false" [showAdd]="false"
@ -163,7 +163,7 @@
<pngx-input-monetary formControlName="value" <pngx-input-monetary formControlName="value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name" [title]="getCustomFieldFromInstance(fieldInstance)?.name"
[defaultCurrency]="getCustomFieldFromInstance(fieldInstance)?.extra_data?.default_currency" [defaultCurrency]="getCustomFieldFromInstance(fieldInstance)?.extra_data?.default_currency"
[removable]="userIsOwner && userCanEdit" [removable]="userCanEdit"
(removed)="removeField(fieldInstance)" (removed)="removeField(fieldInstance)"
[horizontal]="true" [horizontal]="true"
[error]="getCustomFieldError(i)"></pngx-input-monetary> [error]="getCustomFieldError(i)"></pngx-input-monetary>
@ -171,14 +171,14 @@
@case (CustomFieldDataType.Boolean) { @case (CustomFieldDataType.Boolean) {
<pngx-input-check formControlName="value" <pngx-input-check formControlName="value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name" [title]="getCustomFieldFromInstance(fieldInstance)?.name"
[removable]="userIsOwner && userCanEdit" [removable]="userCanEdit"
(removed)="removeField(fieldInstance)" (removed)="removeField(fieldInstance)"
[horizontal]="true"></pngx-input-check> [horizontal]="true"></pngx-input-check>
} }
@case (CustomFieldDataType.Url) { @case (CustomFieldDataType.Url) {
<pngx-input-url formControlName="value" <pngx-input-url formControlName="value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name" [title]="getCustomFieldFromInstance(fieldInstance)?.name"
[removable]="userIsOwner && userCanEdit" [removable]="userCanEdit"
(removed)="removeField(fieldInstance)" (removed)="removeField(fieldInstance)"
[horizontal]="true" [horizontal]="true"
[error]="getCustomFieldError(i)"></pngx-input-url> [error]="getCustomFieldError(i)"></pngx-input-url>
@ -187,7 +187,7 @@
<pngx-input-document-link formControlName="value" <pngx-input-document-link formControlName="value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name" [title]="getCustomFieldFromInstance(fieldInstance)?.name"
[parentDocumentID]="documentId" [parentDocumentID]="documentId"
[removable]="userIsOwner && userCanEdit" [removable]="userCanEdit"
(removed)="removeField(fieldInstance)" (removed)="removeField(fieldInstance)"
[horizontal]="true" [horizontal]="true"
[error]="getCustomFieldError(i)"></pngx-input-document-link> [error]="getCustomFieldError(i)"></pngx-input-document-link>
@ -199,7 +199,7 @@
bindLabel="label" bindLabel="label"
[allowNull]="true" [allowNull]="true"
[horizontal]="true" [horizontal]="true"
[removable]="userIsOwner && userCanEdit" [removable]="userCanEdit"
(removed)="removeField(fieldInstance)" (removed)="removeField(fieldInstance)"
[error]="getCustomFieldError(i)"></pngx-input-select> [error]="getCustomFieldError(i)"></pngx-input-select>
} }