feat: 🎸 Add ability to search other resources as well (#3021)

This commit adds the ability to search across multiple tables with joins which unlocks a better search experience in the case of tables that source their data from multiple tables.
This commit is contained in:
Zhihe Li authored and GitHub committed 2025-11-05 17:57:45 -05:00
1 parent d8744e81bc
commit 92f5a65c00
7 files changed
+219 -36

No files matched your search

@@ -279,6 +279,46 @@ module('Acceptance | aliases | list', function (hooks) {
.includesText(intl.t('titles.no-results-found'));
});
test('user can search for aliases by associated target name', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
},
});
// Create a target with a specific name
const targetWithName = this.server.create('target', {
name: 'A real production target',
scope: instances.scopes.project,
});
// Create an alias associated with this target
const aliasWithNamedTarget = this.server.create('alias', {
scope: instances.scopes.global,
destination_id: targetWithName.id,
});
const urlAliasWithNamedTarget = `${urls.aliases}/${aliasWithNamedTarget.id}`;
await visit(urls.globalScope);
await click(commonSelectors.HREF(urls.aliases));
assert.dom(commonSelectors.HREF(urls.alias)).exists();
assert.dom(commonSelectors.HREF(urls.aliasWithTarget)).exists();
assert.dom(commonSelectors.HREF(urlAliasWithNamedTarget)).exists();
await fillIn(commonSelectors.SEARCH_INPUT, 'production target');
await waitFor(commonSelectors.HREF(urls.alias), { count: 0 });
assert.dom(commonSelectors.HREF(urlAliasWithNamedTarget)).exists();
assert.dom(commonSelectors.HREF(urls.alias)).doesNotExist();
assert.dom(commonSelectors.HREF(urls.aliasWithTarget)).doesNotExist();
});
test('aliases are sorted by created_time descending by default', async function (assert) {
setRunOptions({
rules: {
@@ -39,6 +39,10 @@ module('Acceptance | aliases | update', function (hooks) {
type: 'org',
scope: { id: 'global', type: 'global' },
});
instances.scopes.project = this.server.create('scope', {
type: 'project',
scope: { id: instances.scopes.org.id, type: 'org' },
});
instances.target = this.server.create('target', {
scope: instances.scopes.project,
});