socialappslab / denguechat

Using mobile phones and gaming tactics to engage citizens in reporting public health risks
https://www.denguechat.org/
Other
0 stars 0 forks source link

The chatbox on the city page (or any other page) is not visible. #959

Closed cdparra closed 3 years ago

cdparra commented 3 years ago

This is most likely due to a long standing issue that emerged when we migrated to the new servers and, particularly, to the new salt based packaging. @yolile can comment on this migration if needed.

Summary of the problem: There are a few assets in the site that are never rails are not able to retrieve, even when they are properly compiled when the site is redeployed. I don't know why this happens.

This happens with the form to write a message in the forum. This is a haml template that is compiled app/assets/templates/posts/new_custom.html. Assets are correctly compiles and copied intopublic/assets/posts/new_custom-HASHCODE.html. However, the app keeps trying to retrieve public/assets/posts/new_custom.html (without the hashcode at the end of the name that rails adds

This is the list of assets that for some reason are not compiled and moved into the correct path:

  1. https://www.denguechat.org/assets/posts/new_custom.html
  2. https://www.denguechat.org/assets/posts/new.html

Current workaround is to manually copy the assets without the hashcode into public/assets/posts/

var newPostCustomDirective = function(){
  return {
    restrict: "E", // Restrict the template to being called only when using <feed-item> HTML element.
    templateUrl: "<%= asset_path('posts/new_custom.html') %>",
    link: function(scope, element, attrs) {
      scope.submitButtonDisabled = false;

      angular.element(element).find("textarea").atwho({
        at: "@",
        data: scope.usernames,
        limit: 5
      })

      angular.element(element).find("textarea").atwho({
        at: "#",
        data: scope.hashtags,
        limit: 5
      })
    }
  }
}

// Define the directives on the controller.
angular.module("denguechat.directives").directive("newPostCustom", newPostCustomDirective);

Estimated hours to develop: 10h

mitar commented 3 years ago

Could you change dockerfile to copy those assets?