TD-694: Add spell checker (#143)

This commit is contained in:
Rinat Arsaev 2023-08-14 18:03:12 +04:00 committed by GitHub
parent e67db789aa
commit 1a1099d8f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 1293 additions and 151 deletions

View File

@ -15,7 +15,7 @@ jobs:
with: with:
path: ./* path: ./*
key: ${{ github.sha }} key: ${{ github.sha }}
prettier: format:
name: Format check name: Format check
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [init] needs: [init]
@ -28,8 +28,8 @@ jobs:
key: ${{ github.sha }} key: ${{ github.sha }}
- name: Check - name: Check
run: npm run format run: npm run format
eslint: lint:
name: ESLint check name: Lint check
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [init] needs: [init]
steps: steps:
@ -54,6 +54,19 @@ jobs:
key: ${{ github.sha }} key: ${{ github.sha }}
- name: Check - name: Check
run: npm run i18n:check run: npm run i18n:check
spell:
name: Spell check
runs-on: ubuntu-latest
needs: [init]
steps:
- name: Cache all
uses: actions/cache@v3
id: cache
with:
path: ./*
key: ${{ github.sha }}
- name: Check
run: npm run spell
build: build:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest

40
.vscode/settings.json vendored
View File

@ -1,44 +1,4 @@
{ {
"typescript.tsdk": "node_modules/typescript/lib", "typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": [
"CAPI",
"FATCA",
"Metrika",
"OGRN",
"OKVED",
"SNILS",
"Yandex",
"actionbar",
"anapi",
"anthroponym",
"codegen",
"dadata",
"datepicker",
"daterange",
"downlevel",
"dropdown",
"esnext",
"innfl",
"isempty",
"keycloak",
"mastercard",
"multiselect",
"ngneat",
"pdfmake",
"rbkmoney",
"roboto",
"snils",
"submodule",
"transloco",
"webvisor",
"ЕГРЮЛ",
"СНИЛС",
"бенефициарного",
"бенефициарные",
"бенефициарный",
"инвойс",
"инвойса"
],
"cSpell.language": "en,ru",
"prettier.prettierPath": "node_modules/prettier" "prettier.prettierPath": "node_modules/prettier"
} }

74
cspell.json Normal file
View File

@ -0,0 +1,74 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"import": "node_modules/@vality/cspell-config/cspell.config.js",
"ignorePaths": ["**/country-codes.ts"],
"words": [
"transloco",
"xrequest",
"klass",
"aggr",
"kontur",
"unflat",
"datepicker",
"autoselect",
"semipolar",
"autofilled",
"describedby",
"capitilize",
"easeinout",
"crosshairs",
"apexcharts",
"yaxis",
"xaxis",
"initializable",
"daterange",
"ngxd",
"TOTP",
"actionbar",
"topo",
"toponim",
"dadata",
"unlim",
"apikeys",
"anapi",
"libphonenumber",
"SNILS",
"ОГРН",
"OGRNIP",
"ОГРНИП",
"ABARTN",
"OGRN",
"OKVED",
"мсек",
"dankort",
"forbrugsforeningen",
"QIWI",
"uzcard",
"euroset",
"yandex",
"samsungpay",
"googlepay",
"applepay",
"rupay",
"visaelectron",
"unionpay",
"nspkmir",
"dinersclub",
"yandexpay",
"chargedback",
"авторитативности",
"предавторизация",
"предавторизации",
"мерчант",
"мерчанта",
"licences"
]
}

1229
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
"scripts": { "scripts": {
"start": "ng serve --proxy-config proxy.conf.js --port 8000", "start": "ng serve --proxy-config proxy.conf.js --port 8000",
"stage": "cross-env NODE_ENV=stage ng serve --proxy-config proxy.conf.js --port 8001 --configuration=stage", "stage": "cross-env NODE_ENV=stage ng serve --proxy-config proxy.conf.js --port 8001 --configuration=stage",
"fix": "npm run lint:fix && npm run format:fix", "fix": "npm run lint:fix && npm run format:fix && npm run spell:fix",
"build": "ng build && transloco-optimize dist/assets/i18n", "build": "ng build && transloco-optimize dist/assets/i18n",
"test": "ng test", "test": "ng test",
"i18n:extract": "transloco-keys-manager extract", "i18n:extract": "transloco-keys-manager extract",
@ -20,7 +20,9 @@
"tools-cmd": "ts-node --project tools/tsconfig.json", "tools-cmd": "ts-node --project tools/tsconfig.json",
"icons-list-gen": "npm run tools-cmd -- tools/gen-icons-list.ts", "icons-list-gen": "npm run tools-cmd -- tools/gen-icons-list.ts",
"icons-ids-gen": "npm run tools-cmd -- tools/gen-icons-ids.ts", "icons-ids-gen": "npm run tools-cmd -- tools/gen-icons-ids.ts",
"ci:test": "npm run test -- --configuration=ci" "ci:test": "npm run test -- --configuration=ci",
"spell": "cspell --no-progress **",
"spell:fix": "cspell --no-progress --show-suggestions --show-context **"
}, },
"dependencies": { "dependencies": {
"@angular/animations": "^16.2.0", "@angular/animations": "^16.2.0",
@ -86,9 +88,11 @@
"@types/lodash-es": "4.17.6", "@types/lodash-es": "4.17.6",
"@types/moment": "2.13.0", "@types/moment": "2.13.0",
"@types/prettier": "^3.0.0", "@types/prettier": "^3.0.0",
"@vality/cspell-config": "^7.0.1-pr-33-52841c7.0",
"@vality/eslint-config": "^8.0.1-pr-33-52841c7.0", "@vality/eslint-config": "^8.0.1-pr-33-52841c7.0",
"@vality/prettier-config": "3.0.1-pr-33-52841c7.0", "@vality/prettier-config": "3.0.1-pr-33-52841c7.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"cspell": "^7.0.0",
"dotenv": "^16.0.3", "dotenv": "^16.0.3",
"eslint": "^8.47.0", "eslint": "^8.47.0",
"glob": "^7.1.6", "glob": "^7.1.6",

View File

@ -9,7 +9,7 @@ import { MOCK_MEMBER_ROLE } from './mock-member-role';
export const MOCK_INVITEE_CONTACT: InviteeContact = { export const MOCK_INVITEE_CONTACT: InviteeContact = {
type: InviteeContact.TypeEnum.EMail, type: InviteeContact.TypeEnum.EMail,
email: 'user@rbkmoney.com', email: 'user@vality.dev',
}; };
export const MOCK_INVITEE: Invitee = { export const MOCK_INVITEE: Invitee = {
@ -23,6 +23,6 @@ export const MOCK_INVITATION: Invitation = {
expiresAt: '2020-11-21T18:43:00.000000Z', expiresAt: '2020-11-21T18:43:00.000000Z',
invitee: MOCK_INVITEE, invitee: MOCK_INVITEE,
acceptToken: 'token', acceptToken: 'token',
metadata: { metameta: 'postpost' }, metadata: { metaMeta: 'postPost' },
status: InvitationStatusName.Pending, status: InvitationStatusName.Pending,
}; };

View File

@ -4,5 +4,5 @@ export const MOCK_ORG: Organization = {
id: '9d560cdb-ce17-4ba5-b5c6-cc9c0eb1ad19', id: '9d560cdb-ce17-4ba5-b5c6-cc9c0eb1ad19',
createdAt: '2020-10-30T19:30:57Z', createdAt: '2020-10-30T19:30:57Z',
name: 'Organization name #3', name: 'Organization name #3',
owner: 'user@rbkmoney.com', owner: 'user@vality.dev',
}; };

View File

@ -75,7 +75,7 @@ describe('MembersComponent', () => {
}); });
describe('refresh', () => { describe('refresh', () => {
it('should load memebers$', () => { it('should load members$', () => {
component.members$.subscribe(); component.members$.subscribe();
component.refresh(); component.refresh();
verify(mockOrganizationsService.listOrgMembers(MOCK_ORG.id)).twice(); verify(mockOrganizationsService.listOrgMembers(MOCK_ORG.id)).twice();

View File

@ -1,12 +1,12 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { OrginizationSectionComponent } from './organization-section.component'; import { OrganizationSectionComponent } from './organization-section.component';
const ORGANIZATION_SECTION_ROUTES: Routes = [ const ORGANIZATION_SECTION_ROUTES: Routes = [
{ {
path: '', path: '',
component: OrginizationSectionComponent, component: OrganizationSectionComponent,
children: [ children: [
{ {
path: 'organizations', path: 'organizations',
@ -35,4 +35,4 @@ const ORGANIZATION_SECTION_ROUTES: Routes = [
imports: [RouterModule.forChild(ORGANIZATION_SECTION_ROUTES)], imports: [RouterModule.forChild(ORGANIZATION_SECTION_ROUTES)],
exports: [RouterModule], exports: [RouterModule],
}) })
export class OrginizationSectionRoutingModule {} export class OrganizationSectionRoutingModule {}

View File

@ -3,4 +3,4 @@ import { Component } from '@angular/core';
@Component({ @Component({
template: `<router-outlet></router-outlet>`, template: `<router-outlet></router-outlet>`,
}) })
export class OrginizationSectionComponent {} export class OrganizationSectionComponent {}

View File

@ -1,13 +1,13 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { TRANSLOCO_SCOPE } from '@ngneat/transloco'; import { TRANSLOCO_SCOPE } from '@ngneat/transloco';
import { OrginizationSectionRoutingModule } from './organization-section-routing.module'; import { OrganizationSectionRoutingModule } from './organization-section-routing.module';
import { OrginizationSectionComponent } from './organization-section.component'; import { OrganizationSectionComponent } from './organization-section.component';
@NgModule({ @NgModule({
imports: [OrginizationSectionRoutingModule], imports: [OrganizationSectionRoutingModule],
declarations: [OrginizationSectionComponent], declarations: [OrganizationSectionComponent],
exports: [OrginizationSectionComponent], exports: [OrganizationSectionComponent],
providers: [{ provide: TRANSLOCO_SCOPE, useValue: 'organization-section' }], providers: [{ provide: TRANSLOCO_SCOPE, useValue: 'organization-section' }],
}) })
export class OrginizationSectionModule {} export class OrganizationSectionModule {}

View File

@ -6,7 +6,7 @@ import { TokenProvider, PaymentSystem } from '@dsh/app/api/payments';
interface BankCardIconConfig { interface BankCardIconConfig {
iconName: string; iconName: string;
width: string; width: string;
heigth: string; height: string;
} }
@Component({ @Component({
@ -20,11 +20,11 @@ export class BankCardComponent {
getPaymentSystemIconConfig(paymentSystem: PaymentSystem): BankCardIconConfig { getPaymentSystemIconConfig(paymentSystem: PaymentSystem): BankCardIconConfig {
switch (paymentSystem) { switch (paymentSystem) {
case PaymentSystem.Visa: case PaymentSystem.Visa:
return { iconName: 'visa', width: '32px', heigth: '24px' }; return { iconName: 'visa', width: '32px', height: '24px' };
case PaymentSystem.MasterCard: case PaymentSystem.MasterCard:
return { iconName: 'mastercard', width: '24px', heigth: '24px' }; return { iconName: 'mastercard', width: '24px', height: '24px' };
case PaymentSystem.Mir: case PaymentSystem.Mir:
return { iconName: 'mir', width: '32px', heigth: '24px' }; return { iconName: 'mir', width: '32px', height: '24px' };
default: default:
return null; return null;
} }
@ -33,13 +33,13 @@ export class BankCardComponent {
getTokenProviderIconConfig(tokenProvider: TokenProvider): BankCardIconConfig { getTokenProviderIconConfig(tokenProvider: TokenProvider): BankCardIconConfig {
switch (tokenProvider) { switch (tokenProvider) {
case TokenProvider.SamsungPay: case TokenProvider.SamsungPay:
return { iconName: 'samsung_pay', width: '100px', heigth: '27px' }; return { iconName: 'samsung_pay', width: '100px', height: '27px' };
case TokenProvider.GooglePay: case TokenProvider.GooglePay:
return { iconName: 'google_pay', width: '40px', heigth: '26px' }; return { iconName: 'google_pay', width: '40px', height: '26px' };
case TokenProvider.ApplePay: case TokenProvider.ApplePay:
return { iconName: 'apple_pay', width: '24px', heigth: '24px' }; return { iconName: 'apple_pay', width: '24px', height: '24px' };
case TokenProvider.YandexPay: case TokenProvider.YandexPay:
return { iconName: 'yandex_pay', width: '44px', heigth: '24px' }; return { iconName: 'yandex_pay', width: '44px', height: '24px' };
default: default:
return null; return null;
} }

View File

@ -17,7 +17,7 @@ const ROUTES: Routes = [
{ {
path: 'organization-section', path: 'organization-section',
loadChildren: () => loadChildren: () =>
import('./organization-section').then((m) => m.OrginizationSectionModule), import('./organization-section').then((m) => m.OrganizationSectionModule),
}, },
{ {
path: '', path: '',

View File

@ -10,7 +10,7 @@ import { StatusToColorPipe } from './status-to-color.pipe';
import { WithdrawalInfoComponent } from './withdrawal-info.component'; import { WithdrawalInfoComponent } from './withdrawal-info.component';
/** /**
* @deprecated have to delete after redisign * @deprecated have to delete after redesign
*/ */
@NgModule({ @NgModule({
imports: [CommonModule, FlexModule, DetailsItemModule, TranslocoModule, AmountCurrencyModule], imports: [CommonModule, FlexModule, DetailsItemModule, TranslocoModule, AmountCurrencyModule],

View File

@ -4,7 +4,7 @@ import { InvoiceStatus } from '@vality/swag-anapi-v2';
import { combineLatest, Observable } from 'rxjs'; import { combineLatest, Observable } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { InvoiceStatusLabelPipe } from './pipes/invoce-status-label.pipe'; import { InvoiceStatusLabelPipe } from './pipes/invoice-status-label.pipe';
import { OPTION_LABELS } from './types/option-labels'; import { OPTION_LABELS } from './types/option-labels';
import StatusEnum = InvoiceStatus.StatusEnum; import StatusEnum = InvoiceStatus.StatusEnum;

View File

@ -6,7 +6,7 @@ import { TranslocoModule } from '@ngneat/transloco';
import { RadioGroupFieldModule } from '@dsh/components/form-controls/radio-group-field'; import { RadioGroupFieldModule } from '@dsh/components/form-controls/radio-group-field';
import { InvoiceStatusFieldComponent } from './invoice-status-field.component'; import { InvoiceStatusFieldComponent } from './invoice-status-field.component';
import { InvoiceStatusLabelPipe } from './pipes/invoce-status-label.pipe'; import { InvoiceStatusLabelPipe } from './pipes/invoice-status-label.pipe';
@NgModule({ @NgModule({
imports: [CommonModule, TranslocoModule, ReactiveFormsModule, RadioGroupFieldModule], imports: [CommonModule, TranslocoModule, ReactiveFormsModule, RadioGroupFieldModule],

View File

@ -8,7 +8,7 @@ export function getAbstractControl<Control extends AbstractControl, GroupType =
path: string, path: string,
) { ) {
if (isEmpty(path)) { if (isEmpty(path)) {
throw new Error(`Path can't be an emtpy string`); throw new Error(`Path can't be an empty string`);
} }
if (isNil(form.get(path))) { if (isNil(form.get(path))) {
throw new Error(`Can't get a control by path "${path}"`); throw new Error(`Can't get a control by path "${path}"`);

View File

@ -314,12 +314,12 @@
"message": "Банковская карта отклонена", "message": "Банковская карта отклонена",
"unknown": "Причина неизвестна" "unknown": "Причина неизвестна"
}, },
"message": "Платёжный интрумент отклонён", "message": "Платёжный инструмент отклонён",
"unknown": "Неизвестный платёжный интрумент" "unknown": "Неизвестный платёжный инструмент"
}, },
"provider_limit_exceeded": { "provider_limit_exceeded": {
"amount": "Лимит на сумму", "amount": "Лимит на сумму",
"message": "Превышен лимит на мерчанта у провайдера (вас или платформы RBKmoney)", "message": "Превышен лимит на мерчанта у провайдера (вас или платформы)",
"number": "Лимит на количество попыток", "number": "Лимит на количество попыток",
"unknown": "Объект лимита неизвестен" "unknown": "Объект лимита неизвестен"
}, },

View File

@ -114,10 +114,10 @@ export class DropdownTriggerDirective implements OnDestroy {
} }
private removeWindowListeners() { private removeWindowListeners() {
let unlisten = this.removeWindowListenersFns.pop(); let unlisted = this.removeWindowListenersFns.pop();
while (unlisten) { while (unlisted) {
unlisten(); unlisted();
unlisten = this.removeWindowListenersFns.pop(); unlisted = this.removeWindowListenersFns.pop();
} }
} }

View File

@ -1,5 +1,5 @@
@mixin mat-theme-loaded-marker-override() { @mixin mat-theme-loaded-marker-override() {
// Supress warning message: "Could not find Angular Material core theme. ..." // Suppress warning message: "Could not find Angular Material core theme. ..."
// Theme is added asynchronously and this check is not needed // Theme is added asynchronously and this check is not needed
.mat-mdc-theme-loaded-marker { .mat-mdc-theme-loaded-marker {
display: none; display: none;

View File

@ -9,7 +9,7 @@ describe('removeDictEmptyFields', () => {
data = { data = {
a: '1', a: '1',
b: '22', b: '22',
c: '0afaf', c: '0test',
d: '', d: '',
e: '7', e: '7',
g: '', g: '',
@ -18,7 +18,7 @@ describe('removeDictEmptyFields', () => {
expect(removeDictEmptyFields(data)).toEqual({ expect(removeDictEmptyFields(data)).toEqual({
a: '1', a: '1',
b: '22', b: '22',
c: '0afaf', c: '0test',
e: '7', e: '7',
}); });
}); });