Link datasource

Typescript ❤️

UI Components to support linking platform dataset feature

Install
yarn add @atlaskit/link-datasource
Source
Bundle
Changelog
Latest

3.22.0

Minor Changes

  • #120472 73c800ab5f2fc - ED-26766 update adf-schema from 47.2.1 to 47.6.0 and adf-schema-json from 1.27.0 to 1.31.0

Patch Changes


Note: This component is designed for internal Atlassian development.

External contributors will be able to use this component but will not be able to submit issues.


What is a Smart Link List View (Datasource)

A Smart Link List View allows users to query a Datasource and surface founds items to dynamically display in a user interface. For example:

  • a JQL query surfacing a list of Jira issues
  • a search query surfacing a list of Confluence pages
  • a link to a list of Github issues

This Link Datasource package exposes various UI components including:

  • a Smart Link List View which dynamically displays the items found in a Datasource, see
  • Configuration Modals which can be used to configure datasources

These UI components are backed by backend capabilities offered by Object Resolver Service (ORS) and Linking Platform.

The package also exports (via elements) a renderType function which is used to render data of supported types in corresponding formats in the Smart Link List View. Please refer to platform/packages/linking-platform/link-datasource/src/ui/issue-like-table/render-type to view the available types.

Using the Smart Link List View package

If you want your app to be able to render a datasource as a list of items

You will need to do this 2 things in your app:

  1. checking if an url is a valid datasource url via ORS endpoint /resolve or /resolve/batch.
  2. if it is, you can render the surfaced items in a table view using the DatasourceTableView component.

If you have an url that can be recognized as a datasource, and you want to expose it through the Smart Link List View

The capacity of unfurling an url to a Smart Link List View is called auto-resolve. Auto-resolve is done in the ORS. Please refer to ORS documentation for more information on how to add auto-resolve for your datasource.

Optionally, if you are looking to provide your customer a way to edit the datasource they created, you can do so by creating your own configuration modal. Please refer to the Writing a Datasource Modal guide.

If you have any questions, you can reach out to #help-bandicoots for help.

Installation

yarn add @atlaskit/link-datasource

Using the Smart Link List View Component

import { DatasourceTableView } from '@atlaskit/link-datasource'; ... return ( <DatasourceTableView {...props} /> )

Props

datasourceId string required

Unique identifier for which type of datasource is being rendered and for making its requests

parameters object required

Parameters for making the data requests necessary to render data within the table

Object

url string

Url for an existing datasource, initially used for displaying to a user unauthorized to query that site

Smart Link List View Component Example

Smart Link List View

task
Scott Farquhar
labelanotherthird
To do
23 July 2020
normal info panelcustom - missing defaults
major
Major
story
Audio in meeting room K909 doesn't work
Unassigned
In Progress
23 July 2020
Header content 1Header content 2Header content 3Body content 1Body content 2Body content 3Header content 1Header content 2Header content 3Body content 1Body content 3
high
High
bug
Unassigned
Done
23 July 2020
normal info panelcustom - missing defaults
medium
Medium
task
This level is hard
Unassigned
Scott Farquhar
Closed
23 July 2020
Header content 1Header content 2Header content 3Body content 1Body content 2Body content 3Header content 1Header content 2Header content 3Body content 1Body content 3
low
Low
story
Scott Farquhar
Unassigned
To do
23 July 2020
normal info panelcustom - missing defaults
trivial
Trivial
epic
This level is hard
Unassigned
To do
23 July 2020
Header content 1Header content 2Header content 3Body content 1Body content 2Body content 3Header content 1Header content 2Header content 3Body content 1Body content 3
blocker
Blocker
task
Unassigned
To do
23 July 2020
normal info panelcustom - missing defaults
high
epic
This level is hard
Scott Farquhar
Unassigned
To do
23 July 2020
Header content 1Header content 2Header content 3Body content 1Body content 2Body content 3Header content 1Header content 2Header content 3Body content 1Body content 3
high
story
Unassigned
To do
23 July 2020
normal info panelcustom - missing defaults
high
task
This level is hard
Unassigned
To do
23 July 2020
Header content 1Header content 2Header content 3Body content 1Body content 2Body content 3Header content 1Header content 2Header content 3Body content 1Body content 3
high
task
Scott Farquhar
Closed
23 July 2020
normal info panelcustom - missing defaults
high
task
This level contains five Dragon coins
Scott Farquhar
To do
23 July 2020
Header content 1Header content 2Header content 3Body content 1Body content 2Body content 3Header content 1Header content 2Header content 3Body content 1Body content 3
major
story
Unassigned
In Progress
23 July 2020
normal info panelcustom - missing defaults
high
task
This level is hard
Unassigned
Closed
23 July 2020
Header content 1Header content 2Header content 3Body content 1Body content 2Body content 3Header content 1Header content 2Header content 3Body content 1Body content 3
low
story
Scott Farquhar
To do
23 July 2020
normal info panelcustom - missing defaults
trivial
task
This level is hard
Unassigned
To do
23 July 2020
Header content 1Header content 2Header content 3Body content 1Body content 2Body content 3Header content 1Header content 2Header content 3Body content 1Body content 3
blocker
task
Unassigned
To do
23 July 2020
normal info panelcustom - missing defaults
high
task
This level is hard
Scott Farquhar
To do
23 July 2020
Header content 1Header content 2Header content 3Body content 1Body content 2Body content 3Header content 1Header content 2Header content 3Body content 1Body content 3
high
story
Unassigned
To do
23 July 2020
normal info panelcustom - missing defaults
high
epic
This level is hard
Unassigned
Scott Farquhar
To do
23 July 2020
Header content 1Header content 2Header content 3Body content 1Body content 2Body content 3Header content 1Header content 2Header content 3Body content 1Body content 3
high
task
This level is hard
Scott Farquhar
Closed
23 July 2020
normal info panelcustom - missing defaults
high
Synced just now

import { ConfluenceSearchModal } from '@atlaskit/link-datasource'; ... return ( <ConfluenceSearchModal {...props} /> )

Common Configuration Modal Props

Each Configuration Modal component type has additional unique props that will be explained further in their respective subpages. However, below are the common props that are shared between them.


export type DisplayViewModes = 'table' | 'inline'; export type ConfigModalProps<ADF, Parameters> = { /** Unique identifier for which type of datasource is being rendered and for making its requests */ datasourceId: string; /** The url that was used to insert a List of Links */ url?: string; /** Parameters for making the data requests necessary to render data within the table */ parameters?: Parameters; /** Callback function to be invoked when the modal is closed either via cancel button click, esc keydown, or modal blanket click */ onCancel: () => void; /** Callback function to be invoked when the insert button is clicked */ onInsert: (adf: ADF, analyticsEvent?: UIAnalyticsEvent) => void; /** * The view mode that the modal will show on open: * - Table = Displays a list of links in table format * - Inline = Presents a smart link that shows the count of query results. However, if there's only one result, it converts to an inline smart link of that issue. */ viewMode?: DisplayViewModes; } & Partial< Pick< IssueLikeDataTableViewProps, 'visibleColumnKeys' | 'wrappedColumnKeys' | 'columnCustomSizes' > >;

Configuration Modal Component Example

Configuration Modal Component