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

Changed Tasks info WebApp to accept new URLs #688

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion env.example
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30

# URLs проекта Procharity
PROCHARITY_URL=http://test6.procharity.corptest.ru/ # Основной URL проекта
PROCHARITY_URL=https://test6.procharity.corptest.ru/ # Основной URL проекта
HELP_PROCHARITY_URL=https://help.procharity.ru/ # URL "Ответы на вопросы" проекта
ACCESS_TOKEN_SEND_DATA_TO_PROCHARITY= # Токен для обновления данных на сайте
3 changes: 1 addition & 2 deletions src/bot/schemas/web_app_query_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ class FeedbackFormQueryParams(QueryParams):
class TaskInfoPageQueryParams(QueryParams):
"""Параметры запроса для страницы с информацией о задании."""

id: NonNegativeInt
api_root_path: str
task_id: NonNegativeInt
7 changes: 2 additions & 5 deletions src/bot/web_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ def get_feedback_web_app_info(user: User) -> WebAppInfo:

def get_task_web_app_info(task: Task) -> WebAppInfo:
"""WebApp для отображения подробной информации о задании и фонде."""
query_params = TaskInfoPageQueryParams(
id=task.id,
api_root_path=settings.ROOT_PATH,
)
query_params = TaskInfoPageQueryParams(task_id=task.id)
return WebAppInfo(
url=urljoin(
settings.task_info_page_template_url,
settings.procharity_task_url,
query_params.as_url_query(),
)
)
6 changes: 3 additions & 3 deletions src/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ def feedback_form_template_url(self) -> str:
return urljoin(self.static_url, "feedback_form/feedback_form.html")

@property
def task_info_page_template_url(self) -> str:
"""Получить url-ссылку на HTML шаблон страницы с информацией о задании."""
return urljoin(self.static_url, "task_info_page/task_info_page.html")
def procharity_task_url(self) -> str:
"""Получить url-ссылку на страницу с информацией о задании."""
return urljoin(self.PROCHARITY_URL, "webapp/")

@property
def procharity_registration_url(self) -> str:
Expand Down
Empty file.
13 changes: 0 additions & 13 deletions templates/task_info_page/scripts/task_info_page.js

This file was deleted.

21 changes: 0 additions & 21 deletions templates/task_info_page/task_info_page.html

This file was deleted.