Browse Source

Move details of granted access

pull/7792/head
Thomas Kaul 1 month ago
parent
commit
a1fa471716
  1. 17
      apps/client/src/app/components/access-table/access-table.component.ts
  2. 8
      apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts
  3. 8
      apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.html

17
apps/client/src/app/components/access-table/access-table.component.ts

@ -80,15 +80,14 @@ export class GfAccessTableComponent {
protected readonly dataSource = new MatTableDataSource<Access>(); protected readonly dataSource = new MatTableDataSource<Access>();
protected readonly displayedColumns = computed(() => { protected readonly displayedColumns = computed(() => {
const columns = ['alias', 'grantee', 'type', 'lastUsedAt', 'expiresAt']; const columns = [
'alias',
if ( 'grantee',
this.accesses()?.some(({ type }) => { 'type',
return type === 'PUBLIC'; 'lastUsedAt',
}) 'expiresAt',
) { 'details'
columns.push('details'); ];
}
if (this.showActions()) { if (this.showActions()) {
columns.push('actions'); columns.push('actions');

8
apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts

@ -245,11 +245,7 @@ export class GfCreateOrUpdateAccessDialogComponent implements OnInit {
} }
protected get showMcpDetails() { protected get showMcpDetails() {
return ( return this.canGrantMcpAccess && this.mode === 'update';
this.accessType === 'MCP' &&
this.hasPermissionToEnableMcp &&
this.mode === 'update'
);
} }
protected get showPublicDetails() { protected get showPublicDetails() {
@ -365,7 +361,7 @@ export class GfCreateOrUpdateAccessDialogComponent implements OnInit {
} }
private async updateAccess() { private async updateAccess() {
const accessId = this.data.access?.id; const accessId = this.accessId;
if (!accessId) { if (!accessId) {
return; return;

8
apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.html

@ -137,14 +137,16 @@
<h2 class="h6" i18n>Details</h2> <h2 class="h6" i18n>Details</h2>
@if (showMcpDetails) { @if (showMcpDetails) {
<div> <div>
<code>{{ baseUrl }}{{ mcpEndpoint }}</code> <code class="text-break">{{ baseUrl }}{{ mcpEndpoint }}</code>
</div> </div>
<div> <div>
<code>Authorization: Bearer {{ accessId }}</code> <code class="text-break">Authorization: Bearer {{ accessId }}</code>
</div> </div>
} @else if (showPublicDetails) { } @else if (showPublicDetails) {
<div> <div>
<code>GET {{ baseUrl }}/api/v1/public/{{ accessId }}/portfolio</code> <code class="text-break"
>GET {{ baseUrl }}/api/v1/public/{{ accessId }}/portfolio</code
>
</div> </div>
} }
} }

Loading…
Cancel
Save