Skip to content

Commit

Permalink
Merge pull request #37 from metrico/develop
Browse files Browse the repository at this point in the history
fix: NO DATA issue
  • Loading branch information
RFbkak37y3kIY authored Aug 28, 2023
2 parents 03439d9 + b796eca commit a5e1b52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qxip-flow-panel",
"version": "10.0.8",
"version": "10.0.9",
"description": "Test plugin to lern dev enveroument",
"scripts": {
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
Expand Down
15 changes: 7 additions & 8 deletions src/components/SimplePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,17 @@ document.addEventListener('ngx-flow-click-item', function (e: any) {
});

function formattingDataAndSortIt(data: any, sortType = 'none') {
const [firstField] = data;
const unSortData = firstField.values.map((i: any, k: number) => {
const [firstField] = data || [];
const unSortData = firstField?.values?.map((i: any, k: number) => {
const outData: any = {};
data.forEach((item: any) => {
outData[item.name] = item.values[k];
outData[item.name] = item?.values?.[k];
});
if (outData?.Time && typeof outData?.labels === 'object') {
outData['labels'].timestamp = outData.Time;
}
return outData;
})
}) || [];
if (sortType === 'none') {
return unSortData;
}
Expand Down Expand Up @@ -197,18 +197,17 @@ export const SimplePanel: React.FC<Props> = ({ options, data, width, height }: a
setModalDataFields(sortData);
const outData = firsField?.values;

valueLabelsName = Object.keys(outData[0]);

if (outData) {
valueLabelsName = Object.keys(outData?.[0] || {});
setFlowData({
actors: [], data: sortData.map((item: any) => {
const message: string = item.Line || '';
const labelItem: any = item.labels;
const labelItem: any = item.labels || {};
const _ = (optionArr: string[] | string) => {
if (optionArr instanceof Array) {
return optionArr.map((option: string) => labelItem[option]).filter((a: any) => !!a).join(':');
}
return labelItem[optionArr];
return labelItem[optionArr] || '';
};
return {
messageID: _(options.colorGenerator) || 'Title',
Expand Down

0 comments on commit a5e1b52

Please sign in to comment.