Skip to content

Commit

Permalink
feat: update test
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
  • Loading branch information
SuZhou-Joe committed Sep 28, 2023
1 parent 7c8b69c commit ba2de2e
Show file tree
Hide file tree
Showing 25 changed files with 56 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const loginPage = new LoginPage(cy);

describe('verify the advanced settings are saved', () => {
beforeEach(() => {
miscUtils.visitPage('app/management/opensearch-dashboards/settings');
miscUtils.visitPage('app/settings');
loginPage.enterUserName('admin');
loginPage.enterPassword('admin');
loginPage.submit();
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/with-security/helpers/generate_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const loginPage = new LoginPage(cy);

describe('Generating BWC test data with security', () => {
beforeEach(() => {
miscUtils.visitPage('app/management/opensearch-dashboards/settings');
miscUtils.visitPage('app/settings');
loginPage.enterUserName('admin');
loginPage.enterPassword('admin');
loginPage.submit();
Expand All @@ -29,7 +29,7 @@ describe('Generating BWC test data with security', () => {
});

it('adds advanced settings', () => {
miscUtils.visitPage('app/management/opensearch-dashboards/settings');
miscUtils.visitPage('app/settings');
cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click();
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type(
'{selectAll}4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const miscUtils = new MiscUtils(cy);

describe('verify the advanced settings are saved', () => {
beforeEach(() => {
miscUtils.visitPage('app/management/opensearch-dashboards/settings');
miscUtils.visitPage('app/settings');
});

it('the dark mode is on', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Generating BWC test data without security', () => {
miscUtils.visitPage('app');
});
it('adds advanced settings', () => {
miscUtils.visitPage('app/management/opensearch-dashboards/settings');
miscUtils.visitPage('app/settings');
cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click();
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type(
'{selectAll}4'
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/core_app/errors/url_overflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('url overflow detection', () => {
</code>
option in
<a
href="/test-123/app/management/opensearch-dashboards/settings"
href="/test-123/app/settings"
>
advanced settings
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/core_app/errors/url_overflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const setupUrlOverflowDetection = ({ basePath, history, toasts, uiSetting
values={{
storeInSessionStorageParam: <code>state:storeInSessionStorage</code>,
advancedSettingsLink: (
<a href={basePath.prepend('/app/management/opensearch-dashboards/settings')}>
<a href={basePath.prepend('/app/settings')}>
<FormattedMessage
id="core.ui.errorUrlOverflow.bigUrlWarningNotificationMessage.advancedSettingsLinkText"
defaultMessage="advanced settings"
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/core_app/errors/url_overflow_ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const UrlOverflowUi: React.FC<{ basePath: IBasePath }> = ({ basePath }) =
values={{
storeInSessionStorageConfig: <code>state:storeInSessionStorage</code>,
opensearchDashboardsSettingsLink: (
<a href={basePath.prepend('/app/management/opensearch-dashboards/settings')}>
<a href={basePath.prepend('/app/settings')}>
<FormattedMessage
id="core.ui.errorUrlOverflow.optionsToFixError.enableOptionText.advancedSettingsLinkText"
defaultMessage="Advanced Settings"
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/ui_settings/saved_objects/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const uiSettingsType: SavedObjectsType = {
importableAndExportable: true,
getInAppUrl() {
return {
path: `/app/management/opensearch-dashboards/settings`,
path: `/app/settings`,
uiCapabilitiesPath: 'advancedSettings.show',
};
},
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/dashboard/server/saved_objects/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ export const dashboardSavedObjectType: SavedObjectsType = {
return obj.attributes.title;
},
getEditUrl(obj) {
return `/management/opensearch-dashboards/objects/savedDashboards/${encodeURIComponent(
obj.id
)}`;
return `/objects/savedDashboards/${encodeURIComponent(obj.id)}`;
},
getInAppUrl(obj) {
return {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function OpenSearchPanel({ onClose, makeUrl }: Props) {
fill
onClick={onClose}
href={addBasePath(
`/app/management/opensearch-dashboards/objects?_a=${rison.encode({
`/app/objects?_a=${rison.encode({
tab: SAVED_OBJECT_TYPE,
})}`
)}
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/discover/server/saved_objects/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ export const searchSavedObjectType: SavedObjectsType = {
return obj.attributes.title;
},
getEditUrl(obj) {
return `/management/opensearch-dashboards/objects/savedSearches/${encodeURIComponent(
obj.id
)}`;
return `/objects/savedSearches/${encodeURIComponent(obj.id)}`;
},
getInAppUrl(obj) {
return {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function OpenSearchPanel(props) {
fill
onClick={props.onClose}
href={addBasePath(
`/app/management/opensearch-dashboards/objects?_a=${rison.encode({
`/app/objects?_a=${rison.encode({
tab: SEARCH_OBJECT_TYPE,
})}`
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export const NewThemeModal: FC<Props> = ({ addBasePath, onClose }) => {
modes. You or your administrator can change to the previous theme by visiting {advancedSettingsLink}."
values={{
advancedSettingsLink: (
<EuiLink
href={addBasePath('/app/management/opensearch-dashboards/settings#appearance')}
>
<EuiLink href={addBasePath('/app/settings#appearance')}>
<FormattedMessage
id="home.newThemeModal.previewDescription.advancedSettingsLinkText"
defaultMessage="Advanced Settings"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const OverviewPageFooter: FC<Props> = ({ addBasePath, path }) => {
<EuiButtonEmpty
className="osdOverviewPageFooter__button"
flush="both"
href={addBasePath('/app/management/opensearch-dashboards/settings#defaultRoute')}
href={addBasePath('/app/settings#defaultRoute')}
iconType="home"
size="xs"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class TableListView extends React.Component<TableListViewProps, TableListViewSta
listingLimitValue: this.props.listingLimit,
listingLimitText: <strong>listingLimit</strong>,
advancedSettingsLink: (
<EuiLink href="#/management/opensearch-dashboards/settings">
<EuiLink href="#/settings">
<FormattedMessage
id="opensearch-dashboards-react.tableListView.listing.listingLimitExceeded.advancedSettingsLinkText"
defaultMessage="Advanced Settings"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ describe('SavedObjectsTable', () => {
meta: {
title: `MyIndexPattern*`,
icon: 'indexPatternApp',
editUrl: '#/management/opensearch-dashboards/indexPatterns/patterns/1',
editUrl: '#/indexPatterns/patterns/1',
inAppUrl: {
path: '/management/opensearch-dashboards/indexPatterns/patterns/1',
path: '/indexPatterns/patterns/1',
uiCapabilitiesPath: 'management.opensearchDashboards.indexPatterns',
},
},
Expand All @@ -185,7 +185,7 @@ describe('SavedObjectsTable', () => {
meta: {
title: `MySearch`,
icon: 'search',
editUrl: '/management/opensearch-dashboards/objects/savedSearches/2',
editUrl: '/objects/savedSearches/2',
inAppUrl: {
path: '/discover/2',
uiCapabilitiesPath: 'discover.show',
Expand All @@ -198,7 +198,7 @@ describe('SavedObjectsTable', () => {
meta: {
title: `MyDashboard`,
icon: 'dashboardApp',
editUrl: '/management/opensearch-dashboards/objects/savedDashboards/3',
editUrl: '/objects/savedDashboards/3',
inAppUrl: {
path: '/dashboard/3',
uiCapabilitiesPath: 'dashboard.show',
Expand All @@ -211,7 +211,7 @@ describe('SavedObjectsTable', () => {
meta: {
title: `MyViz`,
icon: 'visualizeApp',
editUrl: '/management/opensearch-dashboards/objects/savedVisualizations/4',
editUrl: '/objects/savedVisualizations/4',
inAppUrl: {
path: '/edit/4',
uiCapabilitiesPath: 'visualize.show',
Expand Down Expand Up @@ -460,7 +460,7 @@ describe('SavedObjectsTable', () => {
meta: {
title: `MySearch`,
icon: 'search',
editUrl: '/management/opensearch-dashboards/objects/savedSearches/2',
editUrl: '/objects/savedSearches/2',
inAppUrl: {
path: '/discover/2',
uiCapabilitiesPath: 'discover.show',
Expand All @@ -475,7 +475,7 @@ describe('SavedObjectsTable', () => {
type: 'search',
meta: {
title: 'MySearch',
editUrl: '/management/opensearch-dashboards/objects/savedSearches/2',
editUrl: '/objects/savedSearches/2',
icon: 'search',
inAppUrl: {
path: '/discover/2',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ export const augmentVisSavedObjectType: SavedObjectsType = {
return `augment-vis-${obj?.attributes?.originPlugin}`;
},
getEditUrl(obj) {
return `/management/opensearch-dashboards/objects/savedAugmentVis/${encodeURIComponent(
obj.id
)}`;
return `/objects/savedAugmentVis/${encodeURIComponent(obj.id)}`;
},
},
mappings: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export const visBuilderSavedObjectType: SavedObjectsType = {
defaultSearchField: 'title',
importableAndExportable: true,
getTitle: ({ attributes: { title } }: SavedObject<VisBuilderSavedObjectAttributes>) => title,
getEditUrl: ({ id }: SavedObject) =>
`/management/opensearch-dashboards/objects/savedVisBuilder/${encodeURIComponent(id)}`,
getEditUrl: ({ id }: SavedObject) => `/objects/savedVisBuilder/${encodeURIComponent(id)}`,
getInAppUrl({ id }: SavedObject) {
return {
path: `/app/${PLUGIN_ID}${EDIT_PATH}/${encodeURIComponent(id)}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ export const visualizationSavedObjectType: SavedObjectsType = {
return obj.attributes.title;
},
getEditUrl(obj) {
return `/management/opensearch-dashboards/objects/savedVisualizations/${encodeURIComponent(
obj.id
)}`;
return `/objects/savedVisualizations/${encodeURIComponent(obj.id)}`;
},
getInAppUrl(obj) {
return {
Expand Down
Loading

0 comments on commit ba2de2e

Please sign in to comment.