Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre-Yves David
swh-web
Commits
6ec79bea
Commit
6ec79bea
authored
3 years ago
by
Jayesh
Browse files
Options
Downloads
Patches
Plain Diff
csrf post
parent
629cddbc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
assets/src/bundles/add_forge/request-dashboard.js
+18
-19
18 additions, 19 deletions
assets/src/bundles/add_forge/request-dashboard.js
swh/web/templates/add_forge_now/request-dashboard.html
+2
-12
2 additions, 12 deletions
swh/web/templates/add_forge_now/request-dashboard.html
with
20 additions
and
31 deletions
assets/src/bundles/add_forge/request-dashboard.js
+
18
−
19
View file @
6ec79bea
...
...
@@ -5,6 +5,8 @@
* See top-level LICENSE file for more information
*/
import
{
handleFetchError
,
csrfPost
}
from
'
utils/functions
'
;
export
function
onRequestDashboardLoad
(
requestId
)
{
populateRequestDetails
(
requestId
);
...
...
@@ -12,26 +14,23 @@ export function onRequestDashboardLoad(requestId) {
contactForgeAdmin
(
event
);
});
$
(
'
#updateRequestForm
'
).
submit
(
function
(
event
)
{
$
(
'
#updateRequestForm
'
).
submit
(
async
function
(
event
)
{
event
.
preventDefault
();
$
.
ajax
({
data
:
$
(
this
).
serialize
(),
type
:
$
(
this
).
attr
(
'
method
'
),
url
:
$
(
this
).
attr
(
'
action
'
),
success
:
function
(
response
)
{
$
(
'
#userMessage
'
).
text
(
'
The request status has been updated
'
);
$
(
'
#userMessage
'
).
removeClass
(
'
badge-danger
'
);
$
(
'
#userMessage
'
).
addClass
(
'
badge-success
'
);
populateRequestDetails
(
requestId
);
// FIXME, this is not upating the options list; maybe we should clear everything before re-populating
},
error
:
function
(
request
,
status
,
error
)
{
// FIXME, show error response from server
$
(
'
#userMessage
'
).
text
(
'
Sorry following error happened,
'
+
error
);
$
(
'
#userMessage
'
).
removeClass
(
'
badge-success
'
);
$
(
'
#userMessage
'
).
addClass
(
'
badge-danger
'
);
}
});
try
{
const
response
=
await
csrfPost
(
$
(
this
).
attr
(
'
action
'
),
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
},
$
(
this
).
serialize
());
handleFetchError
(
response
);
$
(
'
#userMessage
'
).
text
(
'
The request status has been updated
'
);
$
(
'
#userMessage
'
).
removeClass
(
'
badge-danger
'
);
$
(
'
#userMessage
'
).
addClass
(
'
badge-success
'
);
populateRequestDetails
(
requestId
);
// FIXME, this is not updating the options list; maybe we should clear everything before re-populating
}
catch
(
response
)
{
// const responseText = await response.json();
$
(
'
#userMessage
'
).
text
(
'
Sorry; Updating the request failed
'
);
$
(
'
#userMessage
'
).
removeClass
(
'
badge-success
'
);
$
(
'
#userMessage
'
).
addClass
(
'
badge-danger
'
);
}
});
}
...
...
This diff is collapsed.
Click to expand it.
swh/web/templates/add_forge_now/request-dashboard.html
+
2
−
12
View file @
6ec79bea
...
...
@@ -14,7 +14,7 @@ See top-level LICENSE file for more information
{% render_bundle 'add_forge' %}
{% endblock %}
{% block title %}
{{ heading }}
–
Software Heritage archive{% endblock %}
{% block title %}
Add forge request
–
Software Heritage archive{% endblock %}
{% block navbar-content %}
<h4>
Add forge now request dashboard
</h4>
...
...
@@ -63,16 +63,6 @@ See top-level LICENSE file for more information
<span
class=
"text-muted"
>
Request History
</span>
</h6>
<ul
class=
"list-group mb-3"
style=
"height: 100%;"
id=
"swh-request-history"
>
<!-- <li class="list-group-item d-flex justify-content-between lh-condensed"> -->
<!-- <div> -->
<!-- <h6 class="my-0"> Date</h6> -->
<!-- </div> -->
<!-- <div> -->
<!-- <span class="text-muted">Moderator</span> -->
<!-- </div> -->
<!-- <span class="text-muted">kkk</span> -->
<!-- </li> -->
</ul>
</div>
</div>
...
...
@@ -117,7 +107,7 @@ See top-level LICENSE file for more information
</div>
</div>
<div
class=
"form-group col-md-6"
>
<button
type=
"submit"
class=
"btn btn-
secondary
mb-2"
>
Submit your decision
</button>
<button
type=
"submit"
class=
"btn btn-
default
mb-2"
>
Submit your decision
</button>
</div>
<div
class=
"form-row"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment