Skip to content

Commit

Permalink
NAS-132647 / 25.04 / Return back API Docs button (#11078)
Browse files Browse the repository at this point in the history
  • Loading branch information
undsoft authored Nov 23, 2024
1 parent a5e0a02 commit 2aa2242
Show file tree
Hide file tree
Showing 91 changed files with 110 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
(click)="onSearch(searchInput.query)"
>{{ 'Search' | translate }}</button>

<a mat-button href="/api/docs" target="_blank" ixTest="api-docs">
{{ 'API Docs' | translate }}
</a>

<button
*ixRequiresRoles="requiredRoles"
mat-button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatButtonHarness } from '@angular/material/button/testing';
import { MatDialog } from '@angular/material/dialog';
import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest';
import { MockComponent } from 'ng-mocks';
Expand Down Expand Up @@ -94,6 +95,21 @@ describe('UserApiKeysComponent', () => {
table = await loader.getHarness(IxTableHarness);
});

it('renders a button to add new API key', async () => {
const addButton = await loader.getHarness(MatButtonHarness.with({ text: 'Add' }));
await addButton.click();

expect(spectator.inject(SlideInService).open).toHaveBeenCalledWith(ApiKeyFormComponent, { data: undefined });
});

it('renders a button that opens API docs', async () => {
const docsButton = await loader.getHarness(MatButtonHarness.with({ text: 'API Docs' }));
const host = await docsButton.host();

expect(docsButton).toBeTruthy();
expect(await host.getAttribute('href')).toBe('/api/docs');
});

it('should show table rows', async () => {
const expectedRows = [
['Name', 'Username', 'Local', 'Revoked', 'Created Date', 'Expires Date', ''],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AsyncPipe } from '@angular/common';
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { MatButton } from '@angular/material/button';
import { MatAnchor, MatButton } from '@angular/material/button';
import { ActivatedRoute } from '@angular/router';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
Expand Down Expand Up @@ -67,6 +67,7 @@ import { ApiService } from 'app/services/websocket/api.service';
TranslateModule,
AsyncPipe,
PageHeaderComponent,
MatAnchor,
],
})
export class UserApiKeysComponent implements OnInit {
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"A unique name to identify this keypair. Automatically generated keypairs are named after the object that generated the keypair with \" Key\" appended to the name.": "",
"A username on the FTP Host system. This user must already exist on the FTP Host.": "",
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"API Docs": "",
"API Key Read": "",
"API Key Write": "",
"Absent": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key Read": "",
"API Key Write": "",
"ARN": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/dsb.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en-au.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en-gb.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/eo.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/es-ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"ACME Server Directory URI": "",
"AD Timeout": "",
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"API Docs": "",
"API Key Read": "",
"API Key Write": "",
"ARN": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/es-co.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/es-mx.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/es-ni.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/es-ve.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/eu.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"ACME Server Directory URI": "",
"AD Timeout": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key Read": "",
"API Key Write": "",
"Absent": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/fy.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"ALERT": "",
"ALL Initiators Allowed": "",
"API Docs": "",
"API Key": "",
"API Key Read": "",
"API Key Write": "",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/ga.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"1m Average": "",
"<p>The system will restart to perform this operation!</p> <p><font color=\"red\">All passwords are reset when the uploaded configuration database file was saved without the Password Secret Seed. </font></p>": "",
"AD users and groups by default will have a domain name prefix (`DOMAIN\\`). In some edge cases this may cause erratic behavior from some clients and applications that are poorly designed and cannot handle the prefix. Set only if required for a specific application or client. Note that using this setting is not recommended as it may cause collisions with local user account names.": "",
"API Docs": "",
"API Key Read": "",
"API Key Write": "",
"Absent": "",
Expand Down
Loading

0 comments on commit 2aa2242

Please sign in to comment.