ejplatform / ej-server

EJ uses gamification and machine learning to promote discussions and participation in a virtual democracy
https://ejplatform.github.io/ej-server/
Other
38 stars 17 forks source link

[REVIEW] Update web-share.js import #579

Closed MatheusRich closed 5 years ago

MatheusRich commented 5 years ago

Descrição

Atualiza a importação do arquivo de Web Share.

Como citado aqui, há alguma limitações:

To use the Web Share API:

  • you must be served over HTTPS
  • you can only invoke the API in response to a user action, such as a click (e.g., you can't call navigator.share as part of the page load)
  • you can also share any URL, not just URLs under your website's current scope: and you may also share text without a URL
  • you should feature-detect it in case it's not available on your users' platform (e.g., via navigator.share !== undefined)"

Issues Relacionadas

resolves #457

Checklist

codecov[bot] commented 5 years ago

Codecov Report

Merging #579 into develop will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #579   +/-   ##
========================================
  Coverage    73.42%   73.42%           
========================================
  Files          123      123           
  Lines         3228     3228           
  Branches       352      352           
========================================
  Hits          2370     2370           
  Misses         750      750           
  Partials       108      108
Impacted Files Coverage Δ
src/ej/services/postgres.py 71.42% <0%> (ø) :arrow_up:
src/ej/services/__init__.py 83.33% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5e860a2...99e7d52. Read the comment docs.

fabiolamfleury commented 5 years ago

Da forma que está implementando, então ainda não será possível testar o compartilhamento, já que o servidor do dev está em http e isso só funciona em https?

ricardopoppi commented 5 years ago

@MatheusRich tem alguma outra opção de teste antes da gente aceitar?

Outra opção @fabiolamfleury, já que o servidor em prod tem https e por enquanto não temos no ambiente de homologação, acho que podemos aceitar esse PR e qdo fizermos a release testamos direto em prod. Sei que não é o ideal, mas é o que temos pro momento, o que acha?

fabiolamfleury commented 5 years ago

@ricardopoppi consegui testar simulando https localmente, conforme aqui demonstrado: https://github.com/teddziuba/django-sslserver

imagem

Conferindo o link foi copiado corretamente, vou aceitar o PR :)

ricardopoppi commented 5 years ago

@fabiolamfleury sensacional!

MatheusRich commented 5 years ago

@ricardopoppi Infelizmente eu desconheço alguma maneira de testar isso. Tecnicamente rodando no localhost (dev) seria possível testar, mas eu acho que não há componentes nativos para desktop. Essa funcionalidade é pensada para dispositivos móveis, desta forma teria que ser acessado via algum celular num domínio HTTPS.

@fabiolamfleury O comportamento que você observou é o padrão para quando a API Share não está disponível. Infelizmente sem HTTPS em homologação não é possível testar.