Skip to content

Commit

Permalink
Merge pull request #2798 from RedHatInsights/master
Browse files Browse the repository at this point in the history
[stable] Update build
  • Loading branch information
Hyperkid123 authored May 27, 2024
2 parents ef1c5a8 + 34cd2da commit 7b12da7
Show file tree
Hide file tree
Showing 67 changed files with 1,258 additions and 674 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,21 @@ To run a script you have to install dependencies `npm install`. Then you are fre

3. Open browser at `https://stage.foo.redhat.com:1337/` or Open browser at `https://stage.foo.redhat.com:1337/preview`.

### Running chrome as a host application.
### Running chrome with other applications locally

As with any application, chrome can be a host application for others. You can configure the `routes` object in the `webpack.config.js` file as described in the proxy config [docs](https://github.com/RedHatInsights/frontend-components/tree/master/packages/config#routes).
You can spin chrome locally together with other applications. Use `LOCAL_APPS` to list the locally deployed applications.

#### Example
#### Example 1 (using LOCAL_APPS)

For illustration, to deploy Advisor together with Insights Chrome, you would require to

1. Run Advisor on any available port with `npm run start -- --port=8004` or `npm run start:beta -- --port=8004`,
2. Run Chrome and list the Advisor's port: `LOCAL_APPS=advisor:8004:http npm run dev` or `LOCAL_APPS=advisor:8004:http npm run dev:beta`.
#### Example 2 (using devServer route)
You can also specify deployed applications through devServer.routes field:
For illustration, to locally deploy Advisor for OpenShift together with Insights Chrome, you would require to
1. Run Advisor with `--port=8004` (or any other available port number),
2. Update the webpack config in the following way:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('<AllServicesDropdown />', () => {
cy.contains('Test link').click();
cy.contains('All services').should('not.exist');
}
cy.intercept('http://localhost:8080/api/chrome-service/v1/static/stable/stage/services/services.json', [
cy.intercept('http://localhost:8080/api/chrome-service/v1/static/stable/stage/services/services-generated.json', [
{
id: 'testSection',
description: 'Test section description',
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('<AllServicesDropdown />', () => {
});

it('should automatically minimize tabs after clicking on small screen', () => {
cy.intercept('http://localhost:8080/api/chrome-service/v1/static/stable/stage/services/services.json', [
cy.intercept('http://localhost:8080/api/chrome-service/v1/static/stable/stage/services/services-generated.json', [
{
id: 'testSection',
description: 'Test section description',
Expand Down
2 changes: 1 addition & 1 deletion cypress/component/AllServicesPage/AllServicesPage.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ChromeUser } from '@redhat-cloud-services/types';
describe('<AllServices />', () => {
beforeEach(() => {
// mock chrome and scalprum generic requests
cy.intercept('http://localhost:8080/api/chrome-service/v1/static/stable/stage/services/services.json', {
cy.intercept('http://localhost:8080/api/chrome-service/v1/static/stable/stage/services/services-generated.json', {
status: 200,
fixture: 'services.json',
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/component/DefaultLayout.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('<Default layout />', () => {
cy.intercept('GET', '/config/chrome/*-navigation.json*', {
navItems: [],
});
cy.intercept('GET', '/api/chrome-service/v1/static/stable/stage/services/services.json', []);
cy.intercept('GET', '/api/chrome-service/v1/static/stable/stage/services/services-generated.json', []);
});

it('render correctly with few nav items', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import { IntlProvider } from 'react-intl';
import GroupFilterInputGroup from '../../../src/components/GlobalFilter/GroupFilterInputGroup';

const initialProps = {
isDisabled: false,
filter: {
onChange: () => null,
},
setIsOpen: () => null,
selectedTags: {
key: {},
},
};

describe('<GroupFilterInputGroup />', () => {
it('should open Popover with Tags help', () => {
function openPopover() {
cy.get('[aria-label="Tags help"]').click();
cy.contains('Tags').should('exist');
}
cy.mount(
<IntlProvider locale="en">
<GroupFilterInputGroup
isDisabled={initialProps.isDisabled}
filter={initialProps.filter}
setIsOpen={initialProps.setIsOpen}
selectedTags={initialProps.selectedTags}
/>
</IntlProvider>
);

openPopover();
});
});
2 changes: 1 addition & 1 deletion cypress/component/helptopics/HelpTopicManager.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe('HelpTopicManager', () => {
cy.intercept('GET', '/api/chrome-service/v1/static/stable/stage/navigation/*-navigation.json?ts=*', {
navItems: [],
});
cy.intercept('GET', '/api/chrome-service/v1/static/stable/stage/services/services.json', []);
cy.intercept('GET', '/api/chrome-service/v1/static/stable/stage/services/services-generated.json', []);
});

it.only('should switch help topics drawer content', () => {
Expand Down
3 changes: 2 additions & 1 deletion cypress/e2e/release-gate/landing-page.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
describe('Landing page', () => {
// Landing page has changed
describe.skip('Landing page', () => {
it('visit landing page', () => {
cy.login();

Expand Down
4 changes: 2 additions & 2 deletions locales/translation-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@
"description": "Use"
},
"useAccountNumber": {
"defaultMessage": "Use this number when contacting Red Hat for support. If you don't have any active subscriptions, you will not have an account number.",
"description": "Use this number when contacting Red Hat for support. If you don't have any active subscriptions, you will not have an account number."
"defaultMessage": "Use this number when contacting Red Hat for support. If you've never had a subscription in your account, you may not see an account number here.",
"description": "Use this number when contacting Red Hat for support. If you've never had a subscription in your account, you may not see an account number here."
},
"useFeatureInBeta": {
"defaultMessage": "Use feature in preview",
Expand Down
Loading

0 comments on commit 7b12da7

Please sign in to comment.