How to use the @nakedobjects/services.InteractionMode.Edit function in @nakedobjects/services

To help you get started, we’ve selected a few @nakedobjects/services 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 / gemini / src / object / object.component.ts View on Github external
get actionHolders() {
        if (this.mode === InteractionMode.View) {
            return this.viewButtons;
        }

        if (this.mode === InteractionMode.Edit || this.mode === InteractionMode.Transient) {
            return this.saveButtons;
        }

        if (this.mode === InteractionMode.Form) {

            // cache because otherwise we will recreate this array of actionHolders everytime page changes !
            if (!this.actionButtons) {

                const menuItems = this.menuItems()!;
                const actions = flatten(map(menuItems, (mi: MenuItemViewModel) => mi.actions!));
                this.actionButtons = map(actions, a => wrapAction(a));
            }

            return this.actionButtons;
        }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / view-models / src / domain-object-view-model.ts View on Github external
readonly getTitle = (mode: InteractionMode) => {
        const prefix = mode === InteractionMode.Edit || mode === InteractionMode.Transient ? `${Msg.editing} - ` : '';
        return `${prefix}${this.title}`;
    }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / cicero / src / cicero-commands / edit.ts View on Github external
const newState = () => {
            this.context.clearObjectCachedValues();
            this.urlManager.setInteractionMode(InteractionMode.Edit);
        };
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / view-models / src / collection-view-model.ts View on Github external
if (routeData.interactionMode === InteractionMode.Transient) {
            state = CollectionViewState.Summary;
        }

        function getDefaultTableState(exts: Ro.Extensions) {
            if (exts.renderEagerly()) {
                return exts.tableViewColumns() || exts.tableViewTitle() ? CollectionViewState.Table : CollectionViewState.List;
            }
            return CollectionViewState.Summary;
        }

        if (state == null) {
            state = getDefaultTableState(this.collectionRep.extensions());
        }

        this.editing = routeData.interactionMode === InteractionMode.Edit;

        if (resetting || state !== this.currentState) {

            const size = this.collectionRep.size();
            const itemLinks = this.collectionRep.value();

            if (size == null || size > 0) {
                this.mayHaveItems = true;
            }
            this.details = Helpers.getCollectionDetails(size);
            const getDetails = itemLinks == null || state === CollectionViewState.Table;

            const actions = this.collectionRep.actionMembers();
            this.setActions(actions, routeData);

            if (state === CollectionViewState.Summary) {
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / view-models / src / domain-object-view-model.ts View on Github external
.then((updatedObject: Ro.DomainObjectRepresentation) => {
                this.reset(updatedObject, this.currentPaneData(), true);
                this.urlManager.pushUrlState(this.onPaneId);
                this.urlManager.setInteractionMode(InteractionMode.Edit, this.onPaneId);
            })
            .catch((reject: ErrorWrapper) => this.handleWrappedError(reject));