Expanding one row updating the value of all the expanded rows with the latest value
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- bootstrap, javascript, react, redux
- 領域
- frontend
調査の方向性
Issue に示されている expandRow renderer と NewRecordContent/JobRequestedDate コンポーネントから開始し、getJobRequestedDate と Redux state props を追跡します。2 行を展開して問題を再現し、それぞれが独自の API 値を保持することを確認します。後から展開しても、先に展開した行のデータが置き換えられなくなれば、Issue は解決です。
索引モデルが issue の本文から書いたものです。
説明
I have a requirement to call the API to retrieve the value and show value when the expand row is selected. Each row is having a different value which is received by using an API. For example:
There are ten rows displayed on the dashboard with expanding row indicator (individual as well as expand all). If row one is expanded then there will be an API call to retrieve the data and show it under the expanded row. If the second row expanded then there will be another API call to retrieve the data that belongs to the second row and show the same without impacting the first-row data.
I am facing an issue where all the expanded rows are updated with the latest expanded row data which is received from the latest row API call. As part of the issue investigation, I observed that render is called for all the expanded rows instead of the current expanded row.
Note: I am using sagas for API calls. And used the component to retrieve the data from API and store it in the props, show the data in the expanded row.
Can you please help me with how to fix the issue?
Here is the code snippet:
<BootstrapTable
{...props.baseProps}
bootstrap4
pagination={ paginationFactory() }
defaultSorted={ defaultSorted }
filter={ filterFactory() }
loading={ props.loading }
expandRow={ expandRow }
headerClasses="header-class"
noDataIndication="There are currently no active or historic requests."
striped
hover
condensed
/>
const expandRow = {
className: 'expanding-row',
parentClassName: 'expanding-parent-row',
onlyOneExpanding: false,
showExpandColumn: true,
expandByColumnOnly: true,
renderer: row => (
<-Container>
<-Row>
<-Col>
<-NewRecordContent Id={row.Id}/>
<-/Col>
<-/Row>
<-/Container>
)
};
--> NewRecordContent component:
import React from 'react';
import moment from 'moment'
import {getJobRequestedDate} from "../actions/jobRequestedDatetActions";
import { connect } from "react-redux";
type Props = any;
class JobRequestedDate extends React.Component {
constructor(props) { super(props); }
componentDidMount() { this.props.getJobRequestedDate(this.props.Id) }
componentWillUnmount() {
this.setState(
{
requestedDate: []
},
() => {}
);
}
render() {
let jobRequestedAt = this.props.job.report.lastJobRequestAt
return (
<>
<p>Job Requested at: <b><strong>{jobRequestedAt !== undefined ? moment(jobRequestedAt).format("Do MMM YYYY, HH:mm") : ""} </strong></b></p>
</>
)
}
}
const mapStateToProps = state => ({
job: state.report
});
const mapDispatchToProps = dispatch => {
return {
getLocationReport: (Id) => dispatch(getJobReport(Id)),
}
}
export default connect(mapStateToProps, mapDispatchToProps)(JobRequestedDate);
- 主要言語
- JavaScript
- スター
- 2.2k
- フォーク
- 758
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AllenFang/react-bootstrap-table のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
AllenFang/react-bootstrap-table#2053 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 20/100
AllenFang/react-bootstrap-table#2144 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
AllenFang/react-bootstrap-table#2143 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
AllenFang/react-bootstrap-table#2142 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
AllenFang/react-bootstrap-table#2141 ·
AllenFang/react-bootstrap-table の issue をすべて見る
似ている issue
-
fix(套件): test_bundle 往仓库的 preset/skills 写哨兵,并发跑的 test_installer 拷贝时撞 ENOENT(CI 红)対応中かも @Miaotofu01 が今日担当しました。 オープンneeds-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Miaotofu01/Study-Mate#216 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
-
beginner-friendly category:fixtures community enhancement first-timers-only good first issue hacktoberfest help wanted low hanging fruit micro-contribution type: task up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
Berserk-hub150/skillhawk#229 · コメント 1 件 ·
メンテナーはふだん 8 日以内に返信
-
WlanConfUpdateSensor falsely reports wifi interface appearing when sysfs inode cache is reclaimedオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
firewalla/firerouter#2180 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
andromarces/agent-loops#976 ·
メンテナーはふだん 1 日以内に返信