passing fullAccessPath instead of parentPath and name

This commit is contained in:
Mose Müller
2024-03-27 10:01:04 +01:00
parent 1a01222cb3
commit ff3a509132
12 changed files with 42 additions and 118 deletions

View File

@@ -5,8 +5,7 @@ import { DocStringComponent } from './DocStringComponent';
import { LevelName } from './NotificationsComponent';
type MethodProps = {
name: string;
parentPath: string;
fullAccessPath: string;
docString?: string;
addNotification: (message: string, levelname?: LevelName) => void;
displayName: string;
@@ -15,7 +14,7 @@ type MethodProps = {
};
export const MethodComponent = React.memo((props: MethodProps) => {
const { name, parentPath, docString, addNotification, displayName, id } = props;
const { fullAccessPath, docString, addNotification, displayName, id } = props;
// Conditional rendering based on the 'render' prop.
if (!props.render) {
@@ -24,7 +23,6 @@ export const MethodComponent = React.memo((props: MethodProps) => {
const renderCount = useRef(0);
const formRef = useRef(null);
const fullAccessPath = [parentPath, name].filter((element) => element).join('.');
const triggerNotification = () => {
const message = `Method ${fullAccessPath} was triggered.`;