From 704a5f4cabfb3dfc6ef0a295e8cf0844b1a744cb Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 20 Nov 2024 10:49:44 +0100 Subject: [PATCH] DEV: converts insert-hyperlink to gjs (#29841) --- ...sert-hyperlink.js => insert-hyperlink.gjs} | 86 +++++++++++++++++++ .../app/components/modal/insert-hyperlink.hbs | 74 ---------------- 2 files changed, 86 insertions(+), 74 deletions(-) rename app/assets/javascripts/discourse/app/components/modal/{insert-hyperlink.js => insert-hyperlink.gjs} (60%) delete mode 100644 app/assets/javascripts/discourse/app/components/modal/insert-hyperlink.hbs diff --git a/app/assets/javascripts/discourse/app/components/modal/insert-hyperlink.js b/app/assets/javascripts/discourse/app/components/modal/insert-hyperlink.gjs similarity index 60% rename from app/assets/javascripts/discourse/app/components/modal/insert-hyperlink.js rename to app/assets/javascripts/discourse/app/components/modal/insert-hyperlink.gjs index 9711d963aba..b60e7cff7d9 100644 --- a/app/assets/javascripts/discourse/app/components/modal/insert-hyperlink.js +++ b/app/assets/javascripts/discourse/app/components/modal/insert-hyperlink.gjs @@ -1,11 +1,20 @@ import Component from "@glimmer/component"; import { tracked } from "@glimmer/tracking"; +import { on } from "@ember/modifier"; import { action } from "@ember/object"; import { cancel } from "@ember/runloop"; import { isEmpty } from "@ember/utils"; +import DButton from "discourse/components/d-button"; +import DModal from "discourse/components/d-modal"; +import TopicStatus from "discourse/components/topic-status"; +import categoryLink from "discourse/helpers/category-link"; +import discourseTags from "discourse/helpers/discourse-tags"; +import loadingSpinner from "discourse/helpers/loading-spinner"; +import replaceEmoji from "discourse/helpers/replace-emoji"; import { searchForTerm } from "discourse/lib/search"; import { prefixProtocol } from "discourse/lib/url"; import discourseDebounce from "discourse-common/lib/debounce"; +import { i18n } from "discourse-i18n"; export default class InsertHyperlink extends Component { @tracked linkText = this.args.model.linkText; @@ -161,4 +170,81 @@ export default class InsertHyperlink extends Component { this.linkUrl = event.target.value; this._debounced = discourseDebounce(this, this.triggerSearch, 400); } + + } diff --git a/app/assets/javascripts/discourse/app/components/modal/insert-hyperlink.hbs b/app/assets/javascripts/discourse/app/components/modal/insert-hyperlink.hbs deleted file mode 100644 index 93d2486cfd9..00000000000 --- a/app/assets/javascripts/discourse/app/components/modal/insert-hyperlink.hbs +++ /dev/null @@ -1,74 +0,0 @@ -{{! template-lint-disable no-pointer-down-event-binding }} - - <:body> -
- - - {{#if this.searchLoading}} - {{loading-spinner}} - {{/if}} - - {{#if this.searchResults}} - - {{/if}} -
- -
- -
- - - <:footer> - - - - -
\ No newline at end of file