Skip to content

Commit

Permalink
limiting sheet name length
Browse files Browse the repository at this point in the history
  • Loading branch information
emre2038 authored and milafrerichs committed Mar 5, 2021
1 parent f4cd36f commit 731d138
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/js/profile/profile_header.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ let geography = null;
const breadcrumbClass = '.breadcrumb';
const locationDescriptionClass = '.location__description';

const SHEETNAME_CHAR_LIMIT = 31;

export class Profile_header extends Observable {
constructor(_parents, _geometries, _api, _profileId, _geography) {
super();
Expand Down Expand Up @@ -135,7 +137,8 @@ export class Profile_header extends Observable {
}

downloadPointData = (category) => {
const sheetName = category.label;
const suffix = '...';
const sheetName = category.label.length > SHEETNAME_CHAR_LIMIT ? category.label.substring(0, SHEETNAME_CHAR_LIMIT - suffix.length) + suffix : category.label;
const fileName = 'Export-' + category.label + '.xlsx';
this.getAddressPoints(category)
.then((points) => {
Expand Down

0 comments on commit 731d138

Please sign in to comment.