mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-12 13:48:58 +02:00
fix: reload PR and Gist views when resource IDs change
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"core.min.js": "core.6332b3c288.min.js",
|
||||
"vendor.min.js": "vendor.8a52e2f74f.min.js",
|
||||
"vendor.min.js": "vendor.1f3b7f76c7.min.js",
|
||||
"mermaid.min.js": "mermaid.f848a72d16.min.js",
|
||||
"all.min.css": "all.99ce8f3e14.min.css"
|
||||
}
|
||||
|
||||
@@ -93,13 +93,13 @@ angular
|
||||
templateUrl: "/partials/pullRequest.htm",
|
||||
controller: "pullRequestController",
|
||||
title: "Anonymous pull request – Anonymous GitHub",
|
||||
reloadOnUrl: false,
|
||||
reloadOnSearch: false,
|
||||
})
|
||||
.when("/gist/:gistId/:path*?", {
|
||||
templateUrl: "/partials/gist.htm",
|
||||
controller: "gistController",
|
||||
title: "Anonymous gist – Anonymous GitHub",
|
||||
reloadOnUrl: false,
|
||||
reloadOnSearch: false,
|
||||
})
|
||||
.when("/r/:repoId/:path*?", {
|
||||
templateUrl: "/partials/explorer.htm",
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -91,6 +91,13 @@ describe("frontend production regressions", function () {
|
||||
expect(h.scope.repoId).to.equal("new-repo"); expect(h.scope.files).to.have.length(0);
|
||||
expect(h.requests.at(-1).url).to.equal("/api/repo/new-repo/options");
|
||||
});
|
||||
it("reloads PR and Gist controllers for new resource IDs", function () {
|
||||
const h = harness();
|
||||
for (const route of ["/pr/:pullRequestId/:path*?", "/gist/:gistId/:path*?"]) {
|
||||
expect(h.routes[route].reloadOnUrl).not.to.equal(false);
|
||||
expect(h.routes[route].reloadOnSearch).to.equal(false);
|
||||
}
|
||||
});
|
||||
it("finishes failed searches without letting canceled requests reset the next search", async function () {
|
||||
const h = explorer(); h.scope.fileSearchQuery = "old"; h.scope.onFileSearchChange(); const old = h.requests.at(-1);
|
||||
h.scope.fileSearchQuery = "new"; h.scope.onFileSearchChange(); const current = h.requests.at(-1);
|
||||
|
||||
Reference in New Issue
Block a user