discourse/app/assets/javascripts
Isaac Janzen 87359cf7aa
DEV: Add typeClass to search AssistantItem (#29369)
When rendering the initial search options, we re-use the `AssistantItem` component. 

`AssistantItem` requires that you pass in the required params to define what _type_ of component it will be - category, tag, tag intersection, user, etc. This flexibility is nice, as we can just loop through all `@results` and pass in params, without having to predefine what _type_ of result it is. 

It is is not very good when it comes to seperating the html strucutre of each unique _type_. This is an example of the initial search results: 

<img width="408" alt="Screenshot 2024-10-23 at 9 04 18 AM" src="https://github.com/user-attachments/assets/46795697-6246-4b60-be18-fea200a57baa">

You can see that both categories **and** tags are being rendered. The HTML strcuture looks like so: 

```html
<ul class="search-menu-assistant">
  <li class="search-menu-assistant-item">
    <a class="search-link" href="#"> CATEGORY </a>
  </li>
  <li class="search-menu-assistant-item">
    <a class="search-link" href="#"> CATEGORY </a>
  </li>
  <li class="search-menu-assistant-item">
    <a class="search-link" href="#"> TAG </a>
  </li>
  <li class="search-menu-assistant-item">
    <a class="search-link" href="#"> TAG </a>
  </li>
</ul>
```

There is no way to differentiate between the types, even though some are categories and others tags.

This PR adds a _typeClass_ to each component, that will be a additional class included at the top level of the component HTML structure. 

```html
<ul class="search-menu-assistant">
  <li class="category search-menu-assistant-item">
    <a class="search-link" href="#"> CATEGORY </a>
  </li>
  <li class="category search-menu-assistant-item">
    <a class="search-link" href="#"> CATEGORY </a>
  </li>
  <li class="tag search-menu-assistant-item">
    <a class="search-link" href="#"> TAG </a>
  </li>
  <li class="tag search-menu-assistant-item">
    <a class="search-link" href="#"> TAG </a>
  </li>
</ul>
```
_See `.category` and `.tag` attached to each `search-menu-assistant-item`._ 

This will help us identify which _type_ it is, and allow devs to target and customize each element by _type_.
2024-10-23 09:47:45 -05:00
..
admin DEV: Update images-uploader uppy usage (#29341) 2024-10-23 10:08:09 +01:00
custom-proxy Build(deps-dev): Bump express from 4.21.0 to 4.21.1 (#29134) 2024-10-09 01:07:01 +02:00
deprecation-silencer DEV: Reformat package.json files (#28733) 2024-09-04 21:14:13 +02:00
dialog-holder Build(deps-dev): Bump @types/qunit in the types group (#29353) 2024-10-23 00:28:45 +02:00
discourse DEV: Add typeClass to search AssistantItem (#29369) 2024-10-23 09:47:45 -05:00
discourse-common Build(deps): Bump the babel group with 3 updates (#29352) 2024-10-23 00:28:54 +02:00
discourse-hbr DEV: Reformat package.json files (#28733) 2024-09-04 21:14:13 +02:00
discourse-i18n DEV: Reformat package.json files (#28733) 2024-09-04 21:14:13 +02:00
discourse-markdown-it Build(deps): Bump ember-auto-import from 2.8.0 to 2.8.1 (#28982) 2024-09-30 14:06:20 +02:00
discourse-plugins Build(deps): Bump the babel group with 3 updates (#29352) 2024-10-23 00:28:54 +02:00
discourse-widget-hbs Build(deps): Bump the babel group with 3 updates (#29352) 2024-10-23 00:28:54 +02:00
docs
ember-addons
ember-cli-progress-ci PERF: Improve production JS build in low-memory environments (#26849) 2024-05-02 11:43:59 +01:00
ember-production-deprecations DEV: Update ember-cli-deprecation-workflow from 2.2.0 to 3.0.1 (#28226) 2024-08-07 17:59:42 +02:00
float-kit Build(deps): Bump the babel group with 3 updates (#29352) 2024-10-23 00:28:54 +02:00
locales FEATURE: Add Uyghur language (#27183) 2024-05-27 09:58:18 +02:00
pretty-text Build(deps): Bump the babel group with 3 updates (#29352) 2024-10-23 00:28:54 +02:00
select-kit FEATURE: mandatory fields for compact-list (#29357) 2024-10-23 16:16:08 +11:00
theme-transpiler Build(deps): Bump the babel group with 3 updates (#29352) 2024-10-23 00:28:54 +02:00
truth-helpers Build(deps): Bump ember-auto-import from 2.8.0 to 2.8.1 (#28982) 2024-09-30 14:06:20 +02:00
.npmrc
handlebars-shim.js
polyfills.js
service-worker.js.erb DEV: Drop workbox dependency (#26735) 2024-04-24 10:19:12 +01:00