Skip to content

Commit

Permalink
better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
billyc committed Jan 28, 2022
1 parent 91ff514 commit 245bab4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/views/FolderBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@click="openOutputFolder(folder)")
p
i.fa.fa-folder-open
|  {{ folder }}
|  {{ cleanName(folder) }}

topsheets-finder(:fileSystemConfig="myState.svnProject" :subfolder="xsubfolder" :files="myState.files")

Expand Down Expand Up @@ -63,7 +63,7 @@
.file-table
.file(:class="{fade: myState.isLoading}"
v-for="file in myState.files" :key="file")
a(:href="`${myState.svnProject.baseURL}/${myState.subfolder}/${file}`") {{ file }}
a(:href="`${myState.svnProject.baseURL}/${myState.subfolder}/${file}`") {{ cleanName(file) }}

</template>

Expand Down Expand Up @@ -143,6 +143,10 @@ export default class VueComponent extends Vue {
summary: false,
}
private cleanName(text: string) {
return decodeURIComponent(text)
}
private getFileSystem(name: string) {
const svnProject: FileSystemConfig[] = globalStore.state.svnProjects.filter(
(a: FileSystemConfig) => a.slug === name
Expand Down Expand Up @@ -543,6 +547,7 @@ h4 {
margin: 0.25rem 0rem;
padding: 0.75rem 1rem;
border-radius: 8px;
word-wrap: break-word;
}
.folder:hover {
Expand Down
13 changes: 11 additions & 2 deletions src/views/TabbedDashboardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
@navigate="onNavigate"
)

p.load-error: b {{ loadErrorMessage }}

</template>

<script lang="ts">
Expand Down Expand Up @@ -61,7 +63,7 @@ export default class VueComponent extends Vue {
private allConfigFiles: YamlConfigs = { dashboards: {}, topsheets: {}, vizes: {} }
private isZoomed = false
private loadErrorMessage = ''
private pageHeader = ''
private mounted() {
Expand Down Expand Up @@ -103,6 +105,7 @@ export default class VueComponent extends Vue {
}
private async findDashboards() {
this.loadErrorMessage = ''
if (!this.fileApi) return []
try {
Expand All @@ -122,7 +125,8 @@ export default class VueComponent extends Vue {
this.activeTab = Object.keys(this.dashboards)[0]
} catch (e) {
// Bad things happened! Tell user
console.error({ eeee: e })
console.warn({ eeee: e })
this.loadErrorMessage = this.fileSystemConfig.baseURL + ': Could not load'
}
}
Expand Down Expand Up @@ -277,6 +281,11 @@ li.is-not-active b a {
color: var(--linkHover);
}
.load-error {
margin-top: 2rem;
text-align: center;
}
@media only screen and (max-width: 50em) {
}
</style>

0 comments on commit 245bab4

Please sign in to comment.