Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use URL reversing (2) #7815

Closed
etj opened this issue Jul 16, 2021 · 0 comments
Closed

Use URL reversing (2) #7815

etj opened this issue Jul 16, 2021 · 0 comments
Assignees
Labels
enhancement frontend Issues regarding Frontend and styling
Milestone

Comments

@etj
Copy link
Contributor

etj commented Jul 16, 2021

Continuation of #7740 (closed), here some more hardcoded URL:

https://github.com/GeoNode/geonode/blob/3.2.1/geonode/static/geonode/js/upload/LayerInfo.js#L493

    LayerInfo.prototype.startPolling = function() {
        var self = this;
        if (self.polling) {
>>>         $.ajax({ url: updateUrl(siteUrl + "upload/progress", 'id', self.id), type: 'GET', success: function(data){
                // TODO: Not sure we need to do anything here?
                //console.log('polling');
            }, dataType: "json", complete: setTimeout(function() {self.startPolling()}, 3000), timeout: 30000 });
        }

https://github.com/GeoNode/geonode/blob/3.2.1/geonode/static/geonode/js/upload/srs.js#L86

      var params = common.parseQueryString(document.location.search);
>>>   var url = siteUrl + 'upload/srs'

https://github.com/GeoNode/geonode/blob/3.2.1/geonode/static/geonode/js/upload/upload.js#L196

    doSrs = function (event) {
        var form = $("#srsForm")
        $.ajax({
           type: "POST",
           mode: "queue",
>>>        url: siteUrl + 'upload/srs',
           data: form.serialize(), // serializes the form's elements.
           success: function(data)

https://github.com/GeoNode/geonode/blob/3.2.1/geonode/services/templates/services/service_remove.html#L13

<div class="row">
  <div class="col-md-12">
    <p class="lead">{% trans "Are you sure you want to remove"  %} <strong>{{ service.name }}</strong>?</p>
>>> <form action="/services/{{service.id}}/remove" method="POST" class="inline">
      {% csrf_token %}
      <input type="hidden" value="{{next}}" id="next" name="next">
      <div class="form-actions">

Many lines in https://github.com/GeoNode/geonode/blame/3.2.1/geonode/upload/utils.py:

320:  'redirect_to': f"{settings.SITEURL}upload/check?id={import_session.id}{_force_ajax}",
345:  'redirect_to': f"{settings.SITEURL}upload/time?id={import_session.id}{_force_ajax}",
356:  'redirect_to': f"{settings.SITEURL}upload/mosaic?id={import_session.id}{_force_ajax}",
367:  'redirect_to': f"{settings.SITEURL}upload/srs?id={import_session.id}{_force_ajax}",
378:  'redirect_to': f"{settings.SITEURL}upload/csv?id={import_session.id}{_force_ajax}",

https://github.com/GeoNode/geonode/blob/3.2.1/geonode/upload/views.py#L614

                return json_response(
                    {
                        'status': 'pending',
                        'success': True,
                        'id': import_session.id,
>>>                     'redirect_to': f"/upload/final?id={import_session.id}{force_ajax}"
                    }
etj added a commit to etj/geonode that referenced this issue Jul 19, 2021
etj added a commit to etj/geonode that referenced this issue Jul 19, 2021
etj added a commit to etj/geonode that referenced this issue Jul 19, 2021
etj added a commit to etj/geonode that referenced this issue Jul 19, 2021
@afabiani afabiani added enhancement frontend Issues regarding Frontend and styling labels Jul 27, 2021
@afabiani afabiani added this to the 3.2.2 milestone Jul 27, 2021
@afabiani afabiani modified the milestones: 3.2.2, 3.2.3 Dec 2, 2021
@afabiani afabiani modified the milestones: 3.2.3, 3.2.4 Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement frontend Issues regarding Frontend and styling
Projects
None yet
Development

No branches or pull requests

2 participants