Neurotic and Probably Misinformed

    @atlassian/johnson

    3.3.0 • Public • Published

    Johnson frontend

    This is a frontend module for Johnson framework

    Getting Started

    After installing you can use it by importing the module itself and css:

    import React from 'react';
    import {render} from 'react-dom';
    
    import Johnson, {JIRA as ProductName} from '@atlassian/johnson';
    import '@atlassian/johnson/build/johnson.css';
    
    ...
    
    render(
      <Johnson endpoints={endpoints} i18n={i18n} initialData={initialData} productName={ProductName} />,
      document.getElementById('root')
    );
    

    Properties

    • endpoints (required)

      An object containing urls where the module will send requests to.

      {
        data: 'url to get events data',
        eventKbClickedAnalytics: 'analytics event, event kb article clicked',
        generalKbClickedAnalytics: 'analytics event, general kb article clicked',
        home: 'product home url',
        dismissEvents: 'url to dismiss events',
        kbLinkStartStop: 'kb article about starting a product',
        kbLinkMigrateConfigManually: 'kb article about migrating custom configurations manually',
        findTheLogs: 'kb article about finding and providing logs for support',
        addAndRemoveSystemProps: 'kb article about adding and removing system properties',
        migrateConfig: 'url to migrate custom configurations after an upgrade',
      }
      

      kbLinkStartStop example

      findTheLogs example

      addAndRemoveSystemProps example

    • i18n (required)

      An object containing translations.

      {
        'johnson.check.events.event.kblink': 'Learn more',
          'johnson.legacy.columnheading.description': 'Description',
          'johnson.legacy.columnheading.exception': 'Exception',
          'johnson.legacy.columnheading.level': 'Level',
          'johnson.legacy.columnheading.time': 'Time',
          'johnson.page.detail.restricted.footer': 'We can\'t show you any more detail here as the <code>hide.system.error.details</code> system property has been set. If you\'d like to see more details here, remove the system property.',
          'johnson.page.headline.title.error': 'Jira had problems starting up',
          'johnson.page.headline.title.warning': 'Preparing to start Jira',
          'johnson.page.headline.neutral': 'Jira had failed to start, but we're back up and running again',
          'johnson.page.footer': 'If you\'re unable to fix the problems and need to contact support, we can respond faster if you provide {0}the logs{1} of your instance.',
          'johnson.page.progress': 'Finishing up checks',
          'johnson.page.subheadline.error': 'This page is for Jira administrators. If you're seeing this page, your Jira administrator is probably working to restore the service.',
          'johnson.page.subheadline.neutral': 'Take me to my {0}Jira home{1}.',
          'system.error.progress.completed': 'This process is {0}% complete.',
          'johnson.page.helium.show.files': 'Show {0} files',
          'johnson.page.helium.close.button': 'Close',
          'johnson.page.helium.button.title': 'Copy configuration',
          'johnson.page.helium.cant.copy.files': 'The following files contain custom changes, but we can’t copy them automatically. You’ll need to reapply these changes manually.',
          'johnson.page.helium.description': 'To copy these changes to your new installation, click <b>Copy configuration.</b>',
          'johnson.page.helium.ignore.description': 'If you ignore and continue, Jira will start using the default configuration.',
          'johnson.page.helium.note': 'Note: Make sure you only copy over the changes not the entire files.',
          'johnson.page.helium.title': 'Some of your configuration files contain custom changes',
          'johnson.page.helium.modal.title': 'List of modified files',
          'johnson.page.helium.modal.description': 'The following files contain custom changes:',
          'johnson.page.helium.read.only.description': 'The listed configuration files contain custom changes. To keep your current configuration, re-apply these custom changes to the new version of the files during upgrade.',
          'johnson.page.helium.read.only.title': 'Upgrade: Custom changes have not been carried over',
          'johnson.page.helium.read.only.files.copied': `One or more files were successfully copied to your new installation. To finalize these changes, {0}restart Jira{1} now.`,
          'johnson.page.helium.success.title': 'Files copied successfully',
          'johnson.page.helium.success.description': 'We successfully copied {0} files to your new installation. If there are no other warnings on this page, you can {1}start Jira{2} now.',
          'johnson.check.acknowledge.warnings.cta': 'Ignore all warnings and continue',
          'johnson.warnings.ignore.cli': 'If you want to ignore these warnings and start Jira, you need to use the {0}-Djira.startup.warnings.disable{1} startup flag that will ignore the warnings. {2}Learn more{3}',
      }
      
    • productName (required)

      Defines what logo to be shown in the left top corner. Currently supported values: 'confluence', 'jira'.

    • initialData

      Initial events data, if not provided request to endpoints.data will be sent to get it.

      {
        canAuthoriseUsers: bool, indicating that a product loaded far enough to be able to authorise users,
        checksComplete: bool, if true loading gif will appear at the bottom of the page,
        events: array of events, can be new or old, see below,
        errorsPresentButHidden: bool, should be true when hide.system.error.details flag is set
      }
      

      New style event:

      {
        description: 'required, event description',
        helpLink: 'not required, a link to be attached to description, works only with new events',
        title: 'required, event title',
        level: 'required, event level, can be fatal, error or warning. ',
        dismissible: 'not required, bool, indicates whether or not event is dismissible',
        templateContext: {  // not required, contains event rendering details 
          type: 'template name, apart from default can be configCustomisation or configCustomisationSuccess,
          filesThatCanBeCopied: 'array of config files that can be migrated automatically to a new version, used in configCustomisation template',
          filesThatCannotBeCopied: 'array of config files that can not be migrated automatically to a new version, used in configCustomisation template',
          numberOfFilesCopied: 'number of config files migrated to a new version, used in configCustomisationSuccess template',
        }
      }
      

      Old style event:

      {
        old: 'should be set for old events',
        description,
        date,
        level,
        dismissible,
        exception,
        additionalMarkup: 'additional html markup to be attached to description. Can contain translation aliases, in that case make sure its included in i18n prop',
        progress
      }
      

    Install

    npm i @atlassian/johnson

    DownloadsWeekly Downloads

    4

    Version

    3.3.0

    License

    Atlassian Developer Terms

    Unpacked Size

    1.95 MB

    Total Files

    22

    Last publish

    Collaborators

    • kbielaski
    • dwalker
    • atlassian-aui
    • jvdl
    • mdejongh
    • mszczepanski
    • cdarroch
    • macku
    • dboyd
    • dmorrow
    • mstaas
    • cwhittington
    • doklovic
    • 1999-atlassian
    • amcculloch
    • wyasvoin
    • jmoynihan
    • xqiu
    • gleal-atlassian
    • mszpyra
    • bcytrowski
    • plai1
    • sraj
    • tilwin_atlassian
    • mrzymski
    • media-build-bot
    • akishore
    • timse
    • mkem114
    • tsebastian
    • sfp-release-bot