Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable] Update build #2590

Merged
merged 29 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
876f92a
Use ugly hack for console.dev environment (#2585)
karelhala Jul 21, 2023
4e94ad0
Adding a placeholder Jenkinsfile (#2589)
maknop Jul 25, 2023
3ca0df5
Add additional variants to match search queries.
Hyperkid123 Jul 26, 2023
76fc38a
Jenkinsfile build deploy POC (#2591)
maknop Jul 26, 2023
4820891
[RHCLOUD-25771] Search bar overlaps other UI elements when "schmushed…
rsun19 Jul 27, 2023
81c26a7
Reverting back to a placeholder file (#2594)
maknop Jul 27, 2023
ada855d
Adding us.console.dev.redhat.com
justinorringer Jul 28, 2023
ad68a24
Add MonitoringIcon to AllServices
AsToNlele Jul 31, 2023
e8f0394
Merge pull request #2596 from AsToNlele/add-monitoring-icon
Hyperkid123 Aug 1, 2023
3eebbfb
Merge branch 'master' into us-domains
karelhala Aug 1, 2023
1fdd556
Merge pull request #2595 from justinorringer/us-domains
Hyperkid123 Aug 1, 2023
63e0278
Disable segment integrations in e2e tests.
Hyperkid123 Aug 4, 2023
26d1f24
Intercept broken SSO JS bundle.
Hyperkid123 Aug 4, 2023
f2edb10
Merge pull request #2601 from Hyperkid123/fix-broken-e2e-test-runs
Hyperkid123 Aug 4, 2023
d97d103
Merge branch 'master' into fix-search-argument
Hyperkid123 Aug 4, 2023
6318065
Make cookie consent dismissable in mobile
epwinchell Aug 4, 2023
00c88e2
Merge branch 'master' into cookie_fix
epwinchell Aug 4, 2023
6c7d623
Add dist folder reference to build and deploy script (#2602)
karelhala Aug 4, 2023
785fdf5
Change path matching in Caddyfile: (#2604)
adamrdrew Aug 4, 2023
ee9fd90
Serve out unified build locations (#2605)
adamrdrew Aug 4, 2023
25eab82
Merge branch 'master' into cookie_fix
epwinchell Aug 5, 2023
8d5eeb4
Merge pull request #2603 from epwinchell/cookie_fix
Hyperkid123 Aug 7, 2023
f081210
Merge branch 'master' into fix-search-argument
Hyperkid123 Aug 7, 2023
0bd4019
Add florkbr to CODEOWNERS
florkbr Aug 7, 2023
ec0c8f3
Merge pull request #2592 from Hyperkid123/fix-search-argument
Hyperkid123 Aug 7, 2023
1c1d69c
Merge pull request #2606 from RedHatInsights/florkbr-patch-1
Hyperkid123 Aug 7, 2023
89291cb
Add explicit search query option with no wildcards. (#2607)
Hyperkid123 Aug 8, 2023
6684ad5
Remove cookie from ws:/ and wss:/ paths
karelhala Aug 8, 2023
56f391c
Merge pull request #2608 from karelhala/disable-cookie-ws
Hyperkid123 Aug 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence.
* @Hyperkid123 @ryelo @karelhala
* @Hyperkid123 @ryelo @karelhala @florkbr
20 changes: 10 additions & 10 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,43 @@
{$CADDY_TLS_CERT}
log
@app_match {
path_regexp /apps/chrome(.*)
path /apps/chrome*
}
handle @app_match {
uri strip_prefix /apps/chrome
file_server * {
root /opt/app-root/src/build
index opt/app-root/src/build/index.html
root /opt/app-root/src/build/stable
index opt/app-root/src/build/stable/index.html
browse
}
}

@beta_match {
path_regexp /beta/apps/chrome(.*)
path /beta/apps/chrome*
}
handle @beta_match {
uri strip_prefix /beta/apps/chrome
file_server * {
root /opt/app-root/src/build
index opt/app-root/src/build/index.html
root /opt/app-root/src/build/preview
index opt/app-root/src/build/preview/index.html
browse
}
}

@preview_match {
path_regexp /preview/apps/chrome(.*)
path /preview/apps/chrome*
}
handle @preview_match {
uri strip_prefix /preview/apps/chrome
file_server * {
root /opt/app-root/src/build
index opt/app-root/src/build/index.html
root /opt/app-root/src/build/preview
index opt/app-root/src/build/preview/index.html
browse
}
}

@config_match {
path_regexp /config/(.*)
path /config*
}
handle @config_match {
uri strip_prefix /config
Expand Down
32 changes: 32 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
def secrets = [
[path: params.VAULT_PATH_SVC_ACCOUNT_EPHEMERAL, engineVersion: 1, secretValues: [
[envVar: 'OC_LOGIN_TOKEN', vaultKey: 'oc-login-token'],
[envVar: 'OC_LOGIN_SERVER', vaultKey: 'oc-login-server']]],
[path: params.VAULT_PATH_SVC_ACCOUNT_EPHEMERAL, engineVersion: 1, secretValues: [
[envVar: 'OC_LOGIN_TOKEN_DEV', vaultKey: 'oc-login-token-dev'],
[envVar: 'OC_LOGIN_SERVER_DEV', vaultKey: 'oc-login-server-dev']]],
[path: params.VAULT_PATH_QUAY_PUSH, engineVersion: 1, secretValues: [
[envVar: 'QUAY_USER', vaultKey: 'user'],
[envVar: 'QUAY_TOKEN', vaultKey: 'token']]],
[path: params.VAULT_PATH_RHR_PULL, engineVersion: 1, secretValues: [
[envVar: 'RH_REGISTRY_USER', vaultKey: 'user'],
[envVar: 'RH_REGISTRY_TOKEN', vaultKey: 'token']]],
]

pipeline {
agent { label 'insights' }
options {
timestamps()
}
environment {
PROJECT_NAME="insights-chrome"
}

stages {
stage('Placeholder') {
steps {
sh 'echo Placeholder Jenkinsfile'
}
}
}
}
1 change: 1 addition & 0 deletions build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export COMPONENT="insights-chrome-frontend"
export IMAGE="quay.io/cloudservices/$COMPONENT"
export WORKSPACE=${WORKSPACE:-$APP_ROOT} # if running in jenkins, use the build's workspace
export APP_ROOT=$(pwd)
export DIST_FOLDER=build
export INCLUDE_CHROME_CONFIG="true"
cat /etc/redhat-release
COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master
Expand Down
4 changes: 3 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export default defineConfig({
// required for the SSO redirect
chromeWebSecurity: false,
video: false,
setupNodeEvents() {
setupNodeEvents(on, config) {
require('cypress-localstorage-commands/plugin')(on, config);
return config;
// implement node event listeners here
},
},
Expand Down
7 changes: 7 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ Cypress.Commands.add('login', () => {
() => {
cy.intercept({ url: '/beta/apps/*', times: 1 }, {});
cy.intercept({ url: '/api/', times: 4 }, {});
// This JS file causes randomly an uncaught exception on login page which blocks the tests
// Cannot read properties of undefined (reading 'setAttribute')
cy.intercept({ url: 'https://sso.stage.redhat.com/auth/resources/0833r/login/rhd-theme/dist/pfelements/bundle.js' }, {});
cy.visit('/');
// disable analytics integrations
cy.setLocalStorage('chrome:analytics:disable', 'true');
cy.setLocalStorage('chrome:segment:disable', 'true');

cy.wait(1000);
// login into the session
cy.get('#username-verification').type(Cypress.env('E2E_USER'));
Expand Down
1 change: 1 addition & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

// Import commands.js using ES2015 syntax:
import './commands';
import 'cypress-localstorage-commands';

// Alternatively you can use CommonJS syntax:
// require('./commands')
Expand Down
20 changes: 20 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.7.3",
"cypress": "^12.7.0",
"cypress-localstorage-commands": "^2.2.3",
"eslint": "^8.35.0",
"fork-ts-checker-webpack-plugin": "^7.3.0",
"git-revision-webpack-plugin": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/analytics/SegmentProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const SegmentProvider: React.FC<SegmentProviderProps> = ({ activeModule, childre
}
analytics.current = AnalyticsBrowser.load(
{ writeKey: newKey },
{ initialPageview: false, disableClientPersistence: true, integrations: { All: !isITLessEnv } }
{ initialPageview: false, disableClientPersistence: true, integrations: { All: !isITLessEnv && !disableIntegrations } }
);
window.segment = analytics.current;
resetIntegrations(analytics.current);
Expand Down
2 changes: 2 additions & 0 deletions src/components/AllServices/AllServicesIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import InfrastructureIcon from '@patternfly/react-icons/dist/js/icons/infrastruc
import RocketIcon from '@patternfly/react-icons/dist/js/icons/rocket-icon';
import ShoppingCartIcon from '@patternfly/react-icons/dist/js/icons/shopping-cart-icon';
import UsersIcon from '@patternfly/react-icons/dist/js/icons/users-icon';
import MonitoringIcon from '@patternfly/react-icons/dist/js/icons/monitoring-icon';

const AllServicesIcons = {
CloudUploadAltIcon,
Expand All @@ -28,6 +29,7 @@ const AllServicesIcons = {
ShoppingCartIcon,
CubeIcon,
BoxesIcon,
MonitoringIcon,
};

export default AllServicesIcons;
12 changes: 8 additions & 4 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Fragment } from 'react';
import React, { Fragment, useState } from 'react';
import ReactDOM from 'react-dom';
import Tools from './Tools';
import UnAuthtedHeader from './UnAuthtedHeader';
Expand Down Expand Up @@ -44,7 +44,11 @@ export const Header = ({ breadcrumbsProps }: { breadcrumbsProps?: Breadcrumbspro
const isITLessEnv = ITLess();
const { pathname } = useLocation();
const noBreadcrumb = !['/', '/allservices', '/favoritedservices'].includes(pathname);
const { lg } = useWindowWidth();
const { md, lg } = useWindowWidth();
const [searchOpen, setSearchOpen] = useState(false);
const hideAllServices = (isOpen: boolean) => {
setSearchOpen(isOpen);
};

return (
<Fragment>
Expand Down Expand Up @@ -73,7 +77,7 @@ export const Header = ({ breadcrumbsProps }: { breadcrumbsProps?: Breadcrumbspro
<ToolbarGroup variant="filter-group">
{user && (
<ToolbarItem>
<AllServicesDropdown />
{!(!md && searchOpen) && <AllServicesDropdown />}
{isITLessEnv && user?.identity?.user?.is_org_admin && <SatelliteLink />}
</ToolbarItem>
)}
Expand All @@ -84,7 +88,7 @@ export const Header = ({ breadcrumbsProps }: { breadcrumbsProps?: Breadcrumbspro
)}
</ToolbarGroup>
<ToolbarGroup className="pf-u-flex-grow-1 pf-u-mr-0 pf-u-mr-md-on-2xl" variant="filter-group">
<SearchInput />
<SearchInput onStateChange={hideAllServices} />
</ToolbarGroup>
<ToolbarGroup
className="pf-m-icon-button-group pf-u-ml-auto"
Expand Down
62 changes: 38 additions & 24 deletions src/components/Search/SearchInput.scss
Original file line number Diff line number Diff line change
@@ -1,33 +1,47 @@
@import "~@redhat-cloud-services/frontend-components-utilities/styles/_all";
@import '~@patternfly/patternfly/patternfly-addons.scss';
.chr-c-search {
&__input {
.pf-c-text-input-group {
--pf-c-text-input-group--BackgroundColor: var(--pf-global--palette--black-700);
--pf-c-text-input-group__icon--Color: var(--pf-global--primary-color--light-100);
--pf-c-text-input-group--placeholder--Color: var(--pf-global--Color--light-300);
--pf-c-text-input-group__text--after--BorderBottomColor: var(--pf-global--palette--black-500);
--pf-c-text-input-group__text--before--BorderColor: var(--pf-global--palette--black-800);
--pf-c-text-input-group__text--hover__icon--Color: var(--pf-global--primary-color--light-100);
&:hover {
--pf-c-text-input-group--placeholder--Color: var(--pf-global--Color--light-100);
--pf-c-text-input-group__text--after--BorderBottomColor: var(--pf-global--active-color--300);
&__input {
.pf-c-input-group {
background-color: transparent !important;
}
input:focus-visible {
outline: var(--pf-global--BorderWidth--sm) solid var(--pf-global--BackgroundColor--dark-100);

.pf-c-text-input-group {
--pf-c-text-input-group--BackgroundColor: var(--pf-global--palette--black-700);
--pf-c-text-input-group__icon--Color: var(--pf-global--primary-color--light-100);
--pf-c-text-input-group--placeholder--Color: var(--pf-global--Color--light-300);
--pf-c-text-input-group__text--after--BorderBottomColor: var(--pf-global--palette--black-500);
--pf-c-text-input-group__text--before--BorderColor: var(--pf-global--palette--black-800);
--pf-c-text-input-group__text--hover__icon--Color: var(--pf-global--primary-color--light-100);
&:hover {
--pf-c-text-input-group--placeholder--Color: var(--pf-global--Color--light-100);
--pf-c-text-input-group__text--after--BorderBottomColor: var(--pf-global--active-color--300);
}
input:focus-visible {
outline: var(--pf-global--BorderWidth--sm) solid var(--pf-global--BackgroundColor--dark-100);
}
}
}
}
&__menu {
overflow-y: auto;
.pf-c-menu__group-title {
padding-bottom: var(--pf-global--spacer--md);
&:empty {
display: none;
&__menu {
overflow-y: auto;
.pf-c-menu__group-title {
padding-bottom: var(--pf-global--spacer--md);
&:empty {
display: none;
}
}
}
&__empty-state {
.pf-c-empty-state__icon {
font-size: 2rem;
}
}
}
&__empty-state {
.pf-c-empty-state__icon {
font-size: 2rem;
@media screen and (max-width: 768px) {
.chr-c-search__input .chr-c-search__collapsed {
justify-content: flex-end;
}
.chr-c-search__input input {
color: white;
}
}
}
Loading
Loading