UNPKG

7.08 kBMarkdownView Raw
1# Johnson frontend
2
3This is a frontend module for Johnson framework
4
5## Getting Started
6
7After installing you can use it by importing the module itself and css:
8
9```
10import React from 'react';
11import {render} from 'react-dom';
12
13import Johnson, {JIRA as ProductName} from '@atlassian/johnson';
14import '@atlassian/johnson/build/johnson.css';
15
16...
17
18render(
19 <Johnson endpoints={endpoints} i18n={i18n} initialData={initialData} productName={ProductName} />,
20 document.getElementById('root')
21);
22```
23
24## Properties
25
26* __endpoints__ (required)
27
28 An object containing urls where the module will send requests to.
29
30 ```
31 {
32 data: 'url to get events data',
33 eventKbClickedAnalytics: 'analytics event, event kb article clicked',
34 generalKbClickedAnalytics: 'analytics event, general kb article clicked',
35 home: 'product home url',
36 dismissEvents: 'url to dismiss events',
37 kbLinkStartStop: 'kb article about starting a product',
38 kbLinkMigrateConfigManually: 'kb article about migrating custom configurations manually',
39 findTheLogs: 'kb article about finding and providing logs for support',
40 addAndRemoveSystemProps: 'kb article about adding and removing system properties',
41 migrateConfig: 'url to migrate custom configurations after an upgrade',
42 }
43 ```
44
45 [kbLinkStartStop example](https://confluence.atlassian.com/confkb/startup-check-starting-confluence-936509882.html?utm_campaign=csseng_fy18_q3_server_confluence_errorstate&utm_medium=in-product&utm_source=Install)
46
47 [findTheLogs example](https://confluence.atlassian.com/confkb/startup-check-providing-logs-for-support-936509900.html?utm_source=Install&utm_medium=in-product&utm_campaign=csseng_fy18_q3_server_confluence_errorstate)
48
49 [addAndRemoveSystemProps example](https://confluence.atlassian.com/confkb/startup-check-add-or-remove-confluence-system-properties-938861976.html?utm_source=Install&utm_medium=in-product&utm_campaign=csseng_fy18_q3_server_confluence_errorstate)
50
51
52* __i18n__ (required)
53
54 An object containing translations.
55
56 ```
57 {
58 'johnson.check.events.event.kblink': 'Learn more',
59 'johnson.legacy.columnheading.description': 'Description',
60 'johnson.legacy.columnheading.exception': 'Exception',
61 'johnson.legacy.columnheading.level': 'Level',
62 'johnson.legacy.columnheading.time': 'Time',
63 '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.',
64 'johnson.page.headline.title.error': 'Jira had problems starting up',
65 'johnson.page.headline.title.warning': 'Preparing to start Jira',
66 'johnson.page.headline.neutral': 'Jira had failed to start, but we're back up and running again',
67 '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.',
68 'johnson.page.progress': 'Finishing up checks',
69 '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.',
70 'johnson.page.subheadline.neutral': 'Take me to my {0}Jira home{1}.',
71 'system.error.progress.completed': 'This process is {0}% complete.',
72 'johnson.page.helium.show.files': 'Show {0} files',
73 'johnson.page.helium.close.button': 'Close',
74 'johnson.page.helium.button.title': 'Copy configuration',
75 '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.',
76 'johnson.page.helium.description': 'To copy these changes to your new installation, click <b>Copy configuration.</b>',
77 'johnson.page.helium.ignore.description': 'If you ignore and continue, Jira will start using the default configuration.',
78 'johnson.page.helium.note': 'Note: Make sure you only copy over the changes not the entire files.',
79 'johnson.page.helium.title': 'Some of your configuration files contain custom changes',
80 'johnson.page.helium.modal.title': 'List of modified files',
81 'johnson.page.helium.modal.description': 'The following files contain custom changes:',
82 '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.',
83 'johnson.page.helium.read.only.title': 'Upgrade: Custom changes have not been carried over',
84 'johnson.page.helium.success.title': 'Files copied successfully',
85 '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.',
86 'johnson.check.acknowledge.warnings.cta': 'Ignore all warnings and continue',
87 '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}',
88 }
89 ```
90
91
92* __productName__ (required)
93
94 Defines what logo to be shown in the left top corner.
95 Currently supported values: 'confluence', 'jira'.
96
97
98* __initialData__
99
100 Initial events data, if not provided request to endpoints.data will be sent to get it.
101
102 ```
103 {
104 canAuthoriseUsers: bool, indicating that a product loaded far enough to be able to authorise users,
105 checksComplete: bool, if true loading gif will appear at the bottom of the page,
106 events: array of events, can be new or old, see below,
107 errorsPresentButHidden: bool, should be true when hide.system.error.details flag is set
108 }
109 ```
110
111 New style event:
112 ```
113 {
114 description: 'required, event description',
115 helpLink: 'not required, a link to be attached to description, works only with new events',
116 title: 'required, event title',
117 level: 'required, event level, can be fatal, error or warning. ',
118 dismissible: 'not required, bool, indicates whether or not event is dismissible',
119 templateContext: { // not required, contains event rendering details
120 type: 'template name, apart from default can be helium or heliumSuccess,
121 filesThatCanBeCopied: 'array of config files that can be migrated automatically to a new version, used in helium template',
122 filesThatCannotBeCopied: 'array of config files that can not be migrated automatically to a new version, used in helium template',
123 numberOfFilesCopied: 'number of config files migrated to a new version, used in heliumSuccess template',
124 }
125 }
126 ```
127
128 Old style event:
129 ```
130 {
131 old: 'should be set for old events',
132 description,
133 date,
134 level,
135 dismissible,
136 exception,
137 additionalMarkup: 'additional html markup to be attached to description. Can contain translation aliases, in that case make sure its included in i18n prop',
138 progress
139 }
140 ```
141
\No newline at end of file