Skip to content
This repository was archived by the owner on Mar 9, 2025. It is now read-only.

Commit 6499758

Browse files
authored
Merge pull request #787 from trey-wallis/dev
8.6.3 Former-commit-id: b940e50
2 parents fe419f8 + a374727 commit 6499758

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"GitHub": "https://github.com/sponsors/trey-wallis",
1111
"Buymeacoffee": "https://www.buymeacoffee.com/treywallis"
1212
},
13-
"version": "8.6.2"
13+
"version": "8.6.3"
1414
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-dataloom",
3-
"version": "8.6.2",
3+
"version": "8.6.3",
44
"description": "Weave together data from diverse sources into a cohesive table view. Inspired by Excel Spreadsheets and Notion.so.",
55
"main": "main.js",
66
"scripts": {

src/react/import-app/state-utils.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,5 @@ describe("addImportData", () => {
211211
});
212212
});
213213

214+
//TODO add tests for spacing
214215
//TODO add tests for tags, date cell, etc

src/react/import-app/state-utils.ts

+19-6
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const addImportData = (
7373
let newCell: Cell | null = null;
7474
if (match) {
7575
const { importColumnIndex } = match;
76-
content = importRow[importColumnIndex];
76+
content = importRow[importColumnIndex].trim();
7777

7878
if (type === CellType.TAG) {
7979
const { cell, newTags } = createTagCell(
@@ -82,15 +82,15 @@ export const addImportData = (
8282
content
8383
);
8484
newCell = cell;
85-
column.tags.push(...newTags);
85+
columnTags.push(...newTags);
8686
} else if (type === CellType.MULTI_TAG) {
8787
const { cell, newTags } = createMultiTagCell(
8888
columnTags,
8989
columnId,
9090
content
9191
);
9292
newCell = cell;
93-
column.tags.push(...newTags);
93+
columnTags.push(...newTags);
9494
} else if (type === CellType.DATE) {
9595
const cell = createDateCell(columnId, content);
9696
newCell = cell;
@@ -130,10 +130,19 @@ const createMultiTagCell = (
130130
const newTags: Tag[] = [];
131131
const tagIds: string[] = [];
132132

133-
const parsedTags = content.split(",");
133+
const parsedTags = content.split(",").map((tag) => tag.trim());
134134
if (parsedTags.length !== 0) {
135135
parsedTags.forEach((tag) => {
136-
const existingTag = columnTags.find((t) => t.content === tag);
136+
const existingTag = columnTags.find((t) => {
137+
if (columnTags.length === 6) {
138+
console.log({
139+
content: t.content,
140+
tag,
141+
eq: t.content === tag,
142+
});
143+
}
144+
return t.content === tag;
145+
});
137146
if (existingTag) {
138147
tagIds.push(existingTag.id);
139148
} else {
@@ -147,6 +156,10 @@ const createMultiTagCell = (
147156
const cell = createCell(columnId, {
148157
tagIds,
149158
});
159+
console.log({
160+
cell,
161+
newTags,
162+
});
150163
return {
151164
cell,
152165
newTags,
@@ -161,7 +174,7 @@ const createTagCell = (
161174
const newTags: Tag[] = [];
162175
let tagId: string | null = null;
163176

164-
const parsedTags = content.split(",");
177+
const parsedTags = content.split(",").map((tag) => tag.trim());
165178
if (parsedTags.length !== 0) {
166179
parsedTags.forEach((tag) => {
167180
const existingTag = columnTags.find((t) => t.content === tag);

versions.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,6 @@
124124
"8.5.0": "1.2.0",
125125
"8.6.0": "1.2.0",
126126
"8.6.1": "1.2.0",
127-
"8.6.2": "1.2.0"
127+
"8.6.2": "1.2.0",
128+
"8.6.3": "1.2.0"
128129
}

0 commit comments

Comments
 (0)