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,19 +67,26 @@ 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) {
const t = parseInt(qParams.type, null);
this.groupingsComponent.selectedType = t;
await this.filterCipherType(t, true);
} else if (qParams.collectionId) {
this.groupingsComponent.selectedCollectionId = qParams.collectionId;
await this.filterCollection(qParams.collectionId, true);
} else {
this.groupingsComponent.selectedAll = true;
await this.ciphersComponent.load();
}
} }
if (qParams.type) { this.ciphersComponent.searchText = this.groupingsComponent.searchText = qParams.search;
const t = parseInt(qParams.type, null); if (qParams.viewEvents != null) {
this.groupingsComponent.selectedType = t; const cipher = this.ciphersComponent.ciphers.filter((c) => c.id === qParams.viewEvents);
await this.filterCipherType(t, true); if (cipher.length > 0) {
} else if (qParams.collectionId) { this.viewEvents(cipher[0]);
this.groupingsComponent.selectedCollectionId = qParams.collectionId; }
await this.filterCollection(qParams.collectionId, true);
} else {
this.groupingsComponent.selectedAll = true;
await this.ciphersComponent.load();
} }
}); });
}); });

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;
} }