Skip to content

Commit

Permalink
Revert "[#2170] Add Blurbs for Repos (#2191)"
Browse files Browse the repository at this point in the history
This reverts commit f4cad78.
  • Loading branch information
ckcherry23 authored May 12, 2024
1 parent f4cad78 commit 51103e7
Show file tree
Hide file tree
Showing 41 changed files with 18 additions and 1,300 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dependencies {
implementation group: 'org.apache.ant', name: 'ant', version: '1.10.12'
implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.9.0'
implementation group: 'org.fusesource.jansi', name: 'jansi', version: '2.4.0'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.17.0'

testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: jUnitVersion
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: jUnitVersion
Expand Down
2 changes: 0 additions & 2 deletions config/blurbs.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/ug/blurbs.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/ug/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ partial credit.
<div id="section-config">

**`--config CONFIG_DIRECTORY`**: Specifies that config files located in `CONFIG_DIRECTORY` should be used to customize the report.
* Parameter: `CONFIG_DIRECTORY` The directory containing the config files. Should contain a `repo-config.csv` file. Optionally, can contain an `author-config.csv` file or/and a `group-config.csv` file or/and a `report-config.json` file or/and a `blurbs.md` file.
* Parameter: `CONFIG_DIRECTORY` The directory containing the config files. Should contain a `repo-config.csv` file. Optionally, can contain an `author-config.csv` file or/and a `group-config.csv` file or/and a `report-config.json` file.
* Alias: `-c`
* Example: `java -jar RepoSense.jar --config ./config`

Expand Down
14 changes: 0 additions & 14 deletions docs/ug/configFiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,3 @@ Note: Symbols such as `"`, `!`, `/` etc. in your author name will be omitted, wh
</box>

</div>

<!-- ==================================================================================================== -->

<div id="section-blurbs">

## `blurbs.md`

You can optionally use `blurbs.md` to add blurbs in Markdown syntax for repository branches. These blurbs will be seen when grouping by `Repo/Branch`. ([example](https://github.com/reposense/RepoSense/blob/master/docs/ug/blurbs.md))

**Format**:
* First line in section: Link to the repository branch.
* Second line onwards: Blurb content.
* Delimiter: `<!--repo-->`. Everything on the line after the delimiter will be ignored.
</div>
10 changes: 1 addition & 9 deletions docs/ug/customizingReports.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ In both instances, it is **necessary to commit any changes** for them to be dete

<!-- ------------------------------------------------------------------------------------------------------ -->

### Personalizing Reports
### Add a title

#### Add a title
A title component can be added by creating a file titled `title.md` in the assets directory. You can specify the assets directory according to the reference below:
{{ embed("Appendix: **CLI syntax reference → `assets` flag**", "cli.md#section-assets") }}

Expand All @@ -74,10 +73,3 @@ The title can render a combination of Markdown/HTML and plaintext ([example](htt
Do note that the width of the title is bound by the width of the left panel.

For more information on how to use Markdown, see the [Markdown Guide](https://www.markdownguide.org/).

#### Add blurbs for branches
A blurb can be added for a repository branch by creating a file titled `blurbs.md` in the config directory. The blurbs will be visible when grouping by `Repo/Branch`. The format of the file is given below:
{{ embed("Appendix: **Config files format**", "configFiles.md#section-blurbs") }}

Specifying the config directory can be done as follows:
{{ embed("Appendix: **CLI syntax reference → `config` flag**", "cli.md#section-config") }}
11 changes: 0 additions & 11 deletions frontend/cypress/config/blurbs.md

This file was deleted.

34 changes: 0 additions & 34 deletions frontend/cypress/tests/chartView/chartView_blurbs.cy.js

This file was deleted.

2 changes: 0 additions & 2 deletions frontend/src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ const app = defineComponent({
reportGenerationTime,
errorMessages,
names,
blurbMap,
} = summary;
this.creationDate = creationDate;
this.reportGenerationTime = reportGenerationTime;
Expand All @@ -135,7 +134,6 @@ const app = defineComponent({
this.getUsers();
this.renderTabHash();
this.userUpdated = true;
this.$store.commit('setBlurbMap', blurbMap);
} catch (error) {
window.alert(error);
} finally {
Expand Down
30 changes: 0 additions & 30 deletions frontend/src/components/c-markdown-chunk.vue

This file was deleted.

44 changes: 2 additions & 42 deletions frontend/src/components/c-summary-charts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@
)
font-awesome-icon.icon-button(icon="clipboard")
span.tooltip-text(v-bind:ref="`summary-charts-${i}-copy-iframe`") Click to copy iframe link for group

.tooltip.summary-chart__title--percentile(
v-if="sortGroupSelection.includes('totalCommits')"
v-if="sortGroupSelection.includes('totalCommits')"
) {{ getPercentile(i) }} %&nbsp
span.tooltip-text.right-aligned {{ getPercentileExplanation(i) }}
.summary-charts__title--tags(
Expand All @@ -157,14 +158,6 @@
)
font-awesome-icon(icon="tags")
span &nbsp;{{ tag }}

.blurbWrapper(
v-if="filterGroupSelection === 'groupByRepos'",
)
c-markdown-chunk.blurb(
v-bind:markdown-text="getBlurb(repo[0])"
)

.summary-charts__fileType--breakdown(v-if="filterBreakdown")
template(v-if="filterGroupSelection !== 'groupByNone'")
.summary-charts__fileType--breakdown__legend(
Expand Down Expand Up @@ -344,7 +337,6 @@ import brokenLinkDisabler from '../mixin/brokenLinkMixin';
import tooltipPositioner from '../mixin/dynamicTooltipMixin';
import cRamp from './c-ramp.vue';
import cStackedBarChart from './c-stacked-bar-chart.vue';
import cMarkdownChunk from './c-markdown-chunk.vue';
import { Bar, Repo, User } from '../types/types';
import { FilterGroupSelection, FilterTimeFrame, SortGroupSelection } from '../types/summary';
import { StoreState, ZoomInfo } from '../types/vuex.d';
Expand All @@ -355,7 +347,6 @@ export default defineComponent({
components: {
cRamp,
cStackedBarChart,
cMarkdownChunk,
},
mixins: [brokenLinkDisabler, tooltipPositioner],
props: {
Expand Down Expand Up @@ -993,41 +984,10 @@ export default defineComponent({
return [...new Set(repo.flatMap((r) => r.commits).flatMap((c) => c.commitResults).flatMap((r) => r.tags))]
.filter(Boolean) as Array<string>;
},
getBlurb(repo: User): string {
const link = this.getRepoLink(repo);
if (!link) {
return '';
}
const blurb: string | undefined = this.$store.state.blurbMap[link];
if (!blurb) {
return '';
}
return blurb;
},
},
});
</script>

<style lang="scss" scoped>
@import '../styles/tags.scss';
@import '../styles/_colors.scss';
.blurbWrapper {
padding-bottom: 5px;
.blurb {
background-color: #F6F8FA;
border-color: #E9EBEF;
border-radius: 4px;
border-style: solid;
border-width: 1px;
overflow-y: hidden;
// This is needed because the inline style of normalize.css adds bottom margins to all p tags, including the
// ones in the blurb.
padding-top: 10px;
// This is needed because the parent summary-wrapper center aligns everything
text-align: initial;
}
}
</style>
4 changes: 0 additions & 4 deletions frontend/src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default createStore<StoreState>({
loadingOverlayCount: 0,
loadingOverlayMessage: '',
isTabActive: true,
blurbMap: {},
} as StoreState,
mutations: {
updateTabZoomInfo(state: StoreState, info: ZoomInfo) {
Expand Down Expand Up @@ -83,9 +82,6 @@ export default createStore<StoreState>({
file.wasCodeLoaded = file.wasCodeLoaded || file.active;
});
},
setBlurbMap(state: StoreState, blurbMap: { [key: string]: string }) {
state.blurbMap = blurbMap;
},
},
actions: {
// Actions are called with dispatch
Expand Down
1 change: 0 additions & 1 deletion frontend/src/types/vuex.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ interface StoreState {
loadingOverlayCount: number;
loadingOverlayMessage: string;
isTabActive: boolean;
blurbMap: { [key: string]: string };
}

declare module '@vue/runtime-core' {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/types/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ interface Api {
reportGenerationTime: string;
errorMessages: { [key: string]: ErrorMessage };
names: string[];
blurbMap: { [key: string]: string };
} | null>;
loadCommits: (repoName: string) => Promise<User[]>;
loadAuthorship: (repoName: string) => Promise<AuthorshipSchema>;
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/types/zod/summary-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ export const summarySchema = z.object({
isUntilDateProvided: z.boolean(),
isAuthorshipAnalyzed: z.boolean().default(false), // for backwards compatability
supportedDomainUrlMap: supportedDomainUrlMapSchema,
blurbs: z.object({
urlBlurbMap: z.record(z.string(), z.string()),
}),
});

// Export typescript types
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,11 @@ window.api = {
window.REPOS[repoName] = repo;
names.push(repoName);
});

const blurbMap: { [key: string]: string } = data.blurbs.urlBlurbMap;
return {
creationDate: reportGeneratedTime,
reportGenerationTime,
errorMessages,
names,
blurbMap,
};
},

Expand Down
10 changes: 1 addition & 9 deletions src/main/java/reposense/RepoSense.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@

import net.sourceforge.argparse4j.helper.HelpScreenException;
import reposense.git.GitConfig;
import reposense.model.BlurbMap;
import reposense.model.CliArguments;
import reposense.model.RepoConfiguration;
import reposense.model.ReportConfiguration;
import reposense.model.RunConfigurationDecider;
import reposense.parser.ArgsParser;
import reposense.parser.exceptions.InvalidCsvException;
import reposense.parser.exceptions.InvalidHeaderException;
import reposense.parser.exceptions.InvalidMarkdownException;
import reposense.parser.exceptions.ParseException;
import reposense.report.ReportGenerator;
import reposense.system.LogsManager;
Expand All @@ -45,7 +43,6 @@ public static void main(String[] args) {
CliArguments cliArguments = ArgsParser.parse(args);
List<RepoConfiguration> configs = null;
ReportConfiguration reportConfig = new ReportConfiguration();
BlurbMap blurbMap = new BlurbMap();

if (cliArguments.isViewModeOnly()) {
ReportServer.startServer(SERVER_PORT_NUMBER, cliArguments.getReportDirectoryPath().toAbsolutePath());
Expand All @@ -54,7 +51,6 @@ public static void main(String[] args) {

configs = RunConfigurationDecider.getRunConfiguration(cliArguments).getRepoConfigurations();
reportConfig = cliArguments.getReportConfiguration();
blurbMap = cliArguments.getBlurbMap();

RepoConfiguration.setFormatsToRepoConfigs(configs, cliArguments.getFormats());
RepoConfiguration.setDatesToRepoConfigs(configs, cliArguments.getSinceDate(), cliArguments.getUntilDate());
Expand Down Expand Up @@ -84,9 +80,7 @@ public static void main(String[] args) {
cliArguments.isSinceDateProvided(), cliArguments.isUntilDateProvided(),
cliArguments.getNumCloningThreads(), cliArguments.getNumAnalysisThreads(),
TimeUtil::getElapsedTime, cliArguments.getZoneId(), cliArguments.isFreshClonePerformed(),
cliArguments.isAuthorshipAnalyzed(), cliArguments.getOriginalityThreshold(),
blurbMap
);
cliArguments.isAuthorshipAnalyzed(), cliArguments.getOriginalityThreshold());

FileUtil.zipFoldersAndFiles(reportFoldersAndFiles, cliArguments.getOutputFilePath().toAbsolutePath(),
".json");
Expand All @@ -103,8 +97,6 @@ public static void main(String[] args) {
logger.log(Level.WARNING, e.getMessage(), e);
} catch (HelpScreenException e) {
// help message was printed by the ArgumentParser; it is safe to exit.
} catch (InvalidMarkdownException ex) {
logger.log(Level.SEVERE, ex.getMessage(), ex);
}

LogsManager.moveLogFileToOutputFolder();
Expand Down
Loading

0 comments on commit 51103e7

Please sign in to comment.