mirror of
https://github.com/valitydev/dashboard.git
synced 2024-11-06 02:25:23 +00:00
OPS-339: Replace api keys page (#144)
This commit is contained in:
parent
8a70a839e0
commit
c152e05222
2
.github/workflows/main.yaml
vendored
2
.github/workflows/main.yaml
vendored
@ -1,7 +1,7 @@
|
||||
name: Main
|
||||
on:
|
||||
push:
|
||||
branches: ['master', 'main']
|
||||
branches: ['master', 'main', 'epic/**']
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
|
@ -1,16 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
|
||||
import { ApiKeyComponent } from './api-key.component';
|
||||
|
||||
const ROUTES: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ApiKeyComponent,
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(ROUTES)],
|
||||
})
|
||||
export class ApiKeyRoutingModule {}
|
@ -1,31 +0,0 @@
|
||||
<dsh-card
|
||||
*transloco="let t; scope: 'payment-section'; read: 'paymentSection.apiKey'"
|
||||
fxLayout="column"
|
||||
>
|
||||
<dsh-card-content fxLayout="column" fxLayoutGap="32px">
|
||||
<div class="dsh-headline">{{ t('title') }}</div>
|
||||
<div fxLayout="column" fxLayoutGap="24px">
|
||||
<div class="dsh-subheading-2">
|
||||
{{ t('description') }}
|
||||
<a [href]="paymentsApiSpecEndpoint" target="_blank">{{ t('api') }}</a>
|
||||
</div>
|
||||
<div class="ym-hide-content" fxLayout="column" fxLayoutGap="32px">
|
||||
<mat-form-field>
|
||||
<input [value]="token$ | async" class="ym-disable-keys" matInput readonly />
|
||||
</mat-form-field>
|
||||
<div fxLayout fxLayoutAlign="stretch" fxLayoutAlign.gt-sm="end">
|
||||
<button
|
||||
[cdkCopyToClipboard]="token$ | async"
|
||||
color="accent"
|
||||
dsh-button
|
||||
fxFlex
|
||||
fxFlex.gt-sm="none"
|
||||
(cdkCopyToClipboardCopied)="copied($event)"
|
||||
>
|
||||
{{ t('copy') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</dsh-card-content>
|
||||
</dsh-card>
|
@ -1,3 +0,0 @@
|
||||
:host {
|
||||
width: 100%;
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { TranslocoService } from '@ngneat/transloco';
|
||||
import { KeycloakService } from 'keycloak-angular';
|
||||
import { from } from 'rxjs';
|
||||
|
||||
import { NotificationService } from '@dsh/app/shared';
|
||||
|
||||
import { ConfigService } from '../../../../config';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'api-key.component.html',
|
||||
styleUrls: ['api-key.component.scss'],
|
||||
})
|
||||
export class ApiKeyComponent {
|
||||
token$ = from(this.keycloakService.getToken());
|
||||
paymentsApiSpecEndpoint = this.configService.docsEndpoints.payments;
|
||||
|
||||
constructor(
|
||||
private keycloakService: KeycloakService,
|
||||
private configService: ConfigService,
|
||||
private notificationService: NotificationService,
|
||||
private transloco: TranslocoService,
|
||||
) {}
|
||||
|
||||
copied(isCopied: boolean): void {
|
||||
if (isCopied)
|
||||
this.notificationService.success(
|
||||
this.transloco.translate('shared.copied', null, 'components'),
|
||||
);
|
||||
else
|
||||
this.notificationService.success(
|
||||
this.transloco.translate('shared.copyFailed', null, 'components'),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
import { ClipboardModule } from '@angular/cdk/clipboard';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FlexModule } from '@angular/flex-layout';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { TranslocoModule } from '@ngneat/transloco';
|
||||
|
||||
import { ButtonModule } from '@dsh/components/buttons';
|
||||
import { CardModule } from '@dsh/components/layout';
|
||||
|
||||
import { ApiKeyRoutingModule } from './api-key-routing.module';
|
||||
import { ApiKeyComponent } from './api-key.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
ApiKeyRoutingModule,
|
||||
FlexModule,
|
||||
TranslocoModule,
|
||||
CardModule,
|
||||
MatInputModule,
|
||||
CommonModule,
|
||||
ButtonModule,
|
||||
ClipboardModule,
|
||||
],
|
||||
declarations: [ApiKeyComponent],
|
||||
})
|
||||
export class ApiKeyModule {}
|
@ -1 +0,0 @@
|
||||
export * from './api-key.module';
|
@ -3,8 +3,6 @@ import { RouterModule, Routes } from '@angular/router';
|
||||
|
||||
import { createPrivateRoute, RoleAccessName } from '@dsh/app/auth';
|
||||
|
||||
import { environment } from '../../../../environments';
|
||||
|
||||
import { IntegrationsComponent } from './integrations.component';
|
||||
|
||||
const ROUTES: Routes = [
|
||||
@ -29,9 +27,7 @@ const ROUTES: Routes = [
|
||||
createPrivateRoute(
|
||||
{
|
||||
path: 'api-keys',
|
||||
loadChildren: environment.stage
|
||||
? () => import('./api-keys').then((m) => m.ApiKeysModule)
|
||||
: () => import('./api-key').then((m) => m.ApiKeyModule),
|
||||
loadChildren: () => import('./api-keys').then((m) => m.ApiKeysModule),
|
||||
},
|
||||
[RoleAccessName.ApiKeys],
|
||||
),
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { TranslocoService } from '@ngneat/transloco';
|
||||
|
||||
import { environment } from '../../../../environments';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'integrations.component.html',
|
||||
})
|
||||
@ -18,17 +16,11 @@ export class IntegrationsComponent {
|
||||
},
|
||||
{
|
||||
path: 'api-keys',
|
||||
label$: environment.stage
|
||||
? this.transloco.selectTranslate(
|
||||
'integrations.tabs.api-keys',
|
||||
null,
|
||||
'payment-section',
|
||||
)
|
||||
: this.transloco.selectTranslate(
|
||||
'integrations.tabs.api-key',
|
||||
null,
|
||||
'payment-section',
|
||||
),
|
||||
label$: this.transloco.selectTranslate(
|
||||
'integrations.tabs.api-keys',
|
||||
null,
|
||||
'payment-section',
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'webhooks',
|
||||
|
@ -12,12 +12,6 @@
|
||||
},
|
||||
"unsuccessfulPaymentReasons": "Unsuccessful payments reasons"
|
||||
},
|
||||
"apiKey": {
|
||||
"api": "API",
|
||||
"copy": "Copy",
|
||||
"description": "Your private key to access the",
|
||||
"title": "API key"
|
||||
},
|
||||
"apiKeys": {
|
||||
"apiKey": "API key",
|
||||
"copy": {
|
||||
@ -116,7 +110,6 @@
|
||||
},
|
||||
"integrations": {
|
||||
"tabs": {
|
||||
"api-key": "API KEY",
|
||||
"api-keys": "API KEYS",
|
||||
"payment-link": "PAYMENT LINK",
|
||||
"webhooks": "WEBHOOKS"
|
||||
|
@ -12,12 +12,6 @@
|
||||
},
|
||||
"unsuccessfulPaymentReasons": "Причины неуспешных платежей"
|
||||
},
|
||||
"apiKey": {
|
||||
"api": "API",
|
||||
"copy": "Скопировать",
|
||||
"description": "Ваш приватный ключ для доступа к",
|
||||
"title": "API ключ"
|
||||
},
|
||||
"apiKeys": {
|
||||
"apiKey": "API ключ",
|
||||
"copy": {
|
||||
@ -116,7 +110,6 @@
|
||||
},
|
||||
"integrations": {
|
||||
"tabs": {
|
||||
"api-key": "API КЛЮЧ",
|
||||
"api-keys": "API КЛЮЧИ",
|
||||
"payment-link": "ПЛАТЕЖНАЯ ССЫЛКА",
|
||||
"webhooks": "WEBHOOKS"
|
||||
|
Loading…
Reference in New Issue
Block a user