Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tallty_import_export
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
tallty_import_export
Commits
e977cb42
Commit
e977cb42
authored
May 07, 2022
by
Ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 空保护 & update export spec
parent
1cfae215
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
cell.rb
lib/tallty_import_export/export_payload/cell.rb
+1
-1
cell_column.rb
lib/tallty_import_export/export_payload/cell_column.rb
+2
-2
export_spec.rb
spec/export_spec.rb
+1
-1
No files found.
lib/tallty_import_export/export_payload/cell.rb
View file @
e977cb42
...
...
@@ -42,7 +42,7 @@ class TalltyImportExport::ExportPayload::Cell
end
def
divise
if
@header
.
children
.
present?
if
@header
.
children
.
present?
&&
@value
.
value
new_cells
=
@header
.
children
.
map
do
|
child_header
|
if
(
child_header
.
children
.
present?
)
val
=
@value
.
value
[
child_header
.
key
.
to_sym
]
...
...
lib/tallty_import_export/export_payload/cell_column.rb
View file @
e977cb42
...
...
@@ -9,7 +9,7 @@ class TalltyImportExport::ExportPayload::CellColumn
@cell_clusters
=
[]
@value_handler
=
value_handler
if
header
.
children
if
header
.
children
&&
@value
.
value
@cell_clusters
=
(
@value
.
value
[
header
.
key
.
to_sym
]
||
[]).
map
do
|
val
|
TalltyImportExport
::
ExportPayload
::
Cell
.
new
(
@header
,
...
...
@@ -46,7 +46,7 @@ class TalltyImportExport::ExportPayload::CellColumn
depth_to_cells_mapping
=
@flatten_cells
.
group_by
{
|
cell
|
[
cell
.
header
.
seq
]
}
@tallest_cell_cluster
=
depth_to_cells_mapping
.
values
.
max
{
|
a
,
b
|
a
.
count
<=>
b
.
count
}
@tallest_cell_cluster
=
depth_to_cells_mapping
.
values
.
max
{
|
a
,
b
|
a
.
count
<=>
b
.
count
}
||
[]
self
end
...
...
spec/export_spec.rb
View file @
e977cb42
...
...
@@ -82,7 +82,7 @@ RSpec.describe TalltyImportExport::Importable do
it
'export'
do
# TalltyImportExport::ExportForm.new.export_workbook nil, [@payload], { headers: @header_h[:items] }
TalltyImportExport
::
ExportForm
.
new
(
nil
).
export_xlsx
[
@payload
,
@payload
],
{
headers:
@header_h
[
:items
]
}
TalltyImportExport
::
ExportForm
.
new
(
nil
).
export_xlsx
[
@payload
,
nil
,
@payload
],
{
headers:
@header_h
[
:items
]
}
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment