How to use the @nakedobjects/services.InteractionMode.View 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
focus(parms: QueryList) {
        if (this.mode == null || this.mode === InteractionMode.View) {
            return;
        }
        if (parms && parms.length > 0) {
            some(parms.toArray(), p => p.focus());
        }
    }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / cicero / src / cicero-commands / cancel.ts View on Github external
            return this.returnResult('', '', () => this.urlManager.setInteractionMode(InteractionMode.View));
        }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / view-models / src / domain-object-view-model.ts View on Github external
    private readonly cancelHandler = () => this.isFormOrTransient() ? () => this.urlManager.popUrlState(this.onPaneId) : () => this.urlManager.setInteractionMode(InteractionMode.View, this.onPaneId);
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / view-models / src / domain-object-view-model.ts View on Github external
private reset(obj: Ro.DomainObjectRepresentation, routeData: PaneRouteData, resetting: boolean) {
        this.domainObject = obj;
        this.onPaneId = routeData.paneId;
        this.routeData = routeData;
        const iMode = this.domainObject.extensions().interactionMode();
        this.isInEdit = routeData.interactionMode !== InteractionMode.View || iMode === 'form' || iMode === 'transient';
        this.props = routeData.interactionMode !== InteractionMode.View ? this.contextService.getObjectCachedValues(this.domainObject.id(), routeData.paneId) : {};

        const actions = values(this.domainObject.actionMembers()) as Ro.ActionMember[];
        this.actions = map(actions, action => this.viewModelFactory.actionViewModel(action, this, this.routeData)).filter(avm => !avm.returnsScalar());

        this.menuItems = Helpers.createMenuItems(this.actions);

        this.properties = map(this.domainObject.propertyMembers(), (property, id) => this.viewModelFactory.propertyViewModel(property, id!, this.props[id!], this.onPaneId, this.propertyMap));
        this.collections = map(this.domainObject.collectionMembers(), collection => this.viewModelFactory.collectionViewModel(collection, this.routeData, resetting));

        this.unsaved = routeData.interactionMode === InteractionMode.Transient;

        this.title = this.unsaved ? `Unsaved ${this.domainObject.extensions().friendlyName()}` : this.domainObject.title();

        this.title = this.title + Helpers.dirtyMarker(this.contextService, this.configService, obj.getOid());
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / cicero / src / cicero-commands / save.ts View on Github external
private handleError(err: Ro.ErrorMap, obj: Ro.DomainObjectRepresentation) {
        if (err.containsError()) {
            const propFriendlyName = (propId: string) => Ro.friendlyNameForProperty(obj, propId);
            this.handleErrorResponse(err, propFriendlyName);
        } else {
            this.urlManager.setInteractionMode(InteractionMode.View);
        }
    }
}
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / view-models / src / domain-object-view-model.ts View on Github external
private reset(obj: Ro.DomainObjectRepresentation, routeData: PaneRouteData, resetting: boolean) {
        this.domainObject = obj;
        this.onPaneId = routeData.paneId;
        this.routeData = routeData;
        const iMode = this.domainObject.extensions().interactionMode();
        this.isInEdit = routeData.interactionMode !== InteractionMode.View || iMode === 'form' || iMode === 'transient';
        this.props = routeData.interactionMode !== InteractionMode.View ? this.contextService.getObjectCachedValues(this.domainObject.id(), routeData.paneId) : {};

        const actions = values(this.domainObject.actionMembers()) as Ro.ActionMember[];
        this.actions = map(actions, action => this.viewModelFactory.actionViewModel(action, this, this.routeData)).filter(avm => !avm.returnsScalar());

        this.menuItems = Helpers.createMenuItems(this.actions);

        this.properties = map(this.domainObject.propertyMembers(), (property, id) => this.viewModelFactory.propertyViewModel(property, id!, this.props[id!], this.onPaneId, this.propertyMap));
        this.collections = map(this.domainObject.collectionMembers(), collection => this.viewModelFactory.collectionViewModel(collection, this.routeData, resetting));

        this.unsaved = routeData.interactionMode === InteractionMode.Transient;

        this.title = this.unsaved ? `Unsaved ${this.domainObject.extensions().friendlyName()}` : this.domainObject.title();

        this.title = this.title + Helpers.dirtyMarker(this.contextService, this.configService, obj.getOid());

        this.friendlyName = this.domainObject.extensions().friendlyName();