MCPcopy Create free account
hub / github.com/YMFE/yapi / componentDidMount

Function componentDidMount

client/components/ModalPostman/VariablesSelect.js:59–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57 }
58
59 async componentDidMount() {
60 const { currColId, fetchVariableParamsList, clickValue } = this.props;
61 let result = await fetchVariableParamsList(currColId);
62 let records = result.payload.data.data;
63 this.records = records.sort((a, b) => {
64 return a.index - b.index;
65 });
66 this.handleRecordsData(this.props.id);
67
68 if (clickValue) {
69 let isArrayParams = clickValue.lastIndexOf(']') === clickValue.length - 1;
70 let key = isArrayParams ? deleteLastArr(clickValue) : deleteLastObject(clickValue);
71 this.setState({
72 expandedKeys: [key],
73 selectedKeys: [CanSelectPathPrefix + clickValue]
74 });
75 // this.props.click(clickValue);
76 }
77 }
78
79 async componentWillReceiveProps(nextProps) {
80 if (this.records && nextProps.id && this.id !== nextProps.id) {

Callers

nothing calls this directly

Calls 3

fetchVariableParamsListFunction · 0.90
deleteLastArrFunction · 0.85
deleteLastObjectFunction · 0.85

Tested by

no test coverage detected