6237598a30
- Add the meeting bot preference field to the CalendarEvent record page fields view. - Use a Standard-app ownership gate for record field read-only logic. - Allow app-owned and workspace-custom fields on system objects to follow isUIEditable and permissions. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/21883?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
27 lines
751 B
TypeScript
27 lines
751 B
TypeScript
import { isTwentyStandardApplication } from '@/applications/utils/isTwentyStandardApplication';
|
|
import { isDefined } from 'twenty-shared/utils';
|
|
|
|
type ApplicationLike = {
|
|
id: string;
|
|
universalIdentifier?: string | null;
|
|
};
|
|
|
|
export const getIsMetadataItemFromStandardApplication = (
|
|
metadataItem: { applicationId?: string | null },
|
|
applications: ApplicationLike[],
|
|
): boolean | undefined => {
|
|
if (!isDefined(metadataItem.applicationId)) {
|
|
return undefined;
|
|
}
|
|
|
|
const application = applications.find(
|
|
(application) => application.id === metadataItem.applicationId,
|
|
);
|
|
|
|
if (!isDefined(application) || !isDefined(application.universalIdentifier)) {
|
|
return undefined;
|
|
}
|
|
|
|
return isTwentyStandardApplication(application);
|
|
};
|