Socket
Socket
Sign inDemoInstall

@deviniti/jql-autocomplete

Package Overview
Dependencies
0
Maintainers
19
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @deviniti/jql-autocomplete

Javascript module for autocompleting JQL queries in JIRA.


Version published
Weekly downloads
2.1K
decreased by-12.55%
Maintainers
19
Install size
23.8 kB
Created
Weekly downloads
 

Readme

Source

README

This repository contains a javascript module for autocompleting JQL queries in JIRA.

How do I get set up?

Download the jql-autocomplete.js file and include it in your page.

To enable autocompletion on a selected input field create an autocompletion controller:

#!javascript

var JQLAutocomplete = new JQLAutocomplete(data);

and pass the parsed JSON response of this JIRA REST resource using the following method:

#!javascript

JQLAutocomplete.passAutocompleteData(autocompleteData);

constructorData

The constructorData object is formed as follows:

#!javascript

var constructorData = {
    input: element,
    render: function(),
    getSuggestions: function(),
    maxSuggestions: number
};

input

The input property is a reference to the input field you wish to enable autocompletion on.

render

To initialize the module, you have to provide a render method.

#!javascript

function render(suggestions) {...}

This method will be called each time the user interacts with the input field. It will receive exactly one parameter - an array containing autocomplete suggestions. The array is formed as follows:

#!javascript

var suggestions = [
    {
        text: 'string',
        onClick: function()
    },
    ...
];

The text property contains the display text for a suggestion. The onClick property is a method that should be called when the suggestion is clicked.

It's up to you how to display the suggestions.

getSuggestions

When called, this method should return this JIRA REST resource. The response should be a parsed JSON.

#!javascript

function getSuggestions (fieldName, callback) {...}

It receives exactly two parameters - the name of the field to get the suggestions for and a callback function. The callback function should be called as soon as the REST response arrives and should be given the parsed reponse as the only parameter.

This property is optional - if omitted, the plugin will not autocomplete values for fields.

maxSuggestions

The maximal number of suggestions you wish the module to generate.

This property is optional - if omitted, the plugin will generate every reasonable suggestion.

FAQs

Last updated on 26 Jul 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc