Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(validation): Callout validation (Part 2) #19

Merged
merged 19 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions beabee-client/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
"test:deno": "deno test --allow-net --allow-read --allow-write --allow-env --allow-ffi ./test/deno",
"test:node": "npm run test:node",
"test:web": "npm run test:web",
"lint": "deno lint",
"lint": "deno lint mod.ts src",
"format": "deno fmt",
"check": "deno task check:format",
"check": "deno task check:types && deno task check:format",
"check:format": "deno task format --check",
"check:types": "deno check mod.ts",
"cache": "deno task cache:deno && deno task cache:node",
"cache:deno": "deno cache --reload mod.ts",
"cache:node": "npm install",
Expand All @@ -26,6 +27,6 @@
"std/": "https://deno.land/[email protected]/",
"@beabee/beabee-common": "../beabee-common/mod.ts",
"@beabee/client": "./mod.ts",
"date-fns": "npm:date-fns@3.2.0"
"date-fns": "npm:date-fns@3.3.1"
}
}
74 changes: 5 additions & 69 deletions beabee-client/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions beabee-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions beabee-client/src/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export type {
PaymentStatus,
RoleType,
RuleGroup,
StripeFeeCountry,
} from "@beabee/beabee-common";
7 changes: 5 additions & 2 deletions beabee-client/src/types/content-join.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { ContributionPeriod, PaymentMethod } from "../deps.ts";
import type { StripeFeeCountry } from "./index.ts";
import type {
ContributionPeriod,
PaymentMethod,
StripeFeeCountry,
} from "../deps.ts";

export interface ContentJoin {
title: string;
Expand Down
1 change: 0 additions & 1 deletion beabee-client/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export * from "./set-contribution-data.ts";
export * from "./start-contribution-data.ts";
export * from "./stripe-bacs-payment-source.ts";
export * from "./stripe-card-payment-source.ts";
export * from "./stripe-fee-country.ts";
export * from "./stripe-sepa-payment-source.ts";
export * from "./update-callout-data.ts";
export * from "./update-callout-response-comment-data.ts";
Expand Down
1 change: 0 additions & 1 deletion beabee-client/src/types/stripe-fee-country.ts

This file was deleted.

2 changes: 1 addition & 1 deletion beabee-common
Submodule beabee-common updated 32 files
+3 −0 .github/workflows/ci.yml
+3 −2 .vscode/settings.json
+8 −5 deno.json
+5 −6 deno.lock
+9 −9 package-lock.json
+16 −8 package.json
+1 −0 src/search/index.ts
+13 −0 src/search/segments.ts
+1 −1 src/types/callout-component-base-input-selectable-schema.ts
+1 −1 src/types/callout-component-base-schema.ts
+0 −2 src/types/callout-response-answer.ts
+2 −2 src/types/callout-response-answers-nestable.ts
+1 −0 src/types/index.ts
+3 −0 src/types/segment-filter-name.ts
+9 −4 src/types/validator-callout-component.ts
+2 −2 src/utils/callouts.ts
+2 −1 src/validators/callout-component-content.validator.ts
+2 −7 src/validators/callout-component-input-address.validator.ts
+2 −6 src/validators/callout-component-input-checkbox.validator.ts
+2 −6 src/validators/callout-component-input-currency.validator.ts
+1 −5 src/validators/callout-component-input-date-time.validator.ts
+3 −13 src/validators/callout-component-input-email.validator.ts
+8 −8 src/validators/callout-component-input-file.validator.ts
+1 −6 src/validators/callout-component-input-number.validator.ts
+2 −7 src/validators/callout-component-input-phone-number.validator.ts
+1 −12 src/validators/callout-component-input-select.validator.ts
+1 −17 src/validators/callout-component-input-selectable.validator.ts
+1 −1 src/validators/callout-component-input-signature.validator.ts
+7 −8 src/validators/callout-component-input-text.validator.ts
+2 −7 src/validators/callout-component-input-time.validator.ts
+3 −13 src/validators/callout-component-input-url.validator.ts
+81 −44 src/validators/callout-component.validator.ts
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"sqlite3": "https://deno.land/x/[email protected]/mod.ts",
"@beabee/beabee-common": "./beabee-common/mod.ts",
"@beabee/beabee-client": "../beabee-client/mod.ts",
"date-fns": "npm:date-fns@3.2.0"
"date-fns": "npm:date-fns@3.3.1"
},
"scopes": {
"https://raw.githubusercontent.com/Zhomart/dex/": {
Expand Down
11 changes: 8 additions & 3 deletions telegram-bot-deno.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"folders": [
{
"path": ".",
"name": "root"
"name": "_root"
},
{
"path": "./telegram-bot",
Expand All @@ -11,6 +11,10 @@
{
"path": "./beabee-client",
"name": "beabee-client"
},
{
"path": "./beabee-common",
"name": "beabee-common"
}
],
"settings": {
Expand All @@ -23,6 +27,8 @@
"denodb",
"selectboxes"
],
"prettier.enable": false,
"eslint.enable": false,
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
Expand All @@ -35,13 +41,12 @@
"./beabee-client/jest.config.web.js",
"./beabee-client/jest.config.node.js",
"./beabee-common/dist",
"./beabee-common/scripts",
"./beabee-common/test/node",
"./beabee-common/jest.config.js"
],
"editor.defaultFormatter": "denoland.vscode-deno",
"editor.formatOnSave": true,
"typescript.format.enable": true,
"typescript.format.enable": true
},
"launch": {
"version": "0.2.0",
Expand Down
4 changes: 2 additions & 2 deletions telegram-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ To update the locale data in the repository you run the following

```
deno task i18n
git add -A locales/ && git commit locales/ -m 'chore: updated locales'
git add -A locales/ && git commit locales/ -m 'chore(i18n): Updated locales'
```

#### Using the localisation strings
Expand All @@ -63,7 +63,7 @@ import { container } from "../deps.ts";
import { I18nService } from "./services/index.ts";

const i18n = container.resolve(I18nService); // Get the Singleton instance of I18nService
const translated = i18n.t("info.messages.placeholder", { placeholder: "Hello World!" }
const translated = i18n.t("bot.info.messages.placeholder", { placeholder: "Hello World!" }
```

### Testing
Expand Down
4 changes: 2 additions & 2 deletions telegram-bot/core/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export abstract class Command implements BotCommand {
*/
changeLocale(lang: string) {
// FIXME: This is not working on runtime
// this.command = this.i18n.t(`commands.${this.key}.command`, {}, lang);
// this.command = this.i18n.t(`bot.commands.${this.key}.command`, {}, lang);
this.description = this.i18n.t(
`commands.${this.key}.description`,
`bot.commands.${this.key}.description`,
{},
lang,
);
Expand Down
5 changes: 3 additions & 2 deletions telegram-bot/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"std/": "https://deno.land/[email protected]/",
"typeorm": "npm:[email protected]",
"sqlite3": "https://deno.land/x/[email protected]/mod.ts",
"date-fns": "npm:date-fns@3.2.0",
"date-fns": "npm:date-fns@3.3.1",
"@beabee/beabee-common": "../beabee-common/mod.ts",
"@beabee/beabee-client": "../beabee-client/mod.ts"
},
Expand All @@ -31,8 +31,9 @@
"test": "deno test --allow-net --allow-read --allow-write --allow-env --allow-ffi --unstable-ffi",
"lint": "deno lint",
"format": "deno fmt",
"check": "deno task check:format",
"check": "deno task check:types && deno task check:format",
"check:format": "deno task format --check",
"check:types": "deno check main.ts",
"cache": "deno cache --reload main.ts",
"docker:build": "docker build -f ../Dockerfile -t beabee/telegram-bot:latest ..",
"docker:start": "docker run -it --init -p 3003:3003 beabee/telegram-bot",
Expand Down
Loading
Loading