How to use the @nakedobjects/restful-objects.InvokableActionMember function in @nakedobjects/restful-objects

To help you get started, we’ve selected a few @nakedobjects/restful-objects examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / cicero / src / cicero-commands / command-result.ts View on Github external
export function getFields(field: Ro.IField): Ro.IField[] {

    if (field instanceof Ro.Parameter) {
        const action = field.parent;
        if (action instanceof Ro.InvokableActionMember || action instanceof Ro.ActionRepresentation) {
            const parms = action.parameters();
            return map(parms, p => p as Ro.IField);
        }
    }

    if (field instanceof Ro.PropertyMember) {
        // todo
        return [];
    }

    return [];
}
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / view-models / src / action-view-model.ts View on Github external
constructor(
        private readonly viewModelFactory: ViewModelFactoryService,
        private readonly context: ContextService,
        private readonly urlManager: UrlManagerService,
        private readonly error: ErrorService,
        private readonly clickHandler: ClickHandlerService,
        public readonly actionRep: Ro.ActionMember | Ro.ActionRepresentation,
        private readonly vm: IMessageViewModel,
        private readonly routeData: PaneRouteData
    ) {

        if (actionRep instanceof Ro.ActionRepresentation || actionRep instanceof Ro.InvokableActionMember) {
            this.invokableActionRep = actionRep;
        }

        this.paneId = routeData.paneId;
        this.title = actionRep.extensions().friendlyName();
        this.presentationHint = actionRep.extensions().presentationHint();
        this.menuPath = actionRep.extensions().menuPath() || '';
        this.description = this.disabled() ? actionRep.disabledReason() : actionRep.extensions().description();
    }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / services / src / context.service.ts View on Github external
getInvokableAction = (action: Ro.ActionMember | Ro.ActionRepresentation): Promise => {

        if (action instanceof Ro.InvokableActionMember || action instanceof Ro.ActionRepresentation) {
            return Promise.resolve(action);
        }

        return this.getActionDetails(action);
    }