-
Notifications
You must be signed in to change notification settings - Fork 7
95 provide a first page template #120
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e3a638b
feat(vue-ui): add DashboardPageTemplate
jasdubourg d738bed
build(vue-ui): dynamic data for score block and tags with stories
jasdubourg 24a16aa
feat(core-services): add the getScoreTexts() method
jasdubourg 5367cc7
build(vue-ui): correction for input data dashboard
jasdubourg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
155 changes: 155 additions & 0 deletions
155
shared/vue-ui/src/page-templates/DashboardPageTemplate.stories.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| import DashboardPageTemplate from "./DashboardPageTemplate.vue"; | ||
|
|
||
| // More on how to set up stories at: https://storybook.js.org/docs/writing-stories | ||
| export default { | ||
| title: 'Page Templates/DashboardPageTemplate', | ||
| component: DashboardPageTemplate, | ||
| tags: ['autodocs'], | ||
| argTypes: { | ||
| score: { | ||
| control: { | ||
| type: 'object' | ||
| }, | ||
| required: true | ||
| }, | ||
| rule: { | ||
| control: { | ||
| type: 'object' | ||
| }, | ||
| required: true | ||
| }, | ||
| metricTags: { | ||
| control: { | ||
| type: 'array' | ||
| }, | ||
| required: true | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| const score = { | ||
| value: "C", | ||
| label: "Your app is not fully optimized.", | ||
| description: "Keep going! You can continue by fixing the recommended rule on the right side. This is the one that currently has the highest impact on your app.", | ||
| tips: "You have between 10 and 19 minor severities or you have 1 or many major severity.", | ||
| projectKey: 'FOO', | ||
| branch: 'main', | ||
| minorSeverities: 15, | ||
| majorSeverities: 3, | ||
| criticalSeverities: 0 | ||
| } | ||
|
|
||
| const priorityRule = { | ||
| percentage: 25, | ||
| ruleKey: "typescript:S1774", | ||
| ruleName: "Avoid Using Ternary Operator", | ||
| ruleHtmlDesc: ` | ||
| Ternary expressions, while concise, can often lead to code that is difficult | ||
| to read and understand, especially when they are nested or complex. | ||
| Prioritizing readability fosters maintainability and reduces the likelihood of bugs. | ||
| Therefore, they should be removed in favor of more explicit control structures, | ||
| such as if/else statements, to improve the clarity and readability of the code. | ||
| `, | ||
| ruleImpact: "High", | ||
| ruleMetricTags: ["Maintenance"] | ||
| } | ||
|
|
||
| const cpuTag = { | ||
| name: "CPU", | ||
| nbRules: 19, | ||
| optimizedRules: 12, | ||
| minorIssues: 40, | ||
| majorIssues: 19, | ||
| criticalIssues: 0, | ||
| projectKey: 'foo', | ||
| branch: 'main' | ||
| } | ||
|
|
||
| const ramTag = { | ||
| name: "RAM", | ||
| nbRules: 17, | ||
| optimizedRules: 11, | ||
| minorIssues: 40, | ||
| majorIssues: 17, | ||
| criticalIssues: 0, | ||
| projectKey: 'foo', | ||
| branch: 'main' | ||
| } | ||
|
|
||
| const networkTag = { | ||
| name: "Network", | ||
| nbRules: 1, | ||
| optimizedRules: 1, | ||
| minorIssues: 0, | ||
| majorIssues: 0, | ||
| criticalIssues: 0, | ||
| projectKey: 'foo', | ||
| branch: 'main' | ||
| } | ||
|
|
||
| const diskTag = { | ||
| name: "Disk", | ||
| nbRules: 1, | ||
| optimizedRules: 1, | ||
| minorIssues: 0, | ||
| majorIssues: 0, | ||
| criticalIssues: 0, | ||
| projectKey: 'foo', | ||
| branch: 'main' | ||
| } | ||
|
|
||
| export const CompleteDashboard = { | ||
| args: { | ||
| score, | ||
| priorityRule, | ||
| metricTags: [ | ||
| cpuTag, | ||
| ramTag, | ||
| networkTag, | ||
| diskTag | ||
| ] | ||
| } | ||
| }; | ||
|
|
||
| export const WithoutNetworkAndDiskTags = { | ||
| args: { | ||
| score, | ||
| priorityRule, | ||
| metricTags: [ | ||
| cpuTag, | ||
| ramTag | ||
| ] | ||
| } | ||
| }; | ||
|
|
||
| export const WithoutScore = { | ||
| args: { | ||
| priorityRule, | ||
| metricTags: [ | ||
| cpuTag, | ||
| ramTag, | ||
| networkTag, | ||
| diskTag | ||
| ] | ||
| } | ||
| }; | ||
|
|
||
| export const WithoutPriorityRule = { | ||
| args: { | ||
| score, | ||
| metricTags: [ | ||
| cpuTag, | ||
| ramTag, | ||
| networkTag, | ||
| diskTag | ||
| ] | ||
| } | ||
| }; | ||
|
|
||
| export const WithoutMetricTags = { | ||
| args: { | ||
| score, | ||
| priorityRule, | ||
| metricTags: [] | ||
| } | ||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.