Feat: Org Plugin (#3448)

* Feat: Create Groups plugin

* Feat: update code after CR

* Feat: change routing, replace filters to use relations, modify EntityPageLayout to support users

* Feat: update CLI version

* Feat: add some tests

* Update daily cost data to return groupedCosts

* Add aggregation sum util

* Add top panel breakdown view

* Add top panel tabs

* Add mock data for grouped Costs

* Add comments on groupedCosts

* Update wording to product in cost by product component

* Move cost overview chart legend to separate component

* Move mock data utils

* Add data viz colors for both themes

* Move mock data utils

* Update data viz dark theme colors

* Update bar chart legend type usage

* catalog-backend: gracefully handle missing codeowners

* Derive the owned entities in the catalog from group memberships

* Filter the response headers in the proxy backend

* Make backend-commons tests work on Windows

* backend: remove yarn cache from built docker image

* Refactor the hooks and also support users owning components

* backend,yarnrc: bring yarn network-timeout down to 300s

* Fix another Windows test issue

This one is a bit tricky. Instead of testing at the root folder of the drive, this test is now relative to the current directory. This resolves the difference between "/pkgs/a" and "d:\pkgs\a"

* Drop fill opacity for lighter colors

* Update dark theme colors

* Fix review comments

* techdocs-backend: update Gitlab clone auth

* Use case-insensitive filters

* Add Kubernetes plugin (#3505)

* backend-common: allow port in config to be both a number or a string

* chore: set the port as number if it comes through as a string

* Feat: Bump GitHub Insights plugin version (#3509)

* Feat: groups and components card

* Feat: update Org plugin according to CR

* Feat: update TS stuff

* Feat: change tile titles

* Feat: bump packages

* Code review fixes

Co-authored-by: Brenda Sukh <brendasukh@gmail.com>
Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: Dominik Henneke <dominik.henneke@sda-se.com>
Co-authored-by: Oliver Sand <oliver.sand@tentaclelabs.com>
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Chongyang Adrian, Ke <ftt.adrian.ke@grabtaxi.com>
Co-authored-by: Adam Harvey <adam.harvey@dxc.com>
Co-authored-by: blam <ben@blam.sh>
Co-authored-by: Marek Calus <marek-calus@wp.pl>
This commit is contained in:
Mateusz Lewtak
2020-12-07 16:46:15 +01:00
committed by GitHub
parent 9878ec02d5
commit 040f453c36
28 changed files with 1233 additions and 5 deletions
+1
View File
@@ -18,6 +18,7 @@
"@backstage/plugin-github-actions": "^0.2.3",
"@backstage/plugin-gitops-profiles": "^0.2.1",
"@backstage/plugin-graphiql": "^0.2.1",
"@backstage/plugin-org": "^0.3.0",
"@backstage/plugin-jenkins": "^0.3.2",
"@backstage/plugin-kubernetes": "^0.3.1",
"@backstage/plugin-lighthouse": "^0.2.4",
@@ -13,7 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ApiEntity, Entity } from '@backstage/catalog-model';
import {
ApiEntity,
Entity,
GroupEntity,
UserEntity,
} from '@backstage/catalog-model';
import { EmptyState } from '@backstage/core';
import {
ApiDefinitionCard,
@@ -48,6 +53,12 @@ import {
isPluginApplicableToEntity as isLighthouseAvailable,
LastLighthouseAuditCard,
} from '@backstage/plugin-lighthouse';
import {
OwnershipCard,
MembersListCard,
GroupProfileCard,
UserProfileCard,
} from '@backstage/plugin-org';
import { Router as SentryRouter } from '@backstage/plugin-sentry';
import { EmbeddedDocsRouter as DocsRouter } from '@backstage/plugin-techdocs';
import { Button, Grid } from '@material-ui/core';
@@ -323,6 +334,51 @@ const ApiEntityPage = ({ entity }: { entity: Entity }) => (
</EntityPageLayout>
);
const UserOverviewContent = ({ entity }: { entity: UserEntity }) => (
<Grid container spacing={3}>
<Grid item xs={12} md={6}>
<UserProfileCard entity={entity} variant="gridItem" />
</Grid>
<Grid item xs={12} md={6}>
<OwnershipCard entity={entity} variant="gridItem" />
</Grid>
</Grid>
);
const UserEntityPage = ({ entity }: { entity: Entity }) => (
<EntityPageLayout>
<EntityPageLayout.Content
path="/*"
title="Overview"
element={<UserOverviewContent entity={entity as UserEntity} />}
/>
</EntityPageLayout>
);
const GroupOverviewContent = ({ entity }: { entity: GroupEntity }) => (
<Grid container spacing={3}>
<Grid item xs={12} md={6}>
<GroupProfileCard entity={entity} variant="gridItem" />
</Grid>
<Grid item xs={12} md={6}>
<OwnershipCard entity={entity} variant="gridItem" />
</Grid>
<Grid item xs={12}>
<MembersListCard entity={entity} />
</Grid>
</Grid>
);
const GroupEntityPage = ({ entity }: { entity: Entity }) => (
<EntityPageLayout>
<EntityPageLayout.Content
path="/*"
title="Overview"
element={<GroupOverviewContent entity={entity as GroupEntity} />}
/>
</EntityPageLayout>
);
export const EntityPage = () => {
const { entity } = useEntity();
@@ -331,6 +387,10 @@ export const EntityPage = () => {
return <ComponentEntityPage entity={entity} />;
case 'api':
return <ApiEntityPage entity={entity} />;
case 'group':
return <GroupEntityPage entity={entity} />;
case 'user':
return <UserEntityPage entity={entity} />;
default:
return <DefaultEntityPage entity={entity} />;
}
+1
View File
@@ -42,3 +42,4 @@ export { plugin as UserSettings } from '@backstage/plugin-user-settings';
export { plugin as PagerDuty } from '@backstage/plugin-pagerduty';
export { plugin as Buildkite } from '@roadiehq/backstage-plugin-buildkite';
export { plugin as Search } from '@backstage/plugin-search';
export { plugin as Org } from '@backstage/plugin-org';