Giter Club home page Giter Club logo

goblin-desktop's Introduction

Goblin Desktop

"It is not for gnomes..."

Provide simple API for adding contexts, tabs, tasks, forms, status, notifications, hinters...

Creating a desktop

Usualy we create a desktop in a start quest, for a laboratory:

// Create a desktop for laboratory
const desktop = yield quest.createFor ('laboratory', labId, 'desktop', {
    labId: lab.id
});

create (labId)

labId (string)

The famouse laboratory identifier looks like: laboratory@some-long-uuid-v4

Describing the desktop

addContext (context)

Adding context:

const docContext = {contextId: 'doc', name: 'Doc'};
desktop.addContext(docContext);

context (context object)

  • contextId: a context identifier, lower-case, used for retreiving context tasks js files

  • name: the displayed name

Describe context tasks

You can write a tasks.js file in a folder named like the context id, in the widgets directory:

// exemple path for this file:
// goblin-name/widgets/codispatch/tasks.js
export default [
  {
    text: 'Search',
    glyph: 'solid/search',
    workitem: {
      name: 'mission-search',
      icon: 'solid/search',
      kind: 'tab',
      isClosable: true,
      navigate: true,
    },
  },
  {
    text: 'Mission',
    glyph: 'solid/plus',
    workitem: {
      name: 'mission-workflow',
    },
  },
];

Creating tabs

Minimal tab API:

desktop.addTab({
  name: 'New tab',
  contextId: 'some-context',
  view: 'default',
  workitemId: 'content@exemple-uuid-v4',
});

addTab (tab)

tab (tab object)

  • name: the displayed name

  • contextId: a context identifier, where the tab will be displayed

  • view: name of the view, when the tab is clicked, import a view.js from a folder, named with this value

  • workitemId: a unique identifier for wiring a workitem (an existing goblin instance widget) in the selected view

  • closable: if true, show a close button and notify close request

  • navigate: if true, navigate the current view directly the tab workitem view

Working withs form and hinters

todo

Navigating

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.