Skip to content

Commit

Permalink
Merge pull request #1626 from unfoldingWord/bugFix-Joel-1150
Browse files Browse the repository at this point in the history
Saved user choices for columns in TSV Fix -#1150
  • Loading branch information
Joel-C-Johnson authored Oct 24, 2023
2 parents d6f7d37 + 3dc43e0 commit 73d6093
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@material-ui/styles": "^4.11.3",
"axios": "^0.21.0",
"bible-reference-range": "^1.1.0",
"datatable-translatable": "1.2.2",
"datatable-translatable": "1.2.3",
"dcs-branch-merger": "^1.3.0",
"deep-freeze": "^0.0.1",
"gitea-react-toolkit": "2.2.4",
Expand Down
2 changes: 1 addition & 1 deletion public/build_number
Original file line number Diff line number Diff line change
@@ -1 +1 @@
270-88dad83
271-3c254b3
30 changes: 20 additions & 10 deletions src/components/translatable/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,25 @@ export const columnsFilterFromColumnNames = ({ columnNames }) => {
};

export const columnsShowDefaultFromColumnNames = ({ columnNames }) => {
const columnNamesToUse = ['Question', 'Response', 'SupportReference', 'OccurrenceNote', 'OrigWords', 'TWLink', 'Note'];

const indices = columnNamesToUse.map(columnName => {
const retrievedData = (localStorage.getItem("StoredColumn"))
if (retrievedData){
const splitString = retrievedData.split(',');
const columnNamesToUse = [...splitString];
const indices = columnNamesToUse.map(columnName => {
const index = columnIndexOfColumnNameFromColumnNames({ columnNames, columnName });
return index;
});

const columnsIndices = indices.filter(index => (index > -1));
const columnsShowDefault = columnsIndices.map(index => (columnNames[index]));

return columnsShowDefault;
return index;
});
const columnsIndices = indices.filter(index => (index > -1));
const columnsShowDefault = columnsIndices.map(index => (columnNames[index]));
return columnsShowDefault;
}else{
const columnNamesToUse = [];
const indices = columnNamesToUse.map(columnName => {
const index = columnIndexOfColumnNameFromColumnNames({ columnNames, columnName });
return index;
});
const columnsIndices = indices.filter(index => (index > -1));
const columnsShowDefault = columnsIndices.map(index => (columnNames[index]));
return columnsShowDefault;
}
};
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5727,10 +5727,10 @@ data-urls@^1.0.0, data-urls@^1.1.0:
whatwg-mimetype "^2.2.0"
whatwg-url "^7.0.0"

[email protected].2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/datatable-translatable/-/datatable-translatable-1.2.2.tgz#cb12c862db592219c3450c2f97d59f76797fb8fe"
integrity sha512-TH/Ribv+P4Qs+3VhMcZYBHZgpRAfJGX++E3GYckJRyjZU4C6WWU/SmzvNdThXwkVXAFJvBP32yHPJ/ZLS2/Kaw==
[email protected].3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/datatable-translatable/-/datatable-translatable-1.2.3.tgz#f8d32c1f0da9a2b66662eca2983ea9d88185aca8"
integrity sha512-QT+JAKq5QfA+bGkrwFO5rMoTKaJ34/mGlMzKX3q2ILK7QdWYg5vP2Xq28iroAa5Fpu/Ka8tlCBIlFtYJwtygrA==
dependencies:
deep-freeze "^0.0.1"
extensible-rcl "^1.1.0"
Expand Down

0 comments on commit 73d6093

Please sign in to comment.