Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion assets/js/common/contributions-lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ xtools.application.loadContributions = function (endpointFunc, apiTitle) {
endpoint = endpointFunc(params),
limit = parseInt(params.limit, 10) || 50,
urlParams = new URLSearchParams(window.location.search),
newUrl = xtBaseUrl + endpoint + '/' + xtools.application.vars.offset,
// T403566 : Something, we have yet to figure where, replaces consecutive slashes in urls with single slashes
// That causes crashes in pages & globalcontribs
// This '-' is only a hack to prevent crashes
newUrl = (xtBaseUrl + endpoint + '/' + xtools.application.vars.offset)
.replaceAll(/\/(?=\/)/g, "/-"),
oldToolPath = location.pathname.split('/')[1],
newToolPath = newUrl.split('/')[1];

Expand Down
2 changes: 2 additions & 0 deletions public/build/app.06e079ab.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions public/build/app.a7ec0e72.js

This file was deleted.

2 changes: 1 addition & 1 deletion public/build/entrypoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"js": [
"/build/runtime.c217f8c4.js",
"/build/852.96913092.js",
"/build/app.a7ec0e72.js"
"/build/app.06e079ab.js"
],
"css": [
"/build/app.7692d209.css"
Expand Down
2 changes: 1 addition & 1 deletion public/build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"build/app.css": "/build/app.7692d209.css",
"build/app.js": "/build/app.a7ec0e72.js",
"build/app.js": "/build/app.06e079ab.js",
"build/runtime.js": "/build/runtime.c217f8c4.js",
"build/852.96913092.js": "/build/852.96913092.js",
"build/images/VPS-badge.svg": "/build/images/VPS-badge.svg",
Expand Down
14 changes: 7 additions & 7 deletions src/Controller/GlobalContribsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ public function getGlobalContribs(
* name="GlobalContribsResult",
* requirements={
* "username"="(ipr-.+\/\d+[^\/])|([^\/]+)",
* "namespace"="|all|\d+",
* "start"="|\d*|\d{4}-\d{2}-\d{2}",
* "end"="|\d{4}-\d{2}-\d{2}",
* "offset"="|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z?",
* "namespace"="|\-|all|\d+",
* "start"="|\-|\d*|\d{4}-\d{2}-\d{2}",
* "end"="|\-|\d{4}-\d{2}-\d{2}",
* "offset"="|\-|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z?",
* },
* defaults={
* "namespace"="all",
Expand Down Expand Up @@ -172,9 +172,9 @@ public function resultsAction(
* requirements={
* "username"="(ipr-.+\/\d+[^\/])|([^\/]+)",
* "namespace"="|all|\d+",
* "start"="|\d*|\d{4}-\d{2}-\d{2}",
* "end"="|\d{4}-\d{2}-\d{2}",
* "offset"="|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z?",
* "start"="|\-|\d*|\d{4}-\d{2}-\d{2}",
* "end"="|\-|\d{4}-\d{2}-\d{2}",
* "offset"="|\-|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z?",
* },
* defaults={
* "namespace"="all",
Expand Down
8 changes: 4 additions & 4 deletions src/Controller/PagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ protected function setUpPages(PagesRepository $pagesRepo, string $redirects, str
* "username" = "(ipr-.+\/\d+[^\/])|([^\/]+)",
* "namespace"="|all|\d+",
* "redirects"="|[^/]+",
* "deleted"="|all|live|deleted",
* "start"="|\d{4}-\d{2}-\d{2}",
* "end"="|\d{4}-\d{2}-\d{2}",
* "offset"="|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z?",
* "deleted"="|\-|all|live|deleted",
* "start"="|\-|\d{4}-\d{2}-\d{2}",
* "end"="|\-|\d{4}-\d{2}-\d{2}",
* "offset"="|\-|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z?",
* },
* defaults={
* "namespace"=0,
Expand Down
13 changes: 7 additions & 6 deletions src/Model/GlobalContribs.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class GlobalContribs extends Model
* @param EditRepository $editRepo
* @param User $user
* @param string|int|null $namespace Namespace ID or 'all'.
* @param false|int $start As Unix timestamp.
* @param false|int $end As Unix timestamp.
* @param false|int $offset As Unix timestamp.
* @param false|string|int $start As Unix timestamp.
* @param false|string|int $end As Unix timestamp.
* @param false|string|int $offset As Unix timestamp.
* @param int|null $limit Number of results to return.
*/
public function __construct(
Expand All @@ -58,9 +58,10 @@ public function __construct(
$this->editRepo = $editRepo;
$this->user = $user;
$this->namespace = '' == $namespace ? 0 : $namespace;
$this->start = $start;
$this->end = $end;
$this->offset = $offset;
// see T403566 for the '-' mess
$this->start = '-' == $start ? false : $start;
$this->end = '-' == $end ? false : $end;
$this->offset = '-' == $offset ? false : $offset;
$this->limit = $limit ?? self::PAGE_SIZE;
}

Expand Down
12 changes: 6 additions & 6 deletions src/Model/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class Pages extends Model
* @param string|int $namespace Namespace ID or 'all'.
* @param string $redirects One of the Pages::REDIR_ constants.
* @param string $deleted One of the Pages::DEL_ constants.
* @param int|false $start Start date as Unix timestamp.
* @param int|false $end End date as Unix timestamp.
* @param int|false $offset Unix timestamp. Used for pagination.
* @param int|string|false $start Start date as Unix timestamp.
* @param int|string|false $end End date as Unix timestamp.
* @param int|string|false $offset Unix timestamp. Used for pagination.
*/
public function __construct(
PagesRepository $repository,
Expand All @@ -61,11 +61,11 @@ public function __construct(
$this->project = $project;
$this->user = $user;
$this->namespace = 'all' === $namespace ? 'all' : (int)$namespace;
$this->start = $start;
$this->end = $end;
$this->start = '-' == $start ? false : $start;
$this->end = '-' == $end ? false : $end;
$this->offset = '-' == $offset ? false : $offset;
$this->redirects = $redirects ?: self::REDIR_NONE;
$this->deleted = $deleted ?: self::DEL_ALL;
$this->offset = $offset;
}

/**
Expand Down
11 changes: 10 additions & 1 deletion templates/pages/_pages_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,16 @@
{##### PAGINATION #####}
{% if not(pages.multiNamespace) and pages.results[pages.namespaces[0]]|length == pages.resultsPerPage %}
<div class="contributions-nav clearfix">
<a href="{{ path('PagesResult', {project: project.domain, username: user.usernameIdent, namespace: pages.namespace, redirects: pages.redirects, deleted: pages.deleted, start: pages.startDate, end: pages.endDate, offset: pages.lastTimestamp}) }}" class="pull-right contributions--next">
<a href="{{ path('PagesResult', {
project: project.domain,
username: user.usernameIdent,
namespace: pages.namespace,
redirects: pages.redirects,
deleted: pages.deleted,
start: (pages.startDate ? pages.startDate : '-'),
end: (pages.endDate ? pages.endDate : '-'),
offset: (pages.lastTimestamp ? pages.lastTimestamp : '-')
}) }}" class="pull-right contributions--next">
{{ msg('pager-older-n', [pages.resultsPerPage])|ucfirst }}
<span class="glyphicon glyphicon-arrow-{% if isRTL() %}left{% else %}right{% endif %}"></span>
</a>
Expand Down
Loading