flamingo-admin

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

BoundRequests

BoundRequests: object

Type declaration

EnhanceRequest

EnhanceRequest: function

Type declaration

FetchResponse

FetchResponse: FetchResponseOk<T> | FetchResponseError<T>

Response from fetchRequest call. May have different statuses.

FormValueGetter

FormValueGetter: function

Type declaration

    • (name: string): any
    • Parameters

      • name: string

      Returns any

LinkRequest

LinkRequest: "loadAll" | "find" | "update" | "create" | "save" | "delete" | "loadAllRelated" | "addToRelation" | "removeFromRelation" | "createRelated" | "deleteRelated" | "saveRelated"

LinkRequests

LinkRequests: object

Type declaration

  • [key: string]: "loadAll" | "find" | "update" | "create" | "save" | "delete" | "loadAllRelated" | "addToRelation" | "removeFromRelation" | "createRelated" | "deleteRelated" | "saveRelated"

Listener

Listener: function

Type declaration

    • Parameters

      Returns void

ModelClass

ModelClass: object & Model

PromiseFetchResponse

PromiseFetchResponse: Promise<FetchResponse<T>>

Props

Props: OwnProps & RequestProps & FormModuleProps

admin

Optional children

children: function | React.ReactNode

column

column: ColumnConfig

Definizione originale di colonna Definizione originale di colonna

component

component: ComponentClass<any>

Optional exact

exact: undefined | true | false

history

history: any

Optional icon

icon: undefined | string

Optional icon Optional icon

key

key: string

SubMenu key

Optional link

link: undefined | string

Item key and link direction.

Optional location

location: H.Location

logged

logged: boolean

model

model: ModelClass

Modello Modello

Optional name

name: undefined | string

Item name. Optional if link is provided

onFilter

onFilter: function

Callback alla ricerca Callback alla ricerca

Type declaration

    • (filter: any): void
    • Parameters

      • filter: any

      Returns void

Optional path

path: undefined | string

Optional priority

priority: undefined | number

Navigation priority.

Optional redirect

redirect: undefined | string

Allows to redirect this navigation item, when shown i.e. in a Breadcrumb, to another path. Provide the path of another route.

Optional render

render: undefined | function

Optional strict

strict: undefined | true | false

Optional title

title: string

Navigation manager title Title Title

ReduxThunk

ReduxThunk: function

Type declaration

    • (dispatch: any, getState: any): Promise<T>
    • Parameters

      • dispatch: any
      • getState: any

      Returns Promise<T>

RelationIntent

RelationIntent: "delete" | "create" | "link" | "unlink"

RequestExecutor

RequestExecutor: function

Type declaration

RequestProps

RequestProps: BoundRequests<object>

RequestQuery

SideLayoutProps

Unsubscriber

Unsubscriber: function

Type declaration

    • (): void
    • Returns void

Variables

App

App: any = withRouter(connect((state, ownProps) => ({logged: state.auth.logged,profile: state.auth.profile,}),{loadProfile: authActions.me,})(AppBase))

Come regola generale, se stiamo utilizzando connect e il componente wrappato (in questo caso AppBase) contiene degli elementi Route, questi ultimi non funzioneranno.

Questo è dovuto a redux che per ottimizzazione sovrascrive il metodo shouldComponentUpdate, rendendolo tuttavia inutilizzabile con il Router.

Per risolvere, come da documentazione, applichiamo il wrap di withRouter che ripristina il comportamento di shouldComponentUpdate relativo al routing.

AuthRoute

AuthRoute: ComponentClass<OwnProps> = withAdminContext(withRouter(connect((state, ownProps) => ({ logged: state.auth.logged }))(AuthRouteBase))) as React.ComponentClass<OwnProps>
borrows

AuthRouteBase as AuthRoute

EditController

EditController: ComponentClass<OwnProps> = withRouter(bindRequests({find: 'find',save: 'save',})(EditControllerForm)) as React.ComponentClass<OwnProps>

EditControllerForm

EditControllerForm: ComponentClass<OwnProps & RouteComponentProps<any> & object> = Form.createModule({})(EditControllerBase)

Footer

Footer: ComponentClass<BasicProps>

FormField

FormField: ComponentClass<FieldOwnProps> = withFormModule(FormFieldBase)
class

FormField

extends

FormFieldBase

FormItem

FormItem: FormItem = Form.Item

FormModule

FormModule: ComponentClass<FormProps> = withContext({formModule: PropTypes.object,},(props: FormProps) => ({formModule: {initialRecord: props.initialRecord,model: props.model,onModelRelationMount:props.onModelRelationMount || emptyModelRelationMountFn,hiddenFields: props.hiddenFields || [],} as FormModuleConfiguration,}))(FormModuleBase) as React.ComponentClass<FormProps>

Componente che aumenta le funzionalità di Ant.Form, aggiungendo la gestione del record iniziale (a livello di Modulo e non di singolo Field).

todo

Aggiungere layout, ecc. per la gestione centralizzata.

todo

Aggiungere la gestione della validazione a livello di Record.

Header

Header: ComponentClass<BasicProps> = connect(state => ({ profile: state.auth.profile }), {logout: authActions.logout,})(HeaderBase)

ListController

ListController: ComponentClass<OwnProps> = withRouter(bindRequests({loadAll: 'loadAll',delete: 'delete',})(ListControllerBase)) as React.ComponentClass<OwnProps>

Componente che si occupa di mostrare un elenco di Risorse ottenute dalle API, e di fornire gli strumenti di gestione per la modifica, l'eliminazione e principalmente la navigazione.

Login

Login: ComponentClass<LoginOwnProps> = withRouter(connect((state, ownProps) => ({}), {login: authActions.login,loadProfile: authActions.me,})(LoginModule)) as React.ComponentClass<LoginOwnProps>

LoginModule

LoginModule: ComponentClass<LoginProps> = createModule()(LoginBase)

PageHeader

PageHeader: ComponentClass<OwnProps & RouteComponentProps<any>> | StatelessComponent<OwnProps & RouteComponentProps<any>> = withAdminContext(withRouter(PageHeaderBase))
see

PageHeaderBase

RelationIntentCreate

RelationIntentCreate: ComponentClass<object> = bindRequests({createRelated: 'createRelated',})(createFormModule({})(RelationIntentCreateBase))

RelationIntentDelete

RelationIntentDelete: ComponentClass<OwnProps> = bindRequests({delete: 'delete',})(RelationIntentDeleteBase)

RelationIntentLink

RelationIntentLink: ComponentClass<OwnProps> = bindRequests({loadAll: 'loadAll',addToRelation: 'addToRelation',})(RelationIntentLinkBase) as React.ComponentClass<OwnProps>

RelationIntentUnlink

RelationIntentUnlink: ComponentClass<OwnProps> = bindRequests({removeFromRelation: 'removeFromRelation',})(RelationIntentUnlinkBase) as React.ComponentClass<OwnProps>

RelationManyWidget

RelationManyWidget: ComponentClass<OwnProps> = withFormModule(bindRequests({loadAllRelated: 'loadAllRelated',addToRelation: 'addToRelation',removeFromRelation: 'removeFromRelation',createRelated: 'createRelated',delete: 'delete',})(RelationManyWidgetBase)) as React.ComponentClass<OwnProps>

Widget allowing user to manage a many-to-many or one-to-many relationship inside a Form.

RelationOneWidget

RelationOneWidget: ComponentClass<OwnProps> = withFormModule(bindRequests({loadAll: 'loadAll',})(RelationOneWidgetBase))

Route

Route: ComponentClass<RouteOwnProps & RouteProps & RouteComponentProps<any>> | StatelessComponent<RouteOwnProps & RouteProps & RouteComponentProps<any>> = withAdminContext(withRouter(RouteBase))

Admin Route definition. It is used to include Navigation info.

SIDE_LAYOUT_WIDTH

SIDE_LAYOUT_WIDTH: 230 = 230

SideLayout

SideLayout: ComponentClass<SideLayoutOwnProps> | StatelessComponent<SideLayoutOwnProps> = withAdminContext(SideLayoutBase)

Sider

Sider: ComponentClass<SiderProps>

SubMenu

SubMenu: any

USE_LOCAL_STORAGE

USE_LOCAL_STORAGE: true = !!sessionStorage

dataFormatter

dataFormatter: Jsona = new Jsona()

defaultClient

defaultClient: StandardClient = new StandardClient({ baseUrl: '/api' })

Utilizziamo il client di default in caso non sia specificato dall'utente.

process

process: any

rootReducer

rootReducer: any = combineReducers({auth,}) as any

store

store: any = createStore(rootReducer, applyMiddleware(thunk)) as any

tokenFromStorage

tokenFromStorage: null | string = USE_LOCAL_STORAGE? sessionStorage.getItem('accessToken') || localStorage.getItem('accessToken'): null

withAdminContext

withAdminContext: AdminContextEnhancer = getContext({admin: PropTypes.object,}) as AdminContextEnhancer

HOC che permette di collegarsi alla configurazione fornita da AdminRoot.

withFormModule

withFormModule: FormModuleEnhancer = getContext({/** Da Ant */form: PropTypes.object,/** Da Flamingo */formModule: PropTypes.object,}) as FormModuleEnhancer

HOC che permette di collegarsi alla configurazione fornita dal modulo Form.Module. Inoltre, restituisce anche l'elemento form del Context impostato da Ant.Form

Functions

authReducer

  • authReducer(state?: AuthState, action: any): object

bindRelation

  • Bind a relation to models (using the ModelsRepository). We are using a side-effect on the real Classes, but it simplifies the code needed inside Components in order to access Source and Target Models.

    todo

    Study an alternative system that does not require side-effects.

    Parameters

    • repository: ModelsRepository

      The models repository used to resolve relationship target

    • model: Model

      Relation source

    • key: string

      Relation name (i.e. roles)

    • relation: Relation

      Actual relation instance that needs to be populated

    Returns void

bindRelations

bindRequests

  • bindRequests<R>(requests: R): targetBindRequests
  • Higher-order component that bind Client requests to Redux, using the client specified in <Root> and saved in the context.

    All requests are described by the following signature:

    { loadRecords: 'loadAll' }

    • The key (loadRecords) is the prop to be assigned in the Component
    • The value ('loadAll') is the method name inside Client interface

    The extra-typing given by BoundRequests interface strict-checks Requests signature in BaseComponent props are the same as specified by the client.

    All requests are wrapped inside dispatch and wrapClientRequest, in order to enhance client knowledge using Redux state.

    Type parameters

    Parameters

    • requests: R

      Descriptor of requests to be bound

    Returns targetBindRequests

createApiParameters

createFormModule

  • createFormModule<P>(options?: FormCreateOption<ModelRecord>): (Anonymous function)

createNavigationItemFromProps

emptyModelRelationMountFn

  • emptyModelRelationMountFn(relation: Relation): void

fetchRequest

  • Si occupa di effettuare le chiamate alle API di Laravel, gestendo l'autorizzazione mediante Bearer-token in modo automatico (in base all'utente registrato nello Store), oltre ad alcune utility di gestione degli errori e di notifica, in modo da ridurre il boilerplate.

    Type parameters

    • T

    Parameters

    Returns Promise<FetchResponse<T>>

getFilterComponent

insertColumnFilters

  • Augment columns with ad-hoc filtering components using the filter column config property.

    Parameters

    • model: ModelClass

      Current table Model

    • selectedFilters: any

      Actually active filters

    • onFilter: function

      Callback to invoke when a filter has been changed

        • (filter: any): Promise<any>
        • Parameters

          • filter: any

          Returns Promise<any>

    • columns: ColumnConfig[]

      Available columns that need to be check for filter processing

    Returns ColumnConfig[]

parseResponseJSON

  • parseResponseJSON(response: Response): Promise<any>

wrapClientRequest

  • wrapClientRequest(client: Client, method: "loadAll" | "find" | "update" | "create" | "save" | "delete" | "loadAllRelated" | "addToRelation" | "removeFromRelation" | "createRelated" | "deleteRelated" | "saveRelated"): (Anonymous function)
  • Allows to wrap a Client request inside a Redux dispatch cycle, using redux-thunk.

    This function is used by the framework internally in order to do not expose redux logic to the Client (and eventually in userland in a custom Client implementation)

    todo

    Enhanche error handling.

    Parameters

    • client: Client

      The client implementation

    • method: "loadAll" | "find" | "update" | "create" | "save" | "delete" | "loadAllRelated" | "addToRelation" | "removeFromRelation" | "createRelated" | "deleteRelated" | "saveRelated"

      Selected client method to be performed with redux

    Returns (Anonymous function)

Object literals

actions

actions: object

logged

  • logged(token: string, remember: boolean): object

logout

  • logout(): object

profileFetched

  • profileFetched(profile: any): object

authActions

authActions: object

Azioni disponibili per la gestione dell'autorizzazione e del login dell'utente corrente.

login

  • login(email: string, password: string, remember: boolean): (Anonymous function)
  • Effettua il login inviando le credenziali al server, e salva il risultato nello Store mediante le azioni dedicate.

    Parameters

    • email: string
    • password: string
    • remember: boolean

    Returns (Anonymous function)

me

  • me(): (Anonymous function)

initialState

initialState: object

logged

logged: boolean = tokenFromStorage != null

profile

profile: null = null

token

token: null | string = tokenFromStorage

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc