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

#99 - Allow any entity scoring (Breaking changes) #132

Merged
merged 11 commits into from
Dec 14, 2022
6 changes: 6 additions & 0 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ scorecards:
jsonDataUrl: http://localhost:8090/plugins/score-card/sample-data/ #this is being served via http-server
wikiLinkTemplate: https://link-to-wiki/{id}

# useEntityRef
# When true, use entity ref in URL when fetching its file, ex: {jsonDataUrl}/{entityRef.namespace}/{entityRef.kind}/{entityRef.name}
# When false, use system name in URL when fetching its file, ex: {jsonDataUrl}/{systemEntityName}
# default: false
useEntityRef: true

catalog:
rules:
- allow: [Component, System, API, Group, User, Resource, Location, Template]
Expand Down
10 changes: 10 additions & 0 deletions packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ const apiPage = (
<Grid item md={6}>
<EntityAboutCard />
</Grid>
<Grid item md={6}>
<EntityScoreCardContent />
jvilimek marked this conversation as resolved.
Show resolved Hide resolved
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/score" title="Score">
<Grid container spacing={3} alignItems="stretch">
<Grid item xs={12}>
<EntityScoreCardContent />
</Grid>
</Grid>
</EntityLayout.Route>
</EntityLayout>
Expand Down
7 changes: 7 additions & 0 deletions plugins/score-card/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,12 @@ export interface Config {
* @visibility frontend
*/
wikiLinkTemplate?: string;
/**
*
* When true, use entity ref in URL when fetching its file, ex: {jsonDataUrl}/{entityRef.namespace}/{entityRef.kind}/{entityRef.name}
* When false, use system name in URL when fetching its file, ex: {jsonDataUrl}/{systemEntityName}
* @visibility frontend
*/
useEntityRef?: boolean;
jvilimek marked this conversation as resolved.
Show resolved Hide resolved
};
}
42 changes: 42 additions & 0 deletions plugins/score-card/sample-data/all.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,46 @@
[
{
"entityRef": {
"kind": "api",
"name": "api.foo"
},
"scorePercent": 50,
"scoreLabel": "Yellow",
"scoringReviewDate": "2022-01-01T08:00:00Z",
jvilimek marked this conversation as resolved.
Show resolved Hide resolved
"scoreSuccess": "almost-failure",
"areaScores": [
{
"title": "Extensibility",
"scorePercent": 50,
"scoreLabel": "Yellow",
"scoreSuccess": "almost-failure"
},
{
"title": "Code",
"scorePercent": 100,
"scoreLabel": "Green",
"scoreSuccess": "success"
},
{
"title": "Quality",
"scorePercent": 25,
"scoreLabel": "Red",
"scoreSuccess": "failure"
},
{
"title": "Documentation",
"scorePercent": 100,
"scoreLabel": "Green",
"scoreSuccess": "success"
},
{
"title": "Operations",
"scorePercent": 50,
"scoreLabel": "Yellow",
"scoreSuccess": "almost-failure"
}
]
},
{
"systemEntityName": "non-valid-system",
"systemTier": "B",
Expand Down
1 change: 1 addition & 0 deletions plugins/score-card/sample-data/api.foo.json
Loading