Git Product home page Git Product logo

Comments (9)

andrewroberts avatar andrewroberts commented on September 16, 2024

Thanks for flagging this up. I've reproduced the error - you need to have initiated the auth-flow first - so I'll update the test code to show this.

from trelloapp.

andrewroberts avatar andrewroberts commented on September 16, 2024

I've updated the README code - see if that works for you now.

from trelloapp.

kurzendoerfer avatar kurzendoerfer commented on September 16, 2024

Thanks. Now what seems to be happening is that I'm constantly asked to authorize. (Screen shot attached). However, a card is never created. I thought it may be helpful if you understood the business requirements I'm trying to meet. I'd like to have a simple Google Form that any one of 20,000 customers can use to submit feedback.

I'd like to capture that inbound feedback in a Trello card that lands in an Inbox list on a privately managed team board so that in can be organized and prioritized appropriately.

function test_createCard() {

  try {
     var trelloApp = new TrelloApp.App()
     trelloApp.getMyBoards().some(function(board) {
       if (board.getName() === 'Kevin-Test Board') {
       var foundList = trelloApp.getBoardLists(board.getId()).some(function(list) {
        if (list.getName() === 'Inbox') {
          trelloApp.createCard({
            name: 'test card 3', 
            idList: list.getId(),
          }) 
          return true
        }
      }) 
      return foundList
    }
  })
  } catch (error) {
    if (error.name === 'AuthorizationError') {
      // This is a special error thrown by TrelloApp to indicate
      // that user authorization is required    
      showAuthorisationDialog()
    } else {
      throw error
    }
  }
  return

  // Private Functions
  // -----------------

  function showAuthorisationDialog() {

    var authorizationUrl = trelloApp.getAuthorizationUri()

    Dialog.show(
      'Opening authorization window...', 
        'Follow the instructions in this window, close ' + 
        'it and then try the action again. ' + 
        '<br/><br/>Look out for a warning that ' + 
        'your browser has blocked the authorisation pop-up from Trello. ' + 
        '<script>window.open("' + authorizationUrl + '")</script>',
      160)

  } // showAuthorisationDialog()

  function reset() {
  new TrelloApp.App().reset()
}
} 

screen shot 2016-03-16 at 10 04 16 am

from trelloapp.

andrewroberts avatar andrewroberts commented on September 16, 2024

When you click the link do you get the Trello auth window?

I'm not sure why the auth wouldn't stick. I've created this sheet with your code in (I've made reset() global and just log the boards for now) and ran it on a couple of accounts OK.

We could do a hangout if you like ([email protected]) and you could walk me through what you are seeing.

from trelloapp.

bennettscience avatar bennettscience commented on September 16, 2024

I'm getting the same error. I see the authorization screen, but when I authorize, the Trello window never pops up. I don't see a popup blocked anywhere. However, Apps Script displays, ScriptApp.getProjectKey is deprecated. Could it be a problem in the library?

from trelloapp.

andrewroberts avatar andrewroberts commented on September 16, 2024

The project key message shouldn't be an issue as I'm getting it on other scripts that still work fine. I do remember the code was very sensitive to you being logged into other Google accounts on the PC, so you could check that. Also check in the execution log for any errors.

from trelloapp.

goizueta avatar goizueta commented on September 16, 2024

I also came across this error. The console on the verification page was showing

Refused to display 'https://trello.com/1/OAuthAuthorizeToken?scope=read,write&oauth_token...'
in a frame because it set 'X-Frame-Options' to 'Deny'.

But if you just paste that URL into a new tab and visit it, the verification goes through just fine.

from trelloapp.

goizueta avatar goizueta commented on September 16, 2024

After digging a little deeper, I suspect that this is caused by restrictions in HTMLService that cause the template to be rendered in an iframe.

I wrote a quick workaround ^^ that just opens the link in a new window. That should do the trick until anyone wants to invest time in a more elegant solution.

from trelloapp.

andrewroberts avatar andrewroberts commented on September 16, 2024

Thanks for looking into this and provdiing your solution. I've merged your
pull request.

On 17 October 2016 at 21:50, goizueta [email protected] wrote:

After digging a little deeper, I suspect that this is caused by restrictions
in HTMLService
https://developers.google.com/apps-script/guides/html/restrictions that
cause the template to be rendered in an iframe.

I wrote a quick workaround ^^ that just opens the link in a new window.
That should do the trick until anyone wants to invest time in a more
elegant solution.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEfL3YLWpq3qP1iYiheyLVFkVBJCQuhoks5q09-JgaJpZM4HxRvv
.

from trelloapp.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.