Skip to content

Feature/api scope management - #1131

Open
avraimakis wants to merge 3 commits into
developfrom
feature/api-scope-management
Open

Feature/api scope management#1131
avraimakis wants to merge 3 commits into
developfrom
feature/api-scope-management

Conversation

@avraimakis

Copy link
Copy Markdown
Contributor

No description provided.

Άγγελος Βραϊμάκης added 3 commits August 3, 2026 18:07
Introduced functionality for creating, editing, deleting, and listing API scopes. Updated `resource-add.component.ts` to handle scope creation. Added new components for managing scopes: `ScopeAddComponent`, `ScopeEditComponent`, `ScopeDetailsComponent`, `ScopeClaimsComponent`, and `ScopesComponent`.

Updated `resources-routing.module.ts` to include routes for scope management. Modified `basic-info-step.component.html` to add "API Scope" as a resource type. Updated `menu.service.ts` to include a "Scopes List" menu item.

Added templates and logic for scope creation, editing, and claims management. Enhanced `scopes.component.ts` to support pagination, sorting, and search for API scopes.
Added the `[canFilter]="true"` input property to the `<app-list-view>` component in `clients.component.html` to enable filtering functionality within the list view.
Updated forms in `scope-add.component.html` and `scope-details.component.html`:
- Replaced `form-group` with `mb-3 row` for better layout.
- Added `ngClass` for conditional validation styling.
- Improved input field validation with `maxlength` and template references.
- Updated `id` and `name` attributes for descriptive naming.
- Replaced `form-check` with `custom-control custom-checkbox`.
- Simplified `scope-details.component.html` structure.
- Added `formReadonly` binding for editability control.
- Improved button alignment and spacing.

These changes enhance responsiveness, maintainability, and user experience.
@avraimakis
avraimakis requested review from travlos and a lite review from Copilot August 5, 2026 08:47
import { ApiResourceSecretsComponent } from './api/edit/secrets/api-resource-secrets.component';
import { ResourceAddComponent } from './add/resource-add.component';
import { ScopesComponent } from './scopes/scopes.component';
import { ScopeAddComponent } from './scopes/add/scope-add.component';
import { Subscription, forkJoin } from 'rxjs';
import { map } from 'rxjs/operators';
import { AuthService } from 'src/app/core/services/auth.service';
import { IdentityApiService, ClaimTypeInfo, ClaimTypeInfoResultSet } from 'src/app/core/services/identity-api.service';
import { ApiResourceSecretsComponent } from './api/edit/secrets/api-resource-secrets.component';
import { ResourceAddComponent } from './add/resource-add.component';
import { ScopesComponent } from './scopes/scopes.component';
import { ScopeAddComponent } from './scopes/add/scope-add.component';
import { Subscription, forkJoin } from 'rxjs';
import { map } from 'rxjs/operators';
import { AuthService } from 'src/app/core/services/auth.service';
import { IdentityApiService, ClaimTypeInfo, ClaimTypeInfoResultSet } from 'src/app/core/services/identity-api.service';

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the Identity AdminUI “Resources” area to support API Scope management (listing scopes and editing scope details/claims), and wires the feature into navigation and the existing “Add Resource” wizard.

Changes:

  • Add “Scopes List” to the Resources menu and introduce a Scopes list page.
  • Add scope edit pages (details + claims) and register routes/module declarations under resources/scopes.
  • Extend the Resource wizard to allow creating an API Scope; enable filtering in the Clients list view.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/Indice.Features.Identity.AdminUI.App/src/app/layout/services/menu.service.ts Adds “Scopes List” entry under Resources menu.
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/scopes.component.ts Implements scopes list component + datatable columns and data loading.
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/scopes.component.html Scopes list UI with list-view and row actions template.
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/edit/scope-edit.component.ts Parent scope edit container: loads scope + supports deletion.
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/edit/scope-edit.component.html Scope edit page shell with tabs (details/claims) and delete button.
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/edit/details/scope-details.component.ts Scope details editor and update call.
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/edit/details/scope-details.component.html Scope details form (display name/description/emphasize/discovery).
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/edit/claims/scope-claims.component.ts Scope claims assignment/view logic (transfer list + fallback list view).
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/edit/claims/scope-claims.component.html Scope claims UI (transfer list for writers, list view for readers).
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/add/scope-add.component.ts Adds standalone “Add Scope” component (currently not routed).
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/add/scope-add.component.html Standalone “Add Scope” form UI.
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/resources.module.ts Declares newly added scopes components in Resources module.
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/resources-routing.module.ts Adds routes for scopes list and scope edit children.
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/add/wizard/steps/basic-info/basic-info-step.component.html Adds “API Scope” as a selectable resource type in wizard.
src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/add/resource-add.component.ts Creates API scopes when wizard type is scope.
src/Indice.Features.Identity.AdminUI.App/src/app/features/clients/clients.component.html Enables filtering in clients list-view.
Suppressed comments (2)

src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/edit/scope-edit.component.ts:21

  • canEdit is never assigned, so the Delete button is always hidden. Inject AuthService to compute canEdit based on writer permissions (consistent with other Resources components).
    constructor(
        private _route: ActivatedRoute,
        private _router: Router,
        private _api: IdentityApiService,
        private _toast: ToastService

src/Indice.Features.Identity.AdminUI.App/src/app/features/resources/scopes/edit/scope-edit.component.ts:28

  • canEdit is used in the view but never set, so edit/delete capabilities never enable even for writers. Set it during initialization using AuthService.isAdminUIClientsWriter().
    public ngOnInit(): void {
        this._route.params.subscribe(params => {
            this.scopeName = params['name'];
            this.loadScope();
        });

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +37 to +44
const request = new UpdateApiScopeRequest({
displayName: this.scope.displayName,
description: this.scope.description,
required: this.scope.emphasize,
emphasize: this.scope.emphasize,
showInDiscoveryDocument: this.scope.showInDiscoveryDocument,
translations: {}
});
Comment on lines +45 to +48
if (!this.scope) {
this._toast.showDanger(`Scope '${this.scopeName}' not found.`);
this._router.navigate(['app/scopes']);
}
Comment on lines +1 to +5
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';

import { IdentityApiService, ApiScopeInfo } from 'src/app/core/services/identity-api.service';
import { ToastService } from 'src/app/layout/services/app-toast.service';
Comment on lines +29 to +31
public availableClaims: ClaimTypeInfo[] = [];
public scopeClaims: ClaimTypeInfo[] = [];
public canEditScope: boolean;
Comment on lines +42 to +43
this._scopeName = this._route.parent?.snapshot.params['name'];
this.loadData();
Comment on lines +44 to +50
{ path: 'scopes', component: ScopesComponent },
{
path: 'scopes/:name', component: ScopeEditComponent, children: [
{ path: '', redirectTo: 'details', pathMatch: 'full' },
{ path: 'details', component: ScopeDetailsComponent },
{ path: 'claims', component: ScopeClaimsComponent }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants