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

refactor(frontend): fix enum types in scripts/form #11138

Conversation

ryoh827
Copy link
Contributor

@ryoh827 ryoh827 commented Jul 6, 2023

What

scripts/form.tsenum の型を (string | {label: string; value: string;})[] に変更
fixed: #10881

Why

string[] の場合、下記の利用の仕方だと型が一致していないため

<MkSelect v-else-if="form[item].type === 'enum'" v-model="values[item]">
<template #label><span v-text="form[item].label || item"></span><span v-if="form[item].required === false"> ({{ i18n.ts.optional }})</span></template>
<option v-for="item in form[item].enum" :key="item.value" :value="item.value">{{ item.label }}</option>
</MkSelect>

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment (frontend only)
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/frontend Client side specific issue/PR label Jul 6, 2023
@syuilo syuilo merged commit bc61f37 into misskey-dev:develop Jul 6, 2023
11 checks passed
@syuilo
Copy link
Member

syuilo commented Jul 6, 2023

🙏

@ryoh827 ryoh827 deleted the issues/10881_fix_enum_types_in_scripts_form branch July 6, 2023 11:28
slofp pushed a commit to Secineralyr/misskey.dream that referenced this pull request Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/frontend Client side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scripts/form の enum の型が合っていない
2 participants