Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

Adding embed snippet to Thimble publishing dialog Error #1543 #2535

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

Fatehsandhu
Copy link

Fixing issue #1543 , Can I get some feedback please

Copy link
Contributor

@gideonthomas gideonthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting started on this @Fatehsandhu, I added a couple of comments.

I assume you want to get the content in first before styling it as shown in the issue?

@@ -83,7 +83,7 @@ echo "Setting up login.webmaker.org"
cd login.webmaker.org
cp env.sample .env
sudo npm install --no-bin-links --loglevel=error # sudo needed for bcrypt permissions
cd ..
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you def need this back

@@ -83,7 +83,7 @@ echo "Setting up login.webmaker.org"
cd login.webmaker.org
cp env.sample .env
sudo npm install --no-bin-links --loglevel=error # sudo needed for bcrypt permissions
cd ..
sudo npm install --no-bin-links || sudo npm install --no-bin-links
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove this and file as a follow-up issue.

@@ -94,6 +94,7 @@ navToggleAutoUpdateLabel=Auto
# Publishing
publishHeader=Publish your Project
publishShareLink=Here's a link you can share...
publishEmbedLinkTitle=Copy this code into your HTML page to show off your project.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this change in locales/en-US not locales/en-GB

<p>{{ gettext("publishShareLink") }}</p>
<div id="publish-link">
<a id="link-publish-link" title="{{ gettext("publishShareLinkTitle") }}" target="_blank" href="test"></a>
</div>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the trailing spaces

@@ -16,10 +16,17 @@
</div>

<div id="publish-live" class="hide">

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the trailing spaces

<p>{{ gettext("publishShareLink") }}</p>
<div id="publish-link">
<a id="link-publish-link" title="{{ gettext("publishShareLinkTitle") }}" target="_blank" href="test"></a>
</div>

<!-- Embed iFrame -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the extra leading spaces before the comment so that it aligns with the tag

</div>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo this change

@@ -29,9 +36,9 @@

<div id="publish-details">
<label>{{ gettext("publishProjectDescription") }}</label>
<textarea class="publish-description" placeholder="{{ gettext("publishProjectDescriptionPlaceholder") }}"></textarea>
<textarea class="publish-description" placeholder="{{ gettext("publishProjectDescriptionPlaceholder") }}"></textarea>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo this change


<!-- Embed iFrame -->
<p>{{ gettext("publishEmbedLinkTitle") }}</p>
<div id="publish-link">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you cannot use the same id here as another element. Change this to publish-embed.

<!-- Embed iFrame -->
<p>{{ gettext("publishEmbedLinkTitle") }}</p>
<div id="publish-link">
<span>&lt;iframe {{ gettext("PUBLISHED_PROJECTS_HOSTNAME") }} &gt; </span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why "PUBLISHED_PROJECTS_HOSTNAME" would be used here.
Instead, leave the text empty and dynamically change the text with JS instead:

  1. Add a property here called embed that is a jquery object linking to this span.
  2. After this line set the text of embed to be the string `<iframe src={$publishUrl}></iframe>`

@Fatehsandhu
Copy link
Author

@gideonthomas thank you, much appreciated. I will get on those ASAP.

@Fatehsandhu
Copy link
Author

Fatehsandhu commented Nov 22, 2017

@gideonthomas My code isn't compiling for some reason, can I please get some help?
thanks

@@ -33,10 +33,11 @@ function Publisher() {
update: $("#publish-button-update"),
unpublish: $("#publish-button-unpublish"),
parent: $("#publish-buttons"),
indexMessage: $("#no-index")
indexMessage: $("#no-index"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have a stray comma here. The last element in a list like this shouldn't get a dangling comma.

@@ -313,7 +314,8 @@ Publisher.prototype.updateDialog = function(publishUrl, allowUnpublish) {
var published = this.dialog.published;
var unpublishBtn = this.dialog.buttons.unpublish;
var unpublish = this.handlers.unpublish;


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unhappy with this line for some reason. What happens if you remove this blank line?

@humphd
Copy link
Contributor

humphd commented Nov 22, 2017

/home/travis/build/mozilla/thimble.mozilla.org/public/editor/scripts/ui/publisher.js

   36:35  error  Delete `,`     prettier/prettier

  317:1   error  Delete `····`  prettier/prettier

✖ 2 problems (2 errors, 0 warnings)

  2 errors, 0 warnings potentially fixable with the `--fix` option.

I left some comments in the code. These are styling issues.

@Fatehsandhu
Copy link
Author

@humphd Thanks a lot for the help

Copy link
Contributor

@gideonthomas gideonthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs a little bit more work @Fatehsandhu, but it's getting there.

@@ -84,6 +84,7 @@ cd login.webmaker.org
cp env.sample .env
sudo npm install --no-bin-links --loglevel=error # sudo needed for bcrypt permissions
cd ..
sudo npm install --no-bin-links || sudo npm install --no-bin-links
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fatehsandhu, please undo this change

@@ -313,7 +314,7 @@ Publisher.prototype.updateDialog = function(publishUrl, allowUnpublish) {
var published = this.dialog.published;
var unpublishBtn = this.dialog.buttons.unpublish;
var unpublish = this.handlers.unpublish;

published.embed.text("<iframe src={$publishUrl}></iframe>");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be:

published.embed.text(`<iframe src=${publishUrl}></iframe>`);

Note the use of ` instead of "

@@ -41,4 +46,4 @@ <h1>{{ gettext("publishHeader") }}</h1>
<div id="publish-button-publish">{{ gettext("publishBtn") }}</div>
</div>
</div>
{% endblock %}
{% endblock %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line after this

@@ -36,7 +36,8 @@ function Publisher() {
indexMessage: $("#no-index")
},
description: $("#publish-details > textarea.publish-description"),
publishHeader: $(".content > h1"),
embed: $("#link-publish-embed"),

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this blank line


<p>{{ gettext("publishEmbedLinkTitle") }}</p>
<div id="link-publish-embed">
<span id="link-publish-link"></span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why you need this span, you don't use it anywhere.

@gideonthomas
Copy link
Contributor

@Fatehsandhu, can you rebase your branch onto master?

@gideonthomas
Copy link
Contributor

@Fatehsandhu, it looks like the rebase didn't work correctly. I still see commits from master in this PR. Would you be able to only cherry-pick your commits onto master?

@Fatehsandhu
Copy link
Author

@gideonthomas I am not sure how to do that correctly.

@gideonthomas
Copy link
Contributor

Hmm, I'm not actually sure how this branch got into this state since it looks like none of your code is in this branch anymore. Maybe @humphd might be able to help you here.

@humphd
Copy link
Contributor

humphd commented Jan 4, 2018

@Fatehsandhu can you tell me which of the 29 commits in here contain your fix? If I know that, I can guide you through the process to fix this.

@Fatehsandhu
Copy link
Author

@humphd commit #25abc0f was good.

@humphd
Copy link
Contributor

humphd commented Jan 4, 2018

@Fatehsandhu I'm confused, you're saying 25abc0f is your fix? That seems wrong to me. Am I misunderstanding?

@Fatehsandhu
Copy link
Author

@humphd No, sorry I meant to say that I had made all the changes up until that commit. Sorry, I don't have all the changes in one pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants