Skip to content

Commit

Permalink
merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
MonicaG committed Aug 14, 2024
2 parents e85c4f5 + 3f9775e commit 4ec1b30
Show file tree
Hide file tree
Showing 29 changed files with 1,849 additions and 2,919 deletions.
1 change: 1 addition & 0 deletions .github/workflows/delete-gitops-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
ssh-key: ${{ secrets.MANIFEST_REPO_DEPLOY_KEY }}
repository: ${{ secrets.MANIFEST_REPO }}


- name: Delete branch in gitops
run: |
git push origin --delete ${{ needs.get-pr-branch-name.outputs.BRANCH_NAME }}
2 changes: 1 addition & 1 deletion app-config.production.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
backend:
# config options: https://node-postgres.com/api/client
# config options: https://node-postgres.com/apis/client
database:
client: pg
connection:
Expand Down
1 change: 1 addition & 0 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ proxy:
'/github-api':
target: https://api.github.com
allowedHeaders: ['Authorization', 'X-GitHub-Api-Version', 'Accept']
credentials: require
headers:
X-GitHub-Api-Version: "2022-11-28"
Accept: application/vnd.github+json
Expand Down
2 changes: 1 addition & 1 deletion backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.26.5"
"version": "1.28.4"
}
60 changes: 31 additions & 29 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,39 @@
"dependencies": {
"@app/plugin-expandable-toc": "0.0.0",
"@app/plugin-toc-fix2": "0.0.0",
"@backstage/app-defaults": "^1.5.4",
"@backstage/catalog-model": "^1.4.5",
"@backstage/cli": "^0.26.4",
"@backstage/core-app-api": "^1.12.4",
"@backstage/core-components": "^0.14.5",
"@backstage/core-plugin-api": "^1.9.2",
"@backstage/integration-react": "^1.1.26",
"@backstage/plugin-api-docs": "^0.11.4",
"@backstage/plugin-catalog": "^1.19.0",
"@backstage/plugin-catalog-common": "^1.0.22",
"@backstage/plugin-catalog-graph": "^0.4.4",
"@backstage/plugin-catalog-import": "^0.10.10",
"@backstage/plugin-catalog-react": "^1.11.3",
"@backstage/plugin-github-actions": "^0.6.16",
"@backstage/plugin-home": "^0.7.3",
"@backstage/plugin-org": "^0.6.24",
"@backstage/plugin-permission-react": "^0.4.22",
"@backstage/plugin-scaffolder": "^1.19.3",
"@backstage/plugin-search": "^1.4.10",
"@backstage/plugin-search-react": "^1.7.10",
"@backstage/plugin-stack-overflow": "^0.1.30",
"@backstage/plugin-tech-radar": "^0.7.4",
"@backstage/plugin-techdocs": "^1.10.4",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.9",
"@backstage/plugin-techdocs-react": "^1.2.3",
"@backstage/plugin-user-settings": "^0.8.5",
"@backstage/theme": "^0.5.3",
"@backstage/app-defaults": "^1.5.7",
"@backstage/catalog-model": "^1.5.0",
"@backstage/cli": "^0.26.10",
"@backstage/core-app-api": "^1.13.0",
"@backstage/core-components": "^0.14.8",
"@backstage/core-plugin-api": "^1.9.3",
"@backstage/integration-react": "^1.1.28",
"@backstage/plugin-api-docs": "^0.11.6",
"@backstage/plugin-catalog": "^1.21.0",
"@backstage/plugin-catalog-common": "^1.0.24",
"@backstage/plugin-catalog-graph": "^0.4.6",
"@backstage/plugin-catalog-import": "^0.12.0",
"@backstage/plugin-catalog-react": "^1.12.1",
"@backstage/plugin-home": "^0.7.6",
"@backstage/plugin-org": "^0.6.26",
"@backstage/plugin-permission-react": "^0.4.23",
"@backstage/plugin-scaffolder": "^1.22.0",
"@backstage/plugin-search": "^1.4.13",
"@backstage/plugin-search-react": "^1.7.12",
"@backstage/plugin-techdocs": "^1.10.6",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.11",
"@backstage/plugin-techdocs-react": "^1.2.5",
"@backstage/plugin-user-settings": "^0.8.8",
"@backstage/theme": "^0.5.6",
"@bcgov/bc-sans": "^2.0.0",
"@bcgov/design-tokens": "^3.0.0",
"@internal/plugin-analytics-module-snowplow": "^0.1.0",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@material-ui/lab": "^4.0.0-alpha.61",
"@material-ui/styles": "^4.11.5",
"@snowplow/browser-plugin-link-click-tracking": "^3.15.0",
"@snowplow/browser-plugin-site-tracking": "^3.23.1",
"@snowplow/browser-tracker": "^3.15.0",
"backstage-plugin-techdocs-addon-mermaid": "^0.11.0",
"history": "^5.0.0",
Expand All @@ -58,10 +57,13 @@
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"react-use": "^17.2.4",
"styled-components": "^6.0.0-rc.3"
"styled-components": "^6.0.0-rc.3",
"@backstage-community/plugin-github-actions": "^0.6.16",
"@backstage-community/plugin-stack-overflow": "^0.1.30",
"@backstage-community/plugin-tech-radar": "^0.7.4"
},
"devDependencies": {
"@backstage/test-utils": "^1.5.4",
"@backstage/test-utils": "^1.5.7",
"@playwright/test": "^1.32.3",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import {ScaffolderPage, scaffolderPlugin} from '@backstage/plugin-scaffolder';
import {orgPlugin} from '@backstage/plugin-org';
import {SearchPage} from '@backstage/plugin-search';
import {TechRadarPage} from '@backstage/plugin-tech-radar';
import {TechRadarPage} from '@backstage-community/plugin-tech-radar';
import {
TechDocsIndexPage,
techdocsPlugin,
Expand Down
7 changes: 7 additions & 0 deletions packages/app/src/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import {
AnyApiFactory,
configApiRef,
createApiFactory,
analyticsApiRef,
} from '@backstage/core-plugin-api';
import { SnowplowAnalytics } from '@internal/plugin-analytics-module-snowplow'

export const apis: AnyApiFactory[] = [
createApiFactory({
Expand All @@ -16,4 +18,9 @@ export const apis: AnyApiFactory[] = [
factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi),
}),
ScmAuth.createDefaultApiFactory(),
createApiFactory({
api: analyticsApiRef,
deps: { configApi: configApiRef },
factory: ({ configApi }) => SnowplowAnalytics.fromConfig(configApi),
}),
];
59 changes: 1 addition & 58 deletions packages/app/src/components/Root/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { PropsWithChildren, useEffect } from 'react';
import React, { PropsWithChildren } from 'react';
import { makeStyles } from '@material-ui/core';
import HomeIcon from '@material-ui/icons/Home';
// import CatalogIcon from '@material-ui/icons/LocalLibrary';
Expand Down Expand Up @@ -33,61 +33,6 @@ import MenuIcon from '@material-ui/icons/Menu';
import SearchIcon from '@material-ui/icons/Search';
import { CustomSearchModal } from '../search/CustomModal';

import {useApi, configApiRef} from '@backstage/core-plugin-api';


// snowplow analytics
import {newTracker, trackPageView, enableActivityTracking} from '@snowplow/browser-tracker';
import {
enableLinkClickTracking,
refreshLinkClickTracking,
LinkClickTrackingPlugin as linkTrackingPlugin
} from '@snowplow/browser-plugin-link-click-tracking';
import {useLocation} from "react-router-dom";


const MyReactComponent = () => {
const config = useApi(configApiRef);

const location = useLocation();

// refresh link tracking whenever local navigation occurs
useEffect(() => {
setTimeout(refreshLinkClickTracking, 250);
}, [location]);

console.log("**********Setting up analytics (or not...)********");
console.log(`Config: ${JSON.stringify(config)}`);

if (config.getOptionalConfig('app.analytics') && config.getBoolean('app.analytics.snowplow.enabled')) {
console.log("**********Analytics enabled...********");

// const collectorUrl = "spm.apps.gov.bc.ca"
const collectorUrl = config.getString("app.analytics.snowplow.collectorUrl");

newTracker('rt', `${collectorUrl}`, {
appId: 'Snowplow_standalone_OCIO',
cookieLifetime: 86400 * 548,
platform: "web",
contexts: {
webPage: true
},
plugins: [linkTrackingPlugin()]
});

enableActivityTracking({
minimumVisitLength: 30,
heartbeatDelay: 30
});

enableLinkClickTracking();

trackPageView();
}
return null;
}


const storedTheme = localStorage.getItem('theme');

// Set the default theme to custom DevEx theme if no stored preference is found
Expand Down Expand Up @@ -144,7 +89,6 @@ export const Root = ({ children }: PropsWithChildren<{}>) => {

return (
<SidebarPage>
<MyReactComponent/>
<Sidebar>
<SidebarLogo />
<SidebarGroup label="Search" icon={<SearchIcon />} to="/search">
Expand Down Expand Up @@ -215,7 +159,6 @@ export const Root = ({ children }: PropsWithChildren<{}>) => {
</SidebarScrollWrapper> */}
</SidebarGroup>
<SidebarSpace />
<SidebarDivider />
<SidebarGroup
label="Offsite Links"
>
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
import {
isGithubActionsAvailable,
EntityGithubActionsContent,
} from '@backstage/plugin-github-actions';
} from '@backstage-community/plugin-github-actions';
import {
EntityUserProfileCard,
EntityGroupProfileCard,
Expand Down
32 changes: 32 additions & 0 deletions packages/app/src/components/home/HomeHeaderText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {Typography, withStyles} from "@material-ui/core";
import * as tokens from "@bcgov/design-tokens/js";

export const BCGovBannerText = withStyles({
root: {
position: 'relative',
'&::before': {
content: `''`,
position: 'absolute',
top: '-6px',
left: '-25px',
width: '4px',
height: '64px',
background: tokens.themePrimaryGold
},
}
})(Typography);

export const BCGovHeaderText = withStyles({
root: {
position: 'relative',
'&::before': {
content: `''`,
position: 'absolute',
top: '-10px',
left: '0',
width: '36px',
height: '4px',
background: tokens.themePrimaryGold
},
}
})(Typography);
Loading

0 comments on commit 4ec1b30

Please sign in to comment.