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

[#467] Add Title Component #2102

Merged
merged 34 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8cc525f
Add title component
sopa301 Jan 29, 2024
a223766
Remove testing code
sopa301 Jan 29, 2024
31ef993
Add handling for invalid files
sopa301 Jan 29, 2024
0511528
Update package-lock
sopa301 Jan 29, 2024
caeee3c
Remove extra component usage
sopa301 Jan 29, 2024
6f6251c
Remove console statement
sopa301 Jan 29, 2024
5157f59
Remove faulty package-lock
sopa301 Jan 29, 2024
39c5d07
Add test title
sopa301 Jan 31, 2024
d726113
Add EOL
sopa301 Jan 31, 2024
14b6d34
Merge branch 'master' of https://github.com/sopa301/RepoSense into 46…
sopa301 Jan 31, 2024
b3343dc
Fix scrolling and test bugs
sopa301 Feb 6, 2024
0ff36c5
Fix line length
sopa301 Feb 6, 2024
bcdacef
Merge branch 'master' into 467-add-intro
sopa301 Feb 6, 2024
b3fdd84
Make title load from --assets folder
sopa301 Feb 8, 2024
293ad11
Make title path more general
sopa301 Feb 8, 2024
08e3934
Merge branch 'master' of https://github.com/sopa301/RepoSense into 46…
sopa301 Feb 8, 2024
05ef0ca
Remove test file
sopa301 Feb 8, 2024
a00e09e
Fix minor styling error
sopa301 Feb 8, 2024
434bca3
Update CLI reference
sopa301 Feb 13, 2024
610ab95
Add borders
sopa301 Feb 13, 2024
ffd05c0
Fix bug
sopa301 Feb 13, 2024
1324cc0
Update docs/ug/cli.md
sopa301 Feb 14, 2024
fdbdc0e
Add handling for unexpected error
sopa301 Feb 14, 2024
b7b002f
Merge branch '467-add-intro' of https://github.com/sopa301/RepoSense …
sopa301 Feb 14, 2024
6458fa2
Move title into left panel
sopa301 Feb 14, 2024
6ca0305
Fix style
sopa301 Feb 14, 2024
f7d7a6d
Update frontend/src/components/c-title.vue
sopa301 Feb 16, 2024
65fc7ea
Merge branch 'master' into 467-add-intro
ckcherry23 Feb 17, 2024
a083ef0
Remove unneeded code and fix promise bug
sopa301 Feb 17, 2024
2032cdc
Merge branch '467-add-intro' of https://github.com/sopa301/RepoSense …
sopa301 Feb 17, 2024
a19362d
Fix style
sopa301 Feb 17, 2024
644fd83
Remove unused code
sopa301 Feb 17, 2024
ae772a4
Add test
sopa301 Feb 17, 2024
e07a12e
Enable raw HTML
sopa301 Feb 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/ug/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ The section below provides explanations for each of the flags.
<div id="section-assets">

**`--assets ASSETS_DIRECTORY`**: Specifies where to place assets for report generation.
* Parameter: `ASSETS_DIRECTORY` The directory containing the assets files. A `favicon.ico` file can be placed here to customize the favicon of the dashboard.
* Parameter: `ASSETS_DIRECTORY` The directory containing the assets files. A `favicon.ico` file can be placed here to customize the favicon of the dashboard,
while a `title.md` file can be placed to customize the header of the report using [Markdown syntax](https://www.markdownguide.org/basic-syntax/).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sopa301 Noticed while passing: There should not be a line break here (in markdown files, we should not wrap lines to a specific length).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sopa301 Further comments:

  1. There should be more details of this feature. For example, code for an example title component.
  2. Doesn't feel like this is the right place to document this feature. Perhaps add as a separate section in https://reposense.org/ug/customizingReports.html ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, perhaps add a title component to our preview dashboard?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review prof, I'll work on it!

* Alias: `-a`
* Example: `--assets ./assets` or `-a ./assets`

Expand Down
503 changes: 270 additions & 233 deletions frontend/package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@
"@fortawesome/free-brands-svg-icons": "^6.0.0",
"@fortawesome/free-solid-svg-icons": "^6.0.0",
"@fortawesome/vue-fontawesome": "^3.0.3",
"@types/markdown-it": "^13.0.7",
"@types/minimatch": "^5.1.2",
"@types/seedrandom": "^3.0.5",
"core-js": "^3.6.5",
"highlight.js": "^10.5.0",
"jszip": "^3.5.0",
"markdown-it": "^14.0.0",
"minimatch": "^5.0.1",
"muicss": "^0.10.3",
"normalize.css": "^8.0.1",
"pug-lint-vue": "^0.4.0",
"raw-loader": "^4.0.2",
"seedrandom": "^3.0.5",
"vue": "^3.2.47",
"vue-loading-overlay": "^5.0.3",
Expand Down
39 changes: 39 additions & 0 deletions frontend/src/components/c-title.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<template lang="pug">
.title(v-html="markdownText", v-if="markdownText != ''")
</template>

<script lang="ts">
import MarkdownIt from 'markdown-it';
import { defineComponent } from 'vue';

export default defineComponent({
data() {
return {
markdownText: '',
};
},
beforeMount() {
try {
fetch('title.md').then((response) => {
if (!response.ok) { // file not found
return '';
}
return response.text();
}).then((text) => {
const md = new MarkdownIt();
this.markdownText = md.render(text);
});
} catch (error) {
this.markdownText = (error as Error).toString();
vvidday marked this conversation as resolved.
Show resolved Hide resolved
}
},
});
</script>

<style lang="scss" scoped>
.title {
padding: 2rem 1.5rem;
sopa301 marked this conversation as resolved.
Show resolved Hide resolved
// This is needed because the parent summary-wrapper center aligns everything
text-align: initial;
}
</style>
5 changes: 5 additions & 0 deletions frontend/src/shims-vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ declare module '*.vue' {
const component: DefineComponent<{}, {}, any>
export default component
}

declare module '*.md' {
vvidday marked this conversation as resolved.
Show resolved Hide resolved
const str: string
export default str
}
1 change: 0 additions & 1 deletion frontend/src/styles/panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
display: flex;
height: 100vh;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: z-index('app-wrapper');
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/views/c-home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
c-resizer
template(v-slot:left)
#summary-wrapper
c-title(ref="cTitle")
c-summary.tab-padding(
ref="summary",
v-bind:repos="users",
Expand Down Expand Up @@ -69,6 +70,7 @@
<script lang='ts'>
import { defineComponent } from 'vue';

import cTitle from '../components/c-title.vue';
import cResizer from '../components/c-resizer.vue';
import cZoom from './c-zoom.vue';
import cSummary from './c-summary.vue';
Expand All @@ -77,6 +79,7 @@ import cAuthorship from './c-authorship.vue';
const home = defineComponent({
name: 'c-home',
components: {
cTitle,
cResizer,
cZoom,
cSummary,
Expand Down
9 changes: 9 additions & 0 deletions frontend/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ module.exports = {
files: ['src/**/*.{vue,scss}'],
}),
],
module: {
rules: [
// Markdown Loader
{
test: /\.md$/,
loader: "raw-loader",
},
],
}
},
chainWebpack: (config) => {
// Pug Loader
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/reposense/report/ReportGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class ReportGenerator {
private static final String LOG_ERROR_CLONING_OR_BRANCHING = "Exception met while cloning or checking out.";
private static final String LOG_UNEXPECTED_ERROR = "Unexpected error stack trace for %s:\n>%s";
private static final List<String> assetsFilesWhiteList =
Collections.unmodifiableList(Arrays.asList(new String[] {"favicon.ico"}));
Collections.unmodifiableList(Arrays.asList(new String[] {"favicon.ico", "title.md"}));
sopa301 marked this conversation as resolved.
Show resolved Hide resolved

private LocalDateTime earliestSinceDate = null;
private ProgressTracker progressTracker = null;
Expand Down
Loading