Skip to content

Commit

Permalink
feat: new version of portal
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangndst committed Sep 14, 2024
1 parent cbb2a70 commit d0a4a18
Show file tree
Hide file tree
Showing 19 changed files with 42,561 additions and 28,612 deletions.
925 changes: 925 additions & 0 deletions .yarn/releases/yarn-4.4.1.cjs

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions .yarnclean
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# test directories
__tests__
test
tests
powered-test

# asset directories
docs
doc
website
images
assets

# examples
example
examples

# code coverage directories
coverage
.nyc_output

# build scripts
Makefile
Gulpfile.js
Gruntfile.js

# configs
appveyor.yml
circle.yml
codeship-services.yml
codeship-steps.yml
wercker.yml
.tern-project
.gitattributes
.editorconfig
.*ignore
.eslintrc
.jshintrc
.flowconfig
.documentup.json
.yarn-metadata.json
.travis.yml

# misc
*.md

!**/yaml/dist/**/doc
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.4.1.cjs
22 changes: 16 additions & 6 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ backend:
# information on the format
auth:
# key: x1tXmm40nfxOQM+sVbypFfaa3wUVL3ku

# dangerouslyDisableDefaultAuthPolicy: true
baseUrl: http://localhost:7007
listen:
Expand Down Expand Up @@ -40,15 +39,15 @@ backend:
allow:
- host: ${GITLAB_HOST}

integrations:
integrations:
gitlab:
- host: ${GITLAB_HOST}
token: ${GITLAB_TOKEN}
apiBaseUrl: https://${GITLAB_HOST}/api/v4
baseUrl: https://${GITLAB_HOST}
proxy:
endpoints:
"/prometheus/api":
'/prometheus/api':
# url to the api and path of your hosted prometheus instance
target: ${PROMETHEUS_URL}
changeOrigin: true
Expand All @@ -70,6 +69,8 @@ techdocs:
auth:
environment: development
# see https://backstage.io/docs/auth/ to learn about auth providers
session:
secret: ${SESSION_SECRET}
providers:
gitlab:
development:
Expand All @@ -79,15 +80,24 @@ auth:
signIn:
resolvers:
- resolver: usernameMatchingUserEntityName

oidc-auth-provider:
development:
metadataUrl: https://keycloak.idp.freeddns.org/realms/master/.well-known/openid-configuration
clientId: ${OIDC_CLIENT_ID}
clientSecret: ${OIDC_CLIENT_SECRET}
prompt: auto
signIn:
resolvers:
- resolver: emailLocalPartMatchingUserEntityName
- resolver: emailMatchingUserEntityProfileEmail

scaffolder:
# see https://backstage.io/docs/features/software-templates/configuration for software template options
defaultBranch: main
defaultAuthor:
name: hoangndst
email: [email protected]
defaultCommitMessage: "Initial commit"
defaultCommitMessage: 'Initial commit'

catalog:
providers:
Expand Down Expand Up @@ -153,7 +163,7 @@ s3:
timeout: { minutes: 1 }

permission:
enabled: true
enabled: false
rbac:
pluginsWithPermission:
- kubernetes
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.28.3"
"version": "1.30.4"
}
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
]
},
"devDependencies": {
"@backstage/cli": "^0.26.10",
"@backstage/cli": "^0.27.0",
"@backstage/e2e-test-utils": "^0.1.1",
"@playwright/test": "^1.32.3",
"@spotify/prettier-config": "^12.0.0",
"concurrently": "^8.0.0",
"lerna": "^7.3.0",
"node-gyp": "^10.0.0",
"prettier": "^2.3.2",
"typescript": "~5.4.0"
"@playwright/test": "^1.47.1",
"@spotify/prettier-config": "^15.0.0",
"concurrently": "^9.0.1",
"lerna": "^8.1.8",
"node-gyp": "^10.2.0",
"prettier": "^3.3.3",
"typescript": "~5.6.2"
},
"resolutions": {
"@types/react": "^18",
Expand All @@ -54,5 +54,6 @@
"*.{json,md}": [
"prettier --write"
]
}
},
"packageManager": "[email protected]"
}
87 changes: 44 additions & 43 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,60 +14,61 @@
"lint": "backstage-cli package lint"
},
"dependencies": {
"@backstage-community/plugin-github-actions": "^0.6.16",
"@backstage-community/plugin-todo-backend": "^0.3.17",
"@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-community/plugin-github-actions": "^0.6.22",
"@backstage-community/plugin-todo-backend": "^0.3.19",
"@backstage/app-defaults": "^1.5.10",
"@backstage/catalog-model": "^1.6.0",
"@backstage/cli": "^0.27.0",
"@backstage/core-app-api": "^1.14.2",
"@backstage/core-components": "^0.14.10",
"@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-backend-module-gitlab-org": "^0.0.4",
"@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-kubernetes": "^0.11.11",
"@backstage/plugin-org": "^0.6.26",
"@backstage/plugin-permission-react": "^0.4.23",
"@backstage/plugin-scaffolder": "^1.22.0",
"@backstage/plugin-search": "^1.4.12",
"@backstage/plugin-search-backend-module-pg": "^0.5.31",
"@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/integration-react": "^1.1.30",
"@backstage/plugin-api-docs": "^0.11.8",
"@backstage/plugin-catalog": "^1.22.0",
"@backstage/plugin-catalog-backend-module-gitlab-org": "^0.1.1",
"@backstage/plugin-catalog-common": "^1.0.26",
"@backstage/plugin-catalog-graph": "^0.4.8",
"@backstage/plugin-catalog-import": "^0.12.2",
"@backstage/plugin-catalog-react": "^1.12.3",
"@backstage/plugin-home": "^0.7.9",
"@backstage/plugin-kubernetes": "^0.11.13",
"@backstage/plugin-notifications": "^0.3.0",
"@backstage/plugin-org": "^0.6.28",
"@backstage/plugin-permission-react": "^0.4.25",
"@backstage/plugin-scaffolder": "^1.24.0",
"@backstage/plugin-search": "^1.4.15",
"@backstage/plugin-search-backend-module-pg": "^0.5.34",
"@backstage/plugin-search-react": "^1.7.14",
"@backstage/plugin-techdocs": "^1.10.8",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.13",
"@backstage/plugin-techdocs-react": "^1.2.7",
"@backstage/plugin-user-settings": "^0.8.11",
"@backstage/theme": "^0.5.6",
"@bestsellerit/backstage-plugin-harbor": "^0.3.1",
"@drodil/backstage-plugin-qeta": "^2.4.2",
"@drodil/backstage-plugin-qeta": "^2.9.0",
"@enfuse/chatgpt-plugin-frontend": "^1.1.1",
"@immobiliarelabs/backstage-plugin-gitlab": "^6.5.1",
"@janus-idp/backstage-plugin-rbac": "^1.22.0",
"@immobiliarelabs/backstage-plugin-gitlab": "^6.6.0",
"@janus-idp/backstage-plugin-rbac": "^1.29.4",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@parsifal-m/plugin-dev-quotes-homepage": "^3.0.5",
"@redhat-developer/red-hat-developer-hub-theme": "^0.0.59",
"@roadiehq/backstage-plugin-prometheus": "^2.9.0",
"@spreadshirt/backstage-plugin-s3-viewer": "^0.5.3",
"@parsifal-m/plugin-dev-quotes-homepage": "^3.0.6",
"@redhat-developer/red-hat-developer-hub-theme": "^0.3.0",
"@roadiehq/backstage-plugin-prometheus": "^2.11.1",
"@spreadshirt/backstage-plugin-s3-viewer": "^0.5.6",
"history": "^5.0.0",
"react": "^18.0.2",
"react-dom": "^18.0.2",
"react-icons": "^5.2.1",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"react-use": "^17.2.4"
"react-icons": "^5.3.0",
"react-router": "^6.26.2",
"react-router-dom": "^6.26.2",
"react-use": "^17.5.1"
},
"devDependencies": {
"@backstage/test-utils": "^1.5.7",
"@playwright/test": "^1.32.3",
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
"@backstage/test-utils": "^1.5.10",
"@playwright/test": "^1.47.1",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.0.0",
"@types/react-dom": "*",
"cross-env": "^7.0.0"
Expand Down
12 changes: 7 additions & 5 deletions packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
import { UserSettingsPage } from '@backstage/plugin-user-settings';
import { apis } from './apis';
import { apis, oidcAuthRef } from './apis';
import { entityPage } from './components/catalog/EntityPage';
import { searchPage } from './components/search/SearchPage';
import { gitlabAuthApiRef } from '@backstage/core-plugin-api';
Expand All @@ -44,6 +44,7 @@ import { getThemes } from '@redhat-developer/red-hat-developer-hub-theme';
import { S3ViewerPage } from '@spreadshirt/backstage-plugin-s3-viewer';
import { QetaPage } from '@drodil/backstage-plugin-qeta';
import { RbacPage } from '@janus-idp/backstage-plugin-rbac';
import { NotificationsPage } from '@backstage/plugin-notifications';

const app = createApp({
apis,
Expand Down Expand Up @@ -71,10 +72,10 @@ const app = createApp({
providers={[
'guest',
{
id: 'gitlab-auth-provider',
title: 'GitLab',
message: 'Sign in using GitLab',
apiRef: gitlabAuthApiRef,
id: 'oidc-auth-provider',
title: 'OIDC',
message: 'Sign in using OIDC',
apiRef: oidcAuthRef,
},
]}
/>
Expand Down Expand Up @@ -138,6 +139,7 @@ const routes = (
<Route path="/s3-viewer" element={<S3ViewerPage />} />
<Route path="/qeta" element={<QetaPage title="Questions" />} />
<Route path="/rbac" element={<RbacPage />} />;
<Route path="/notifications" element={<NotificationsPage />} />
</FlatRoutes>
);

Expand Down
48 changes: 48 additions & 0 deletions packages/app/src/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,57 @@ import {
AnyApiFactory,
configApiRef,
createApiFactory,
ApiRef,
OpenIdConnectApi,
ProfileInfoApi,
BackstageIdentityApi,
SessionApi,
createApiRef,
discoveryApiRef,
oauthRequestApiRef
} from '@backstage/core-plugin-api';
import { OAuth2 } from '@backstage/core-app-api';

export const oidcAuthRef: ApiRef<
OpenIdConnectApi & ProfileInfoApi & BackstageIdentityApi & SessionApi
> = createApiRef({
id: 'auth.oidc-auth-provider',
});

export const apis: AnyApiFactory[] = [
createApiFactory({
api: oidcAuthRef,
deps: {
discoveryApi: discoveryApiRef,
oauthRequestApi: oauthRequestApiRef,
configApi: configApiRef,
},
factory: ({ discoveryApi, oauthRequestApi, configApi }) => OAuth2.create({
configApi,
discoveryApi,
oauthRequestApi,
provider: {
id: 'oidc-auth-provider',
title: 'OIDC auth provider',
icon: () => null,
},
environment: configApi.getOptionalString('auth.environment'),
defaultScopes: ['openid', 'profile', 'email'],
popupOptions: {
// optional, used to customize login in popup size
size: {
fullscreen: true,
},
/**
* or specify popup width and height
* size: {
width: 1000,
height: 1000,
}
*/
},
}),
}),
createApiFactory({
api: scmIntegrationsApiRef,
deps: { configApi: configApiRef },
Expand Down
2 changes: 2 additions & 0 deletions packages/app/src/components/Root/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import CategoryIcon from '@material-ui/icons/Category';
import { SiAmazons3 } from 'react-icons/si';
import LiveHelpIcon from '@material-ui/icons/LiveHelp';
import { Administration } from '@janus-idp/backstage-plugin-rbac';
import { NotificationsSidebarItem } from '@backstage/plugin-notifications';

const useSidebarLogoStyles = makeStyles({
root: {
Expand Down Expand Up @@ -78,6 +79,7 @@ export const Root = ({ children }: PropsWithChildren<{}>) => (
<SidebarItem icon={SiAmazons3} to="s3-viewer" text="S3 Viewer" />
<SidebarItem icon={LiveHelpIcon} to="qeta" text="Q&A" />
<SidebarDivider />
<NotificationsSidebarItem />
<SidebarScrollWrapper>
<SidebarItem icon={MapIcon} to="tech-radar" text="Tech Radar" />
<Administration />
Expand Down
6 changes: 1 addition & 5 deletions packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ import {
} from '@immobiliarelabs/backstage-plugin-gitlab';

import { EntityKubernetesContent } from '@backstage/plugin-kubernetes';
import {
EntityPrometheusContent,
EntityPrometheusAlertCard,
EntityPrometheusGraphCard,
} from '@roadiehq/backstage-plugin-prometheus';
import { EntityPrometheusContent } from '@roadiehq/backstage-plugin-prometheus';
import { QetaContent } from '../question/Question';

const techdocsContent = (
Expand Down
Loading

0 comments on commit d0a4a18

Please sign in to comment.