API Docs for: 0.25.0
Show:

RegistrationActionsMixin Class

Extends Ember.Mixin
Module: mixins
Parent Module: ember-osf

Controller mixin that implements common actions performed on registrations (and registration drafts).

Methods

_generateRegistrationPayload

(
  • draft
  • registrationChoice
  • liftEmbargo
)
Object private

Build the request payload used when creating a registration from a draft.

Parameters:

  • draft String

    ID of the draft registration

  • registrationChoice String

    Either "immediate" or "embargo".

  • liftEmbargo Date

    if registrationChoice === "embargo", liftEmbargo should be the date to lift the embargo.

Returns:

Object:

Returns the attributes portion of the payload for creating a registration.

_updateMetadata

(
  • currentMetadata
  • newMetadata
)
Object

Update the current registration metadata with new responses. Takes the currentMetadata and recursively merges in the newMetadata.

Parameters:

  • currentMetadata Object

    The registration metadata at last save.

  • newMetadata Object

    New registration metadata.

Returns:

Object:

Returns merge of currentMetadata and newMetadata

apply

(
  • obj
)
private

Parameters:

Returns:

applied object

createDraft

(
  • schemaId
)
Promise

Create a draft registration of the node.

Parameters:

  • schemaId String

    ID of the chosen registration schema

Returns:

Promise:

Returns a promise that resolves to the updated node - with the newly created draft registration.

deleteDraft

(
  • draft
)
Promise

Delete a draft registration of the node.

Parameters:

  • draft Object

    Draft to be deleted

Returns:

Promise:

Returns a promise that resolves after the deletion of the draft.

detect

(
  • obj
)
Boolean private

Parameters:

Returns:

editDraft

(
  • updatedMetadata
)
Promise

Edit a draft registration of the node

Parameters:

  • updatedMetadata Object

    Responses to questions in the registration schema, nested in the format the registration schema expects to questions in the registration schema

Returns:

Promise:

Returns a promise that resolves to the updated draft

registerDraft

(
  • updatedMetadata
  • registrationChoice
  • liftEmbargo
)
Promise

Register a draft (creates a registration from a draft)

Parameters:

  • updatedMetadata Object

    esponses to questions in the registration schema, nested in the format the registration schema expects

  • registrationChoice String

    Either "immediate" or "embargo".

  • liftEmbargo Date

    if registrationChoice === "embargo", liftEmbargo should be the date to lift the embargo.

Returns:

Promise:

Returns a promise that resolves to the updated node with the newly created registration relationship

reopen

(
  • arguments
)
private

Parameters:

Properties

draft

DS.Model

The draft to perform these actions on. If not specified, defaults to the model hook.

node

DS.Model

TODO: Document this parameter