Repository navigation
feat: RSS-SE-20 implement try it out ui form - #30
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughДобавлены типы OpenAPI для ChangesФорма Try It Out для endpoint’ов
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant EndpointList
participant TryItOutForm
participant Endpoint
participant Input
participant Translations
EndpointList->>TryItOutForm: передаёт endpoint
TryItOutForm->>Endpoint: читает параметры и requestBody
TryItOutForm->>Input: отображает поля параметров
TryItOutForm->>Translations: получает строки TryItOut
TryItOutForm-->>EndpointList: отображает форму и JSON textarea
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/entities/endpoint/ui/try-it-out-form/try-it-out-form.module.scss`:
- Around line 48-65: Remove the empty lines between CSS declarations in the
.textArea rule, including the gaps before padding, font-size, outline, and
color, so Stylelint passes without changing the styling.
In `@src/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsx`:
- Around line 35-38: Англоязычные placeholder-ы в компоненте TryItOutForm не
локализованы. Добавьте в ключи TryItOut переводы с interpolation для типа
параметра и JSON placeholder-а, затем замените шаблоны `Enter ${param.in}...` и
`// JSON data` на соответствующие вызовы локализации.
- Around line 19-22: Не показывайте JSON-редактор, если requestBody не содержит
поддерживаемый media type application/json. В логике TryItOutForm, включая
вычисление jsonExample/defaultTextareaValue и рендеринг формы в соответствующем
компоненте, проверяйте наличие application/json и скрывайте редактор либо
выбирайте редактор, соответствующий фактическому типу содержимого, вместо
отображения пустого JSON-поля для XML или multipart.
- Line 30: Добавьте обработчик отправки для формы в компоненте TryItOutForm,
подключив его через onSubmit и отменяя native submit с помощью preventDefault;
реализуйте обработчик кнопки Generate cURL через onClick, чтобы обе
action-кнопки выполняли заявленные действия вместо перехода по текущему URL.
Если функциональность ещё не готова, временно задайте кнопкам type="button" и
отключите их.
- Around line 21-22: В вычислении `defaultTextareaValue` в компоненте формы не
отбрасывайте валидные falsy-значения и учитывайте альтернативу `examples`.
Используйте проверку `jsonExample !== undefined`, а если `example` отсутствует,
извлекайте подходящее значение из
`requestBody?.content['application/json']?.examples`; затем сериализуйте
найденный пример через `JSON.stringify`.
- Around line 44-49: Сделайте id textarea уникальным для каждого endpoint-а: в
компоненте try-it-out-form используйте идентификатор, производный от уникального
идентификатора endpoint-а, и передайте тот же id в htmlFor соответствующего
label вместо общего `request-body-textarea`.
In `@src/shared/ui/accordion/accordion.module.scss`:
- Line 60: Remove the duplicate border-top declaration from the accordion
content container, keeping the existing border-top rule on .contentInner as the
sole boundary.
In `@src/shared/ui/input/input.module.scss`:
- Line 43: Remove the empty line immediately before the min-height declaration
in the input styles so the declaration-empty-line-before Stylelint rule passes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e611f166-731e-49de-8648-3fbbc9431927
📒 Files selected for processing (11)
messages/en.jsonmessages/ru.jsonsrc/entities/endpoint/types/openapi-types.tssrc/entities/endpoint/ui/endpoint-list/endpoint-list.module.scsssrc/entities/endpoint/ui/endpoint-list/endpoint-list.tsxsrc/entities/endpoint/ui/try-it-out-form/try-it-out-form.module.scsssrc/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsxsrc/shared/ui/accordion/accordion.module.scsssrc/shared/ui/accordion/accordion.tsxsrc/shared/ui/input/input.module.scsssrc/shared/ui/input/input.tsx
| .textArea { | ||
| width: 100%; | ||
| background: var(--bg-surface-2); | ||
| border: 2px solid var(--bg-surface-3); | ||
| border-radius: 1rem; | ||
|
|
||
| padding: 0.75rem 1.25rem; | ||
| margin-top: 8px; | ||
|
|
||
| font-size: 14px; | ||
| line-height: 1.5rem; | ||
| font-family: var(--font-mono); | ||
|
|
||
| outline: none; | ||
| resize: vertical; | ||
| transition: all 0.3s; | ||
|
|
||
| color: var(--text-primary); |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Уберите пустые строки перед CSS-декларациями.
Stylelint отмечает строки 54, 57, 61 и 65. Это может блокировать lint-проверку CI.
🧰 Tools
🪛 Stylelint (17.14.0)
[error] 54-54: Expected no empty line before declaration (declaration-empty-line-before)
(declaration-empty-line-before)
[error] 57-57: Expected no empty line before declaration (declaration-empty-line-before)
(declaration-empty-line-before)
[error] 61-61: Expected no empty line before declaration (declaration-empty-line-before)
(declaration-empty-line-before)
[error] 65-65: Expected no empty line before declaration (declaration-empty-line-before)
(declaration-empty-line-before)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/entities/endpoint/ui/try-it-out-form/try-it-out-form.module.scss` around
lines 48 - 65, Remove the empty lines between CSS declarations in the .textArea
rule, including the gaps before padding, font-size, outline, and color, so
Stylelint passes without changing the styling.
Source: Linters/SAST tools
| <PlayIcon className={styles.titleIcon} /> | ||
| <span>{t('title')}</span> | ||
| </h3> | ||
| <form className={styles.form}> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Подключите обработчики action-кнопок.
У Execute нет onSubmit, поэтому браузер выполняет обычную отправку формы на текущий URL; Generate cURL вообще не имеет обработчика. В результате заявленные действия не выполняются. Реализуйте обработчики и отменяйте native submit либо временно отключите эти кнопки.
Also applies to: 57-63
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsx` at line 30,
Добавьте обработчик отправки для формы в компоненте TryItOutForm, подключив его
через onSubmit и отменяя native submit с помощью preventDefault; реализуйте
обработчик кнопки Generate cURL через onClick, чтобы обе action-кнопки выполняли
заявленные действия вместо перехода по текущему URL. Если функциональность ещё
не готова, временно задайте кнопкам type="button" и отключите их.
| align-items: start; | ||
| gap: 0.4rem; | ||
|
|
||
| min-height: 0; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Уберите пустую строку перед декларацией.
Stylelint 17.14.0 сообщает declaration-empty-line-before на Line 43. Удалите пустую строку перед min-height, чтобы проверка стилей проходила.
gap: 0.4rem;
-
min-height: 0;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| min-height: 0; | |
| gap: 0.4rem; | |
| min-height: 0; |
🧰 Tools
🪛 Stylelint (17.14.0)
[error] 43-43: Expected no empty line before declaration (declaration-empty-line-before)
(declaration-empty-line-before)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/shared/ui/input/input.module.scss` at line 43, Remove the empty line
immediately before the min-height declaration in the input styles so the
declaration-empty-line-before Stylelint rule passes.
Source: Linters/SAST tools
📋 Trello Task ID
⚡️ Summary
🛠 Type of change
feat(New feature)fix(Bug fix)refactor(Code improvement / Refactoring without changing logic)style(Formatting, CSS)docs(Documentation)chore(Configs, Build)test(Testing)📷 Screenshots / GIFs
Summary by CodeRabbit