Skip to content

Commit

Permalink
Fix encode/decode URI
Browse files Browse the repository at this point in the history
k1LoW committed Dec 16, 2016
1 parent f9dd9af commit 631d8e4
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dist/index.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ riot.route('/projects/*', (project) => {
return -1 * parseInt(error.count, 10);
});
riot.mount('app', 'errors', {
project: project,
project: decodeURIComponent(project),
errors: sorted,
moment: moment,
req: req,
6 changes: 3 additions & 3 deletions src/tags/errors.tag
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
<table class="table projects-errors">
<tbody>
<tr each="{ error, i in opts.errors }">
<td><a href="#/projects/{ error.project }/{ encodeURIComponent(error.message) }">{ error.message }</a></td>
<td><a href="#/projects/{ encodeURIComponent(error.project) }/{ encodeURIComponent(error.message) }">{ error.message }</a></td>
<td>{ error.type }</td>
<td><span class="tag is-danger is-small">{ error.count }</span></td>
<td>{ moment(error.lastUpdated).fromNow() }</td>
@@ -59,7 +59,7 @@
const message = e.item.error.message;
e.item.error.isLoading = true;
self.update();
req.patch('/projects/' + project + '/errors/' + encodeURIComponent(message), {
req.patch('/projects/' + encodeURIComponent(project) + '/errors/' + encodeURIComponent(message), {
status: status
})
.then((res) => {
@@ -89,7 +89,7 @@
}
e.item.error.isLoading = true;
self.update();
req.delete('/projects/' + project + '/errors/' + encodeURIComponent(message))
req.delete('/projects/' + encodeURIComponent(project) + '/errors/' + encodeURIComponent(message))
.then((res) => {
alert('"' + message + '" has been deleted');
location.reload();
2 changes: 1 addition & 1 deletion src/tags/overview.tag
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<section class="section">
<nav class="level">
<p class="level-item">
- <a class="link is-info" href="?status=unresolved#/projects/{ opts.project }">{ opts.project }</a>
- <a class="link is-info" href="?status=unresolved#/projects/{ encodeURIComponent(opts.project) }">{ opts.project }</a>
</p>
</nav>

2 changes: 1 addition & 1 deletion src/tags/projects.tag
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
<table class="table projects">
<tbody>
<tr each="{ project, i in opts.projects }">
<td><a href="?status=unresolved#/projects/{ project.name }">{ project.name }</a></td>
<td><a href="?status=unresolved#/projects/{ encodeURIComponent(project.name) }">{ project.name }</a></td>
<td class="has-text-right">
<a class={ button: true, btn-delete: true, is-small: true, is-loading: project.isLoading } onclick={ delete }>
<span class="icon is-small">

0 comments on commit 631d8e4

Please sign in to comment.