opnform-host-nginx/client
Chirag Chhatrala 865eac19cb
Add Telegram Notification Integration (#732)
* Add Telegram Notification Integration

- Introduce Telegram Notification integration to the forms configuration.
- Add necessary properties including name, icon, section name, file name, actions file name, and pro status.

This update enhances the notification options available in the application, allowing users to integrate Telegram for notifications.

* Add Telegram integration support

- Updated .env.example to include Telegram bot configuration variables.
- Added the Telegram driver to OAuthProviderService for handling Telegram authentication.
- Created OAuthTelegramDriver class to manage Telegram OAuth interactions.
- Registered Telegram service in services.php with necessary credentials.
- Updated ProviderModal and TelegramIntegration components to support Telegram account connection and widget integration.
- Refactored integration forms to utilize FlatSelectInput for selecting Telegram accounts.

These changes enable users to connect their Telegram accounts for notifications, enhancing the integration capabilities of the application.

* Enhance Telegram integration and refactor settings components

- Added Telegram configuration to FeatureFlagsController for bot and redirect settings.
- Updated nuxt.config.ts to include settings components path for better organization.
- Refactored TelegramIntegration component to navigate to settings on connect.
- Renamed and updated ProviderModal and ProviderWidgetModal for consistency.
- Introduced TelegramWidget component for dynamic loading of the Telegram login widget.
- Refactored access tokens and connections pages to use updated component names.

These changes improve the Telegram integration and streamline the settings management interface.

* Refactor Telegram integration for widget-based authentication

- Updated .env.example to rename Telegram bot configuration variable from TELEGRAM_BOT_NAME to TELEGRAM_BOT_ID.
- Removed the Telegram provider from composer.json to streamline dependencies.
- Enhanced FeatureFlagsController to support new bot_id configuration.
- Implemented handleWidgetRedirect method in OAuthProviderController for handling widget authentication.
- Created WidgetOAuthDriver interface and refactored OAuthTelegramDriver to implement widget-based authentication methods.
- Updated services.php to reflect changes in Telegram configuration.
- Added widget callback route for handling authentication responses.
- Refactored TelegramWidget component to utilize the new widget authentication flow.

These changes improve the Telegram integration by enabling widget-based authentication, enhancing user experience and security.

* Enhance Telegram integration by adding provider support and refactoring data retrieval

- Introduced a new protected property `provider` in `AbstractIntegrationHandler` to store provider information.
- Updated the constructor to assign the provider from `formIntegration`.
- Refactored `getChatId` method in `TelegramIntegration` to utilize `provider_user_id` instead of the removed bot token.
- Adjusted the `shouldRun` method to include a check for `oauth_id` in `formIntegration`.

These changes improve the handling of provider data within the Telegram integration, enhancing its functionality and reliability.

* Enhance Telegram integration by adding MarkdownV2 escaping functionality

- Updated the message text formatting in the TelegramIntegration class to escape special characters for MarkdownV2.
- Introduced a new protected method `escapeMarkdownV2` to handle the escaping of special characters, improving message rendering in Telegram.

These changes enhance the Telegram integration by ensuring that messages are properly formatted for MarkdownV2, preventing potential rendering issues.

* fix pint

* Fix ESLint warning for unused variable in TelegramWidget component

* Remove unused variable declaration in TelegramWidget component to address ESLint warning. This change enhances code quality by adhering to linting rules and improving maintainability.

* Refactor Telegram integration components by removing unused code and improving maintainability

- Removed the 'refresh_token' field from the OAuthTelegramDriver as it is no longer needed.
- Eliminated unused variable declarations and interval logic in the TelegramIntegrationActions component to address ESLint warnings and enhance code quality.

These changes streamline the codebase and adhere to best practices for maintainability.

* Enhance Telegram integration by adding validation messages and improving message formatting

- Introduced custom validation messages for the `oauth_id` field in `FormIntegrationsRequest`, enhancing user feedback during integration setup.
- Refactored message construction in `TelegramIntegration` to utilize an array for building the message text, improving readability and maintainability.
- Updated the `handle` method to include error logging for missing `chat_id` and `bot token`, enhancing error handling and debugging capabilities.

These changes improve the user experience and reliability of the Telegram integration by providing clearer validation feedback and more robust error handling.

* Update environment variables documentation for clarity and consistency

- Reformatted the environment variables table for improved readability by aligning headers and descriptions.
- Added new environment variables for Telegram bot integration, including `TELEGRAM_BOT_ID` and `TELEGRAM_BOT_TOKEN`, to support enhanced notification features.
- Adjusted the warning message regarding Docker commands to improve clarity on environment variable reloading.

These changes enhance the documentation by ensuring that it is clear, consistent, and up-to-date with the latest configuration requirements.

---------

Co-authored-by: JhumanJ <julien@nahum.net>
2025-04-08 12:42:47 +02:00
..
components Add Telegram Notification Integration (#732) 2025-04-08 12:42:47 +02:00
composables Enhance ESLint Configuration and Improve Code Consistency 2025-03-27 11:07:39 +01:00
data Add Telegram Notification Integration (#732) 2025-04-08 12:42:47 +02:00
i18n/lang Add support for additional language locales (#693) 2025-02-10 12:33:52 +01:00
layouts 0351d front end linting (#377) 2024-04-15 19:39:03 +02:00
lib Decouple title from title block (#696) 2025-03-21 16:59:18 +01:00
middleware Enhance JWT Token Management and Authentication Flow (#720) 2025-03-10 17:32:17 +08:00
mixins/forms 41db1 submission editor theme fix (#500) 2024-07-24 09:50:42 +02:00
pages Add Telegram Notification Integration (#732) 2025-04-08 12:42:47 +02:00
plugins Sentry + Nuxt upgrade & (#738) 2025-04-01 17:41:10 +02:00
public Refactor Form Not Found Handling and Improve Error Response (#730) 2025-03-20 16:55:53 +01:00
scss Form Editor v2.5 (#599) 2024-10-23 10:34:51 +02:00
server 0351d front end linting (#377) 2024-04-15 19:39:03 +02:00
stores Add Telegram Notification Integration (#732) 2025-04-08 12:42:47 +02:00
.env.docker Feature flags (#543) 2024-08-27 16:49:43 +02:00
.env.example Add reCAPTCHA support and update captcha provider handling (#647) 2024-12-18 16:35:09 +01:00
.eslintrc.cjs Enhance ESLint Configuration and Improve Code Consistency 2025-03-27 11:07:39 +01:00
.gitignore Reworked docker scripts for new nuxt infrastructure (#285) 2024-01-18 16:35:45 +01:00
README.md Work in progress 2023-12-09 15:47:03 +01:00
app.config.ts Form editor v2 (#579) 2024-09-23 20:02:38 +02:00
app.vue Re-login modal (#717) 2025-03-25 10:41:11 +01:00
error.vue Track 500 errors in Sentry 2024-06-18 12:31:17 +02:00
gtm.js Migrate to GTM 2024-06-06 18:03:41 +02:00
nuxt.config.ts Add Telegram Notification Integration (#732) 2025-04-08 12:42:47 +02:00
opnform.config.js Technical docs (#553) 2024-09-02 15:33:17 +02:00
package-lock.json Sentry + Nuxt upgrade & (#738) 2025-04-01 17:41:10 +02:00
package.json Sentry + Nuxt upgrade & (#738) 2025-04-01 17:41:10 +02:00
runtimeConfig.js Add client linting to GitHub Actions workflow 2025-01-27 18:24:27 +01:00
sentry.client.config.ts Sentry + Nuxt upgrade & (#738) 2025-04-01 17:41:10 +02:00
sentry.server.config.ts Sentry + Nuxt upgrade & (#738) 2025-04-01 17:41:10 +02:00
sitemap.js 0351d front end linting (#377) 2024-04-15 19:39:03 +02:00
tailwind.config.js Refactor form components (#659) 2025-01-03 16:15:47 +01:00
tsconfig.json Work in progress 2023-12-09 15:47:03 +01:00

README.md

Nuxt 3 Minimal Starter

Look at the Nuxt 3 documentation to learn more.

Setup

Make sure to install the dependencies:

# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install

Development Server

Start the development server on http://localhost:3000:

# npm
npm run dev

# pnpm
pnpm run dev

# yarn
yarn dev

# bun
bun run dev

Production

Build the application for production:

# npm
npm run build

# pnpm
pnpm run build

# yarn
yarn build

# bun
bun run build

Locally preview production build:

# npm
npm run preview

# pnpm
pnpm run preview

# yarn
yarn preview

# bun
bun run preview

Check out the deployment documentation for more information.