Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototypes #1551

Open
TW80000 opened this issue Sep 11, 2018 · 1 comment
Open

Prototypes #1551

TW80000 opened this issue Sep 11, 2018 · 1 comment
Assignees

Comments

@TW80000
Copy link

TW80000 commented Sep 11, 2018

Definition

A prototype is just an instance of a model with some properties set to default values.

Purpose

The purpose of prototypes is to make it easier to create new instances of models, particularly through the DAO Controller GUI. Instead of the DAO Controller simply having a "Create" button, check if there are any prototypes for the "of" of the DAO (the model being stored in it) and add a dropdown to the create button that lets you create an instance with some of the properties set to default values.

For example: We could make a prototype of the foam.nanos.auth.User model where the group property is set to a default value of "business". This is a very simple prototype where only one property has a default value, but multiple properties could be set to default values.

Prototypes could also include custom views.

Implementation

Prototypes should be modelled and stored in prototypeDAO, which needs to be created. The model should have the following properties:

modelId

The model that this is a prototype of.

label

The label to display in the create dropdown.

prototype

An array of properties.

[optional] detailView

A view used in place of the normal DetailView for editing an instance.

@TW80000 TW80000 self-assigned this Sep 11, 2018
@kgrgreer
Copy link
Collaborator

The prototype should also have an optional view: or detailView: property for configuring an alternative DetailView.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants