Git Product home page Git Product logo

Comments (5)

xAlien95 avatar xAlien95 commented on May 18, 2024 1

... hopefully getting the names and codes isn’t a pain ...

It shouldn't be if you know where to look.

from shortcuts-js.

joshfarrant avatar joshfarrant commented on May 18, 2024

Hey @gcordalis, sounds like a great idea!

My only suggestion would be have an options object, rather than an shortcutIcon object, as in the future we might want to add additional configurable options (import questions, input types, etc).

Maybe then, your example could be as follows:

exports.buildShortcutTemplate = (actions = [], options) => ({
  WFWorkflowClientVersion: '724',
  WFWorkflowClientRelease: '2.1',
  WFWorkflowIcon: {
      WFWorkflowIconStartColor: options.icon.color,
      WFWorkflowIconGlyphNumber: options.icon.glyph,
  },
  // ...
};

The other thing to consider is how the user will actually select their icon/colour. We'll likely need to store the values of the different available colours / glyphs, to make it easy for the user to select.

Maybe we could have something like:

import {
  buildShortcut,
  ICON,
} from '@joshfarrant/shortcuts-js';

buildShortcut([], {
  icon: {
    color: ICON.COLORS.ORANGE,
    glyph: ICON.GLYPHS.ROCKET,
  },
});

Or, we could pull in the icon info from elsewhere:

import {
  buildShortcut,
} from '@joshfarrant/shortcuts-js';

import {
  ICON,
} from '@joshfarrant/shortcuts-js/meta';

buildShortcut([], {
  icon: {
    color: ICON.COLORS.ORANGE,
    glyph: ICON.GLYPHS.ROCKET,
  },
});

The later method gives us more flexibility down the road when it comes to things like WFWorkflowInputContentItemClasses and WFWorkflowTypes (see here).

Input on this would be great, but feel free to crack on with it in the meantime! And if you'd like any help with the TS side of things just let me know 😃.

from shortcuts-js.

gcordalis avatar gcordalis commented on May 18, 2024

Options sounds great and definitely adds flexibility down the road.

I’ve got all the colours stored, working on glyphs today (hopefully getting the names and codes isn’t a pain) then I’ll have a crack at the TS side again.

from shortcuts-js.

joshfarrant avatar joshfarrant commented on May 18, 2024

It shouldn't be if you know where to look.

Fantastic! 🎉

from shortcuts-js.

joshfarrant avatar joshfarrant commented on May 18, 2024

Closing this as the main feature discussed here has been implemented. Further discussion can either be done in its own issue, or in #45 if relevant. 🙂

from shortcuts-js.

Related Issues (20)

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.