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

Add React keys in subscribe-channels (issue #8729) #9386

Merged
merged 1 commit into from
Oct 23, 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
18 changes: 13 additions & 5 deletions web/html/src/manager/systems/ssm/ssm-subscribe-channels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,19 @@ class BaseChannelPage extends React.Component<BaseChannelProps, BaseChannelState
const newBaseId = this.state.baseChanges.get(channel.base.id);
const baseOptions = channel.allowedBaseChannels
.filter((c) => !c.custom)
.map((c) => <option value={c.id}>{c.name}</option>)
.map((c) => (
<option key={c.id} value={c.id}>
{c.name}
</option>
))
.concat(defaultOption);
const customOptions = channel.allowedBaseChannels
.filter((c) => c.custom)
.map((c) => <option value={c.id}>{c.name}</option>);
.map((c) => (
<option key={c.id} value={c.id}>
{c.name}
</option>
));

return (
<select
Expand Down Expand Up @@ -468,7 +476,7 @@ class ChildChannelPage extends React.Component<ChildChannelProps, ChildChannelSt
<hr />
<dl className="col-lg-12">
{allowed.childChannels.map((child) => (
<dt className="row">
<dt className="row" key={child.id}>
<div className="col-md-6">
<ChannelLink id={child.id} newWindow={true}>
{child.name}
Expand Down Expand Up @@ -629,7 +637,7 @@ class SummaryPage extends React.Component<SummaryPageProps, SummaryPageState> {
};

render() {
const rows = this.props.allowedChanges.map((allowed) => {
const rows = this.props.allowedChanges.map((allowed: SsmAllowedChildChannelsDto) => {
const newBaseName = allowed.newBaseChannel
? allowed.newBaseChannel.name
: t("(Couldn't determine new base channel)");
Expand Down Expand Up @@ -688,7 +696,7 @@ class SummaryPage extends React.Component<SummaryPageProps, SummaryPageState> {
<hr />
<dl className="col-lg-12">
{allowed.childChannels.map((child) => (
<dt className="row">
<dt className="row" key={child.id}>
<div className="col-md-6">
<ChannelLink id={child.id} newWindow={true}>
{child.name + (child.recommended ? " (R)" : "")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class SystemChannels extends React.Component<SystemChannelsProps, SystemChannels
const isChecked = c.id === (this.state.selectedBase && this.state.selectedBase.id);

return (
<div className="radio">
<div className="radio" key={c.id}>
<input
type="radio"
value={c.id}
Expand All @@ -493,7 +493,7 @@ class SystemChannels extends React.Component<SystemChannelsProps, SystemChannels
const isChecked = c.id === (this.state.selectedBase && this.state.selectedBase.id);

return (
<div className="radio">
<div className="radio" key={c.id}>
<input
type="radio"
value={c.id}
Expand All @@ -519,7 +519,7 @@ class SystemChannels extends React.Component<SystemChannelsProps, SystemChannels
let mandatoryChannels = this.state.selectedBase && this.state.requiredChannels.get(this.state.selectedBase.id);

childChannels = Array.from(availableChildren.values()).map((c) => (
<div className="checkbox">
<div className="checkbox" key={c.id}>
<input
type="checkbox"
value={c.id}
Expand Down Expand Up @@ -692,7 +692,7 @@ class SystemChannels extends React.Component<SystemChannelsProps, SystemChannels
<div>
{availableChildren &&
Array.from(availableChildren.values()).map((c) => (
<div className="checkbox">
<div className="checkbox" key={c.id}>
<input
type="checkbox"
value={c.id}
Expand Down
Loading