Skip to content

Mounting the App

Tutorial 7 of 12 mounts Leaseline's portal App over the lease Noun, with what each persona may do and one view override.

An App is an Interface over the Nouns, so its screens derive from them. Leaseline declares a Lease Noun, and the portal gives managers and residents their own screens.

What you build

You mount apps/portal/ at /app with two Personas: managers run every Verb, residents read and answer. Then you override one screen, the lease detail.

Steps

Terminal3 steps
  1. To mount the App, write its folder file:

    apps/portal/app.mdx
    ---
    kind: saas
    mount: /app
    nouns: [Lease]
    personas:
      manager: { may: [Lease.create, Lease.renew, Lease.notify] }
      resident: { may: [Lease.get] }
    ---
  2. To open the screens it derived, visit the preview at /app/leases, then one lease, then /app/leases/lease_4loEed1JG4/renew.

  3. To change the lease screen, write a view at its path:

    apps/portal/leases/[lease]/view.mdx
    ---
    personas: [manager]
    ---
    <ThingDetail />
    <Timeline />
    <VerbSheet verb="Lease.renew" />
    <VerbSheet verb="Lease.notify" />

    In a view, ThingDetail and Timeline show the record its route names. Each VerbSheet turns one Verb into fields and a button, with its Mode, its Price and any Approval it needs.

Result

The portal serves a list and a record screen for leases and a form for each Verb, and residents see only what they may read. The view override replaced one screen and left the rest derived. Checkpoint leaseline@ch07 (status planned) adds apps/portal/.

Next steps