Skip to content

Commit

Permalink
Rename advanced settings (#37) (#68)
Browse files Browse the repository at this point in the history
Signed-off-by: Bishoy Boktor <boktorbb@amazon.com>
  • Loading branch information
boktorbb authored and kavilla committed Mar 19, 2021
1 parent 9e3452b commit 8f994de
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "advancedSettings",
"version": "kibana",
"version": "opensearchDashboards",
"server": true,
"ui": true,
"requiredPlugins": ["management"],
"optionalPlugins": ["home"],
"requiredBundles": ["kibanaReact", "home"]
"requiredBundles": ["opensearchDashboardsReact", "home"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import React from 'react';
import { EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@osd/i18n/react';

export const PageTitle = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/advanced_settings/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React from 'react';
import { PluginInitializerContext } from 'kibana/public';
import { PluginInitializerContext } from 'opensearch-dashboards/public';
import { AdvancedSettingsPlugin } from './plugin';
export { AdvancedSettingsSetup, AdvancedSettingsStart } from './types';
export { ComponentRegistry } from './component_registry';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@
width: 100%;
}

.kbnBody--mgtAdvancedSettingsHasBottomBar .mgtPage__body {
.osdBody--mgtAdvancedSettingsHasBottomBar .mgtPage__body {
padding-bottom: $euiSizeXL * 2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ function mockConfig() {
value: ['default_value'],
name: 'Test array setting',
description: 'Description for Test array setting',
category: ['elasticsearch'],
category: ['opensearch'],
},
'test:boolean:setting': {
...defaultConfig,
value: true,
name: 'Test boolean setting',
description: 'Description for Test boolean setting',
category: ['elasticsearch'],
category: ['opensearch'],
},
'test:image:setting': {
...defaultConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
*/

import React, { Component } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@osd/i18n/react';
import { EuiScreenReaderOnly, EuiDelayRender } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';
import { FieldSetting } from '../../types';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import React from 'react';

import { EuiCallOut } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@osd/i18n/react';

export const CallOuts = () => {
return (
Expand All @@ -39,11 +39,11 @@ export const CallOuts = () => {
<FormattedMessage
id="advancedSettings.callOutCautionDescription"
defaultMessage="Be careful in here, these settings are for very advanced users only.
Tweaks you make here can break large portions of Kibana.
Tweaks you make here can break large portions of OpenSearch Dashboards.
Some of these settings may be undocumented, unsupported or experimental.
If a field has a default value, blanking the field will reset it to its default which may be
unacceptable given other configuration directives.
Deleting a custom setting will permanently remove it from Kibana's config."
Deleting a custom setting will permanently remove it from OpenSearch Dashboards's config."
/>
</p>
</EuiCallOut>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React from 'react';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@osd/i18n/react';
import { shallowWithI18nProvider, mountWithI18nProvider } from 'test_utils/enzyme_helpers';
import { mount, ReactWrapper } from 'enzyme';
import { FieldSetting } from '../../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ import {
EuiSwitchEvent,
EuiToolTip,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
import { FieldSetting, FieldState } from '../../types';
import { isDefaultValue } from '../../lib';
import {
Expand Down Expand Up @@ -428,7 +428,7 @@ export class Field extends PureComponent<FieldProps> {
<EuiText size="xs">
<FormattedMessage
id="advancedSettings.field.helpText"
defaultMessage="This setting is overridden by the Kibana server and can not be changed."
defaultMessage="This setting is overridden by the OpenSearch Dashboards server and can not be changed."
/>
</EuiText>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ import {
EuiToolTip,
EuiButtonEmpty,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@osd/i18n/react';
import { isEmpty } from 'lodash';
import { i18n } from '@kbn/i18n';
import { toMountPoint } from '../../../../../kibana_react/public';
import { i18n } from '@osd/i18n';
import { toMountPoint } from '../../../../../opensearch_dashboards_react/public';
import { DocLinksStart, ToastsStart } from '../../../../../../core/public';

import { getCategoryName } from '../../lib';
Expand Down Expand Up @@ -391,9 +391,9 @@ export class Form extends PureComponent<FormProps> {
const hasUnsavedChanges = !isEmpty(unsavedChanges);

if (hasUnsavedChanges) {
document.body.classList.add('kbnBody--mgtAdvancedSettingsHasBottomBar');
document.body.classList.add('osdBody--mgtAdvancedSettingsHasBottomBar');
} else {
document.body.classList.remove('kbnBody--mgtAdvancedSettingsHasBottomBar');
document.body.classList.remove('osdBody--mgtAdvancedSettingsHasBottomBar');
}

categories.forEach((category) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React, { Fragment, PureComponent } from 'react';
import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';
import { EuiSearchBar, EuiFormErrorText, Query } from '@elastic/eui';

import { getCategoryName } from '../../lib';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import expect from '@kbn/expect';
import expect from '@osd/expect';
import { getAriaName } from './get_aria_name';

describe('Settings', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
* under the License.
*/

import expect from '@kbn/expect';
import expect from '@osd/expect';
import { getCategoryName } from './get_category_name';

describe('Settings', function () {
describe('Advanced', function () {
describe('getCategoryName(category)', function () {
it('should capitalize unknown category', function () {
expect(getCategoryName('elasticsearch')).to.be('Elasticsearch');
expect(getCategoryName('opensearch')).to.be('OpenSearch');
});

it('should return empty string for no category', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';

const upperFirst = (str = '') => str.replace(/^./, (strng) => strng.toUpperCase());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import expect from '@kbn/expect';
import expect from '@osd/expect';
import { getValType } from './get_val_type';

describe('Settings', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import expect from '@kbn/expect';
import expect from '@osd/expect';
import { isDefaultValue } from './is_default_value';
import { UiSettingsType } from '../../../../../core/public';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { PublicUiSettingsParams, StringValidationRegex } from 'src/core/public';
import expect from '@kbn/expect';
import expect from '@osd/expect';
import { toEditableConfig } from './to_editable_config';

const defDefault = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Switch, Route } from 'react-router-dom';

import { i18n } from '@kbn/i18n';
import { I18nProvider } from '@kbn/i18n/react';
import { i18n } from '@osd/i18n';
import { I18nProvider } from '@osd/i18n/react';
import { StartServicesAccessor } from 'src/core/public';

import { AdvancedSettings } from './advanced_settings';
Expand Down
12 changes: 6 additions & 6 deletions src/plugins/advanced_settings/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
import { i18n } from '@kbn/i18n';
import { CoreSetup, Plugin } from 'kibana/public';
import { i18n } from '@osd/i18n';
import { CoreSetup, Plugin } from 'opensearch-dashboards/public';
import { FeatureCatalogueCategory } from '../../home/public';
import { ComponentRegistry } from './component_registry';
import { AdvancedSettingsSetup, AdvancedSettingsStart, AdvancedSettingsPluginSetup } from './types';
Expand All @@ -31,9 +31,9 @@ const title = i18n.translate('advancedSettings.advancedSettingsLabel', {
export class AdvancedSettingsPlugin
implements Plugin<AdvancedSettingsSetup, AdvancedSettingsStart, AdvancedSettingsPluginSetup> {
public setup(core: CoreSetup, { management, home }: AdvancedSettingsPluginSetup) {
const kibanaSection = management.sections.section.kibana;
const opensearchDashboardsSection = management.sections.section.opensearchDashboards;

kibanaSection.registerApp({
opensearchDashboardsSection.registerApp({
id: 'settings',
title,
order: 3,
Expand All @@ -51,10 +51,10 @@ export class AdvancedSettingsPlugin
title,
description: i18n.translate('advancedSettings.featureCatalogueTitle', {
defaultMessage:
'Customize your Kibana experience — change the date format, turn on dark mode, and more.',
'Customize your OpenSearch Dashboards experience — change the date format, turn on dark mode, and more.',
}),
icon: 'gear',
path: '/app/management/kibana/settings',
path: '/app/management/opensearch-dashboards/settings',
showOnHomePage: false,
category: FeatureCatalogueCategory.ADMIN,
});
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/advanced_settings/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { PluginInitializerContext } from 'kibana/server';
import { PluginInitializerContext } from 'opensearch-dashboards/server';
import { AdvancedSettingsServerPlugin } from './plugin';

export const plugin = (initContext: PluginInitializerContext) =>
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/advanced_settings/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from 'kibana/server';
import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from 'opensearch-dashboards/server';
import { capabilitiesProvider } from './capabilities_provider';

export class AdvancedSettingsServerPlugin implements Plugin<object, object> {
Expand All @@ -40,5 +40,5 @@ export class AdvancedSettingsServerPlugin implements Plugin<object, object> {
return {};
}

public stop() {}
public stop() { }
}

0 comments on commit 8f994de

Please sign in to comment.