diff --git a/console/src/app/modules/filter-org/filter-org.component.html b/console/src/app/modules/filter-org/filter-org.component.html index 510ca0fcd1..4e8535fe76 100644 --- a/console/src/app/modules/filter-org/filter-org.component.html +++ b/console/src/app/modules/filter-org/filter-org.component.html @@ -46,4 +46,27 @@ + +
+ {{ 'FILTER.PRIMARYDOMAIN' | translate }} + +
+ + + + {{ 'FILTER.METHODS.' + method | translate }} + + + + + + + +
+
diff --git a/console/src/app/modules/filter-org/filter-org.component.ts b/console/src/app/modules/filter-org/filter-org.component.ts index 3a43b74195..8e100971d0 100644 --- a/console/src/app/modules/filter-org/filter-org.component.ts +++ b/console/src/app/modules/filter-org/filter-org.component.ts @@ -3,7 +3,7 @@ import { MatCheckboxChange } from '@angular/material/checkbox'; import { ActivatedRoute, Router } from '@angular/router'; import { take } from 'rxjs'; import { TextQueryMethod } from 'src/app/proto/generated/zitadel/object_pb'; -import { OrgNameQuery, OrgQuery, OrgState, OrgStateQuery } from 'src/app/proto/generated/zitadel/org_pb'; +import { OrgDomainQuery, OrgNameQuery, OrgQuery, OrgState, OrgStateQuery } from 'src/app/proto/generated/zitadel/org_pb'; import { UserNameQuery } from 'src/app/proto/generated/zitadel/user_pb'; import { FilterComponent } from '../filter/filter.component'; @@ -11,6 +11,7 @@ import { FilterComponent } from '../filter/filter.component'; enum SubQuery { NAME, STATE, + DOMAIN, } @Component({ @@ -52,6 +53,13 @@ export class FilterOrgComponent extends FilterComponent implements OnInit { orgStateQuery.setState(filter.stateQuery.state); orgQuery.setStateQuery(orgStateQuery); return orgQuery; + } else if (filter.domainQuery) { + const orgQuery = new OrgQuery(); + const orgDomainQuery = new OrgDomainQuery(); + orgDomainQuery.setDomain(filter.domainQuery.domain); + orgDomainQuery.setMethod(filter.domainQuery.method); + orgQuery.setDomainQuery(orgDomainQuery); + return orgQuery; } else { return undefined; } @@ -83,6 +91,14 @@ export class FilterOrgComponent extends FilterComponent implements OnInit { osq.setStateQuery(sq); this.searchQueries.push(osq); break; + case SubQuery.DOMAIN: + const dq = new OrgDomainQuery(); + dq.setMethod(TextQueryMethod.TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE); + dq.setDomain(''); + const odq = new OrgQuery(); + odq.setDomainQuery(dq); + this.searchQueries.push(odq); + break; } } else { switch (subquery) { @@ -98,6 +114,12 @@ export class FilterOrgComponent extends FilterComponent implements OnInit { this.searchQueries.splice(index_sn, 1); } break; + case SubQuery.DOMAIN: + const index_pdn = this.searchQueries.findIndex((q) => (q as OrgQuery).toObject().domainQuery !== undefined); + if (index_pdn > -1) { + this.searchQueries.splice(index_pdn, 1); + } + break; } } } @@ -113,6 +135,10 @@ export class FilterOrgComponent extends FilterComponent implements OnInit { (query as OrgStateQuery).setState(value); this.filterChanged.emit(this.searchQueries ? this.searchQueries : []); break; + case SubQuery.DOMAIN: + (query as OrgDomainQuery).setDomain(value); + this.filterChanged.emit(this.searchQueries ? this.searchQueries : []); + break; } } @@ -132,6 +158,13 @@ export class FilterOrgComponent extends FilterComponent implements OnInit { } else { return undefined; } + case SubQuery.DOMAIN: + const pdn = this.searchQueries.find((q) => (q as OrgQuery).toObject().domainQuery !== undefined); + if (pdn) { + return (pdn as OrgQuery).getDomainQuery(); + } else { + return undefined; + } } } diff --git a/console/src/app/modules/org-table/org-table.component.ts b/console/src/app/modules/org-table/org-table.component.ts index bc2fcc71aa..24bd9ea2af 100644 --- a/console/src/app/modules/org-table/org-table.component.ts +++ b/console/src/app/modules/org-table/org-table.component.ts @@ -88,7 +88,7 @@ export class OrgTableComponent { } return from( - this.authService.listMyProjectOrgs(request.limit, request.offset, request.queries, sortingField, this.sort?.direction), + this.adminService.listOrgs(request.limit, request.offset, request.queries, sortingField, this.sort?.direction), ).pipe( map((resp) => { this.timestamp = resp.details?.viewTimestamp; diff --git a/console/src/app/services/admin.service.ts b/console/src/app/services/admin.service.ts index 8c79ac1713..17c8f1b323 100644 --- a/console/src/app/services/admin.service.ts +++ b/console/src/app/services/admin.service.ts @@ -159,6 +159,8 @@ import { ListLoginPolicySecondFactorsResponse, ListMilestonesRequest, ListMilestonesResponse, + ListOrgsRequest, + ListOrgsResponse, ListProvidersRequest, ListProvidersResponse, ListSecretGeneratorsRequest, @@ -314,6 +316,8 @@ import { MilestoneQuery, MilestoneType, } from '../proto/generated/zitadel/milestone/v1/milestone_pb'; +import { OrgFieldName, OrgQuery } from '../proto/generated/zitadel/org_pb'; +import { SortDirection } from '@angular/material/sort'; export interface OnboardingActions { order: number; @@ -1303,4 +1307,33 @@ export class AdminService { public listMilestones(req: ListMilestonesRequest): Promise { return this.grpcService.admin.listMilestones(req, null).then((resp) => resp.toObject()); } + + public listOrgs( + limit: number, + offset: number, + queriesList?: OrgQuery[], + sortingColumn?: OrgFieldName, + sortingDirection?: SortDirection, + ): Promise { + const req = new ListOrgsRequest(); + const query = new ListQuery(); + if (limit) { + query.setLimit(limit); + } + if (offset) { + query.setOffset(offset); + } + if (sortingDirection) { + query.setAsc(sortingDirection === 'asc'); + } + req.setQuery(query); + if (sortingColumn) { + req.setSortingColumn(sortingColumn); + } + + if (queriesList) { + req.setQueriesList(queriesList); + } + return this.grpcService.admin.listOrgs(req, null).then((resp) => resp.toObject()); + } } diff --git a/console/src/assets/i18n/bg.json b/console/src/assets/i18n/bg.json index 7de69dfadd..ecf859efd9 100644 --- a/console/src/assets/i18n/bg.json +++ b/console/src/assets/i18n/bg.json @@ -221,6 +221,7 @@ "EMAIL": "електронна поща", "USERNAME": "Потребителско име", "ORGNAME": "Наименование на организацията", + "PRIMARYDOMAIN": "Основен домейн", "PROJECTNAME": "Име на проекта", "RESOURCEOWNER": "Собственик на ресурс", "METHODS": { diff --git a/console/src/assets/i18n/cs.json b/console/src/assets/i18n/cs.json index f4bdbefe63..3aa28dc72b 100644 --- a/console/src/assets/i18n/cs.json +++ b/console/src/assets/i18n/cs.json @@ -228,6 +228,7 @@ "EMAIL": "Email", "USERNAME": "Uživatelské jméno", "ORGNAME": "Název organizace", + "PRIMARYDOMAIN": "Primární doména", "PROJECTNAME": "Název projektu", "RESOURCEOWNER": "Vlastník zdroje", "METHODS": { diff --git a/console/src/assets/i18n/de.json b/console/src/assets/i18n/de.json index c60c01d394..3c6ee5ba8d 100644 --- a/console/src/assets/i18n/de.json +++ b/console/src/assets/i18n/de.json @@ -227,6 +227,7 @@ "EMAIL": "Email", "USERNAME": "Nutzername", "ORGNAME": "Organisationsname", + "PRIMARYDOMAIN": "Primäre Domäne", "PROJECTNAME": "Projektname", "RESOURCEOWNER": "Ressourcenbesitzer", "METHODS": { diff --git a/console/src/assets/i18n/en.json b/console/src/assets/i18n/en.json index f8466cb073..e48021ab4f 100644 --- a/console/src/assets/i18n/en.json +++ b/console/src/assets/i18n/en.json @@ -228,6 +228,7 @@ "EMAIL": "Email", "USERNAME": "User Name", "ORGNAME": "Organization Name", + "PRIMARYDOMAIN": "Primary Domain", "PROJECTNAME": "Project Name", "RESOURCEOWNER": "Resource Owner", "METHODS": { diff --git a/console/src/assets/i18n/es.json b/console/src/assets/i18n/es.json index 9e6c4d4334..4d057417d6 100644 --- a/console/src/assets/i18n/es.json +++ b/console/src/assets/i18n/es.json @@ -228,6 +228,7 @@ "EMAIL": "Email", "USERNAME": "Nombre de usuario", "ORGNAME": "Nombre de organización", + "PRIMARYDOMAIN": "Dominio primario", "PROJECTNAME": "Nombre de proyecto", "RESOURCEOWNER": "Propietario del recurso", "METHODS": { diff --git a/console/src/assets/i18n/fr.json b/console/src/assets/i18n/fr.json index 143ec49c45..ffc13075c5 100644 --- a/console/src/assets/i18n/fr.json +++ b/console/src/assets/i18n/fr.json @@ -227,6 +227,7 @@ "EMAIL": "Courriel", "USERNAME": "Nom de l'utilisateur", "ORGNAME": "Nom de l'organisation", + "PRIMARYDOMAIN": "Domaine principal", "PROJECTNAME": "Nom du projet", "RESOURCEOWNER": "Propriétaire des ressources", "METHODS": { diff --git a/console/src/assets/i18n/it.json b/console/src/assets/i18n/it.json index 3921e3b232..e0f188610b 100644 --- a/console/src/assets/i18n/it.json +++ b/console/src/assets/i18n/it.json @@ -226,6 +226,7 @@ "EMAIL": "Email", "USERNAME": "User Name", "ORGNAME": "Nome organizzazione", + "PRIMARYDOMAIN": "Dominio primario", "PROJECTNAME": "Nome del progetto", "RESOURCEOWNER": "Resource Owner", "METHODS": { diff --git a/console/src/assets/i18n/ja.json b/console/src/assets/i18n/ja.json index 8518afa08a..62341b20ef 100644 --- a/console/src/assets/i18n/ja.json +++ b/console/src/assets/i18n/ja.json @@ -228,6 +228,7 @@ "EMAIL": "Eメール", "USERNAME": "ユーザー名", "ORGNAME": "組織名", + "PRIMARYDOMAIN": "プライマリドメイン", "PROJECTNAME": "プロジェクト名", "RESOURCEOWNER": "リソース所有者", "METHODS": { diff --git a/console/src/assets/i18n/mk.json b/console/src/assets/i18n/mk.json index 873172e1c2..d19d736b22 100644 --- a/console/src/assets/i18n/mk.json +++ b/console/src/assets/i18n/mk.json @@ -228,6 +228,7 @@ "EMAIL": "Е-пошта", "USERNAME": "Корисничко име", "ORGNAME": "Име на организацијата", + "PRIMARYDOMAIN": "Примарен домен", "PROJECTNAME": "Име на проектот", "RESOURCEOWNER": "Сопственик на ресурсот", "METHODS": { diff --git a/console/src/assets/i18n/nl.json b/console/src/assets/i18n/nl.json index b6861b5347..9e5d04076c 100644 --- a/console/src/assets/i18n/nl.json +++ b/console/src/assets/i18n/nl.json @@ -228,6 +228,7 @@ "EMAIL": "E-mail", "USERNAME": "Gebruikersnaam", "ORGNAME": "Organisatienaam", + "PRIMARYDOMAIN": "Primair domein", "PROJECTNAME": "Projectnaam", "RESOURCEOWNER": "Eigenaar van de bron", "METHODS": { diff --git a/console/src/assets/i18n/pl.json b/console/src/assets/i18n/pl.json index 5cc3c07e32..36ccc2db0d 100644 --- a/console/src/assets/i18n/pl.json +++ b/console/src/assets/i18n/pl.json @@ -227,6 +227,7 @@ "EMAIL": "Email", "USERNAME": "Nazwa Użytkownika", "ORGNAME": "Nazwa Organizacji", + "PRIMARYDOMAIN": "Domena podstawowa", "PROJECTNAME": "Nazwa Projektu", "RESOURCEOWNER": "Właściciel Zasobu", "METHODS": { diff --git a/console/src/assets/i18n/pt.json b/console/src/assets/i18n/pt.json index 159bb13ab4..132d3f36f0 100644 --- a/console/src/assets/i18n/pt.json +++ b/console/src/assets/i18n/pt.json @@ -228,6 +228,7 @@ "EMAIL": "E-mail", "USERNAME": "Nome de Usuário", "ORGNAME": "Nome da Organização", + "PRIMARYDOMAIN": "Domínio primário", "PROJECTNAME": "Nome do Projeto", "RESOURCEOWNER": "Proprietário do Recurso", "METHODS": { diff --git a/console/src/assets/i18n/ru.json b/console/src/assets/i18n/ru.json index 7f503e1acf..181848273b 100644 --- a/console/src/assets/i18n/ru.json +++ b/console/src/assets/i18n/ru.json @@ -224,6 +224,7 @@ "EMAIL": "Электронная почта", "USERNAME": "Имя пользователя", "ORGNAME": "Название организации", + "PRIMARYDOMAIN": "Основной домен", "PROJECTNAME": "название проекта", "RESOURCEOWNER": "Владелец ресурса", "METHODS": { diff --git a/console/src/assets/i18n/zh.json b/console/src/assets/i18n/zh.json index 5dc705bb59..f9878afc7e 100644 --- a/console/src/assets/i18n/zh.json +++ b/console/src/assets/i18n/zh.json @@ -227,6 +227,7 @@ "EMAIL": "邮箱", "USERNAME": "用户名", "ORGNAME": "组织名称", + "PRIMARYDOMAIN": "主域", "PROJECTNAME": "项目名称", "RESOURCEOWNER": "资源所有者", "METHODS": {