wire up search and view events query params

This commit is contained in:
Kyle Spearrin 2018-07-11 15:44:40 -04:00
parent 98d3b42728
commit 6dd21fe9e9
5 changed files with 36 additions and 12 deletions

View File

@ -48,6 +48,9 @@ export class CollectionsComponent implements OnInit {
this.route.parent.parent.params.subscribe(async (params) => { this.route.parent.parent.params.subscribe(async (params) => {
this.organizationId = params.organizationId; this.organizationId = params.organizationId;
await this.load(); await this.load();
this.route.queryParams.subscribe(async (qParams) => {
this.searchText = qParams.search;
});
}); });
} }

View File

@ -56,6 +56,9 @@ export class GroupsComponent implements OnInit {
return; return;
} }
await this.load(); await this.load();
this.route.queryParams.subscribe(async (qParams) => {
this.searchText = qParams.search;
});
}); });
} }

View File

@ -64,6 +64,16 @@ export class PeopleComponent implements OnInit {
this.accessEvents = organization.useEvents; this.accessEvents = organization.useEvents;
this.accessGroups = organization.useGroups; this.accessGroups = organization.useGroups;
await this.load(); await this.load();
this.route.queryParams.subscribe(async (qParams) => {
this.searchText = qParams.search;
if (qParams.viewEvents != null) {
const user = this.users.filter((u) => u.id === qParams.viewEvents);
if (user.length > 0) {
this.events(user[0]);
}
}
});
}); });
} }

View File

@ -67,9 +67,7 @@ export class VaultComponent implements OnInit {
if (qParams == null) { if (qParams == null) {
this.groupingsComponent.selectedAll = true; this.groupingsComponent.selectedAll = true;
await this.ciphersComponent.load(); await this.ciphersComponent.load();
return; } else {
}
if (qParams.type) { if (qParams.type) {
const t = parseInt(qParams.type, null); const t = parseInt(qParams.type, null);
this.groupingsComponent.selectedType = t; this.groupingsComponent.selectedType = t;
@ -81,6 +79,15 @@ export class VaultComponent implements OnInit {
this.groupingsComponent.selectedAll = true; this.groupingsComponent.selectedAll = true;
await this.ciphersComponent.load(); await this.ciphersComponent.load();
} }
}
this.ciphersComponent.searchText = this.groupingsComponent.searchText = qParams.search;
if (qParams.viewEvents != null) {
const cipher = this.ciphersComponent.ciphers.filter((c) => c.id === qParams.viewEvents);
if (cipher.length > 0) {
this.viewEvents(cipher[0]);
}
}
}); });
}); });
} }

View File

@ -205,7 +205,8 @@ export class EventService {
private formatOrgUserId(ev: EventResponse) { private formatOrgUserId(ev: EventResponse) {
const shortId = this.getShortId(ev.organizationUserId); const shortId = this.getShortId(ev.organizationUserId);
const a = this.makeAnchor(shortId); const a = this.makeAnchor(shortId);
a.setAttribute('href', '#/organizations/' + ev.organizationId + '/manage/people?search=' + shortId); a.setAttribute('href', '#/organizations/' + ev.organizationId + '/manage/people?search=' + shortId +
'&viewEvents=' + ev.organizationUserId);
return a.outerHTML; return a.outerHTML;
} }