Skip to content

Redesign: remove gcalendar warning#10999

Merged
ferblape merged 7 commits intofeature/redesignfrom
feature/redesign-add-calendar-warning
Jun 22, 2023
Merged

Redesign: remove gcalendar warning#10999
ferblape merged 7 commits intofeature/redesignfrom
feature/redesign-add-calendar-warning

Conversation

@Crashillo
Copy link
Copy Markdown
Contributor

@Crashillo Crashillo commented Jun 13, 2023

🎩 What? Why?

Use the data-external-link=false directive for the google calendar link. Refactor of the external_domain_warning file to get rid of jquery besides simplification of the logic

📌 Related Issues

📷 Screenshots

https://decidim-redesign.populate.tools/processes/Decidim4Dummies/f/168/meetings/1810

♥️ Thank you!

@Crashillo Crashillo added the project: redesign Barcelona City Council contract label Jun 13, 2023
@Crashillo Crashillo requested review from ferblape and furilo June 13, 2023 15:38
@furilo furilo requested a review from a team June 15, 2023 07:16
@ferblape ferblape requested a review from a team June 15, 2023 08:53
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

LGTM
image

document.querySelectorAll(".new_report").forEach((container) => changeReportFormBehavior(container))

updateExternalDomainLinks($("body"))
document.querySelectorAll("a").forEach((elem) => updateExternalDomainLinks(elem))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After #10967 will be merged, this line needs to be checked. In index.js we already have a snippet like:

  document.querySelectorAll("a[target=\"_blank\"]:not([data-external-domain-link=\"false\"])").forEach((elem) => new ExternalDomainLink(elem))

Also, this line is different from the one in redesigned_index.js

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's different due to the backwards compatibility, since I changed the updateExternalDomainLinks function input arguments.
In the redesigned_index, what I did was merging both snippets into a single one, that is, if some link doesn't contain data-external-link=false, then it applies the external-domain-warning also. I believe both functions are closely related, and perhaps we can save on a data-attribute,

Thoughts? cc/ @andreslucena

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know what you mean, as I also have the doubt while working on #10121.

As long as it works as it should (ie we should not show the external domain warning if a domain is whitelisted), it sounds good to me to reuse the same selector logic.

export default function updateExternalDomainLinks($target) {
const whitelist = window.Decidim.config.get("external_domain_whitelist") || []

export default function updateExternalDomainLinks(element) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Renamed to ExternalDomainLink back into #10121.
When #10967 will be merged, this will cause issues.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, we annotate this, when the sync is merged we'll take care of fixing.

@ferblape ferblape merged commit c45e618 into feature/redesign Jun 22, 2023
@ferblape ferblape deleted the feature/redesign-add-calendar-warning branch June 22, 2023 07:58
entantoencuanto added a commit that referenced this pull request Jun 23, 2023
* feature/redesign: (26 commits)
  Use the component name in the sidebar title (#11088)
  Redesign: layout center (#11068)
  Redesign: display only public users followings in following profile tab (#11051)
  Redesign: fix cards (#11072)
  Redesign: remove gcalendar warning (#10999)
  lock sass-embedded (#11077)
  Redesign: scopes picker (#11039)
  Redesign: pending notifications (#10926)
  Redesign: change the filters style (#11049)
  Redesign: secondary actions (#11067)
  Redesign: assembly members page (#10992)
  Redesign: update default static map size to 300px (#10953)
  Redesign: visual placeholder cards (#11038)
  Redesign: fix emoji popup position (#10957)
  Redesign: enable REDESIGN_ENABLED on ParticipatoryProcesses (#10983)
  Redesign: opinion buttons (#10998)
  Display a disabled message button in public profile if user blocks them instead of hidding it (#10984)
  Redesign: confirm modal Foundation-free (#10978)
  Redesign: initiatives (#10646)
  Redesign: surveys (#10922)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

project: redesign Barcelona City Council contract

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Meetings: The google calendar link is displaying the external link warning

6 participants