Skip to content

Commit

Permalink
[#1446] Restore the name on authorship panel after reloading (#1458)
Browse files Browse the repository at this point in the history
The display name of the author is not shown after reloading the 
authorship panel.

Let's enable the restoring of the name after reloading by adding an 
extra attribute to the state of `v_authorship`.
  • Loading branch information
HCY123902 authored Mar 15, 2021
1 parent 3973bf0 commit 451f11b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion frontend/src/static/js/v_authorship.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function initialState() {
filesSortType: 'lineOfCode',
toReverseSortFiles: true,
searchBarValue: '',
authorDisplayName: '',
};
}

Expand Down Expand Up @@ -155,7 +156,7 @@ window.vAuthorship = {
} else {
const author = repo.users.find((user) => user.name === this.info.author);
if (author) {
this.info.name = author.displayName;
this.authorDisplayName = author.displayName;
this.filesLinesObj = author.fileTypeContribution;
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/tabs/authorship.pug
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
) {{ info.repo }}
.author(v-if="!info.isMergeGroup")
span ↳  
span {{ info.name }} ({{ info.author }})
span {{ authorDisplayName }} ({{ info.author }})
.period
span ↳  
span {{ info.minDate }} to {{ info.maxDate }}    ({{ selectedFiles.length }} files changed)
Expand Down

0 comments on commit 451f11b

Please sign in to comment.