This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests
Penar Musaraj 4072786f5b
DEV: Support using Ember components in dialog service (#20230)
We often have the need to use rich HTML in dialog messages (to show lists, icons, etc.). Previously, our only option was to wrap the message in an `htmlSafe()` call. This PR adds the ability to pass a component name and model to the dialog, which means that we can write the HTML in regular Ember components. 

Example, whereas previously we would do this: 

```
    this.dialog.deleteConfirm({
      message: htmlSafe(`<li>Some text</li>`),
    });
```

instead we can now do this: 

```javascript
import SecondFactorConfirmPhrase from "discourse/components/dialog-messages/second-factor-confirm-phrase";

...

this.dialog.deleteConfirm({
  title: I18n.t("user.second_factor.disable_confirm"),
  bodyComponent: SecondFactorConfirmPhrase,
  bodyComponentModel: model,
})
```

The model passed to the component is optional and will be available as `@model` in the Handlebars template.
2023-02-13 13:03:31 -05:00
..
acceptance DEV: Fix a flakey test (#20241) 2023-02-10 11:37:11 -05:00
addons/truth-helpers/integration/helpers DEV: adds includes helper to templates (#18259) 2022-09-15 14:20:37 +02:00
fixtures DEV: Resolve user_option deprecations (#20192) 2023-02-09 16:05:42 +00:00
helpers FIX: Sync user's reviewables count when loading reviewables list (#20128) 2023-02-02 10:19:51 +08:00
integration DEV: Support using Ember components in dialog service (#20230) 2023-02-13 13:03:31 -05:00
unit FIX: account for cursor drift when completing terms (#19660) 2023-02-13 09:25:12 +11:00
index.html DEV: Update Twitter meta tags while navigating in app (#19468) 2022-12-14 14:33:09 -05:00
setup-tests.js DEV: Drop helper context setup in tests (#19423) 2022-12-12 15:20:48 +01:00
test-boot-ember-cli.js DEV: Make the setupTests a regular import (#19046) 2022-11-16 16:11:18 +08:00