Skip to content

Commit

Permalink
Include fix to truncate app names
Browse files Browse the repository at this point in the history
  • Loading branch information
dividehex committed Jun 21, 2023
1 parent 44db40f commit 9c25636
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
GAR_LOCATION: us-east1
PROJECT_ID: iam-auth0
REGION: us-east1
CHANNEL_IDS: G01AC4VU4UV
CHANNEL_IDS: C05AMLCL4JX
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN}}

jobs:
Expand Down
7 changes: 7 additions & 0 deletions dashboard/op/yaml_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def _load_data(self):
def _render_data(self):
for app in self.apps["apps"]:
app["application"]["alt_text"] = app["application"]["name"]
app["application"]["name"] = self._truncate(app["application"]["name"])

def _alphabetize(self):
self.apps["apps"].sort(key=lambda a: a["application"]["name"].lower())
Expand All @@ -46,6 +47,12 @@ def _has_vanity(self, app):
except Exception:
return False

def _truncate(self, app_name):
"""If name is longer than allowed 18 chars truncate the name."""
app_name = (app_name[:16] + "..") if len(app_name) > 18 else app_name

return app_name

def vanity_urls(self):
redirects = []
for app in self.apps["apps"]:
Expand Down
Loading

0 comments on commit 9c25636

Please sign in to comment.