Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Kemence
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Disappointment industries™
Kemence
Commits
e914415d
Commit
e914415d
authored
Jun 17, 2022
by
Tóth Miklós Tibor
Browse files
Options
Downloads
Patches
Plain Diff
Fix off by one
parent
b3ea7c50
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/jsMain/kotlin/datasources/GSheet.kt
+4
-4
4 additions, 4 deletions
src/jsMain/kotlin/datasources/GSheet.kt
src/jsMain/kotlin/ui/SheetsModal.kt
+15
-1
15 additions, 1 deletion
src/jsMain/kotlin/ui/SheetsModal.kt
with
19 additions
and
5 deletions
src/jsMain/kotlin/datasources/GSheet.kt
+
4
−
4
View file @
e914415d
...
@@ -9,17 +9,17 @@ import pekstuff.trimAsPrinciple
...
@@ -9,17 +9,17 @@ import pekstuff.trimAsPrinciple
import
kotlin.coroutines.resume
import
kotlin.coroutines.resume
import
kotlin.coroutines.suspendCoroutine
import
kotlin.coroutines.suspendCoroutine
class
GSheet
private
constructor
(
sheet
:
sheets
.
Spreadsheet
):
DataSource
,
NoteDataSource
{
class
GSheet
private
constructor
(
sheet
:
sheets
.
Spreadsheet
,
sheetNum
:
Int
=
0
):
DataSource
,
NoteDataSource
{
companion
object
{
companion
object
{
private
val
filterList
=
listOf
(
private
val
filterList
=
listOf
(
"szumma"
,
"színes belépő"
"szumma"
,
"színes belépő"
)
)
suspend
fun
new
(
url
:
String
):
GSheet
{
suspend
fun
new
(
url
:
String
,
sheetNum
:
Int
=
0
):
GSheet
{
if
(!
isSignedIn
)
throw
Error
(
"You must sign in to get gapi.sheets"
)
if
(!
isSignedIn
)
throw
Error
(
"You must sign in to get gapi.sheets"
)
val
sheet
=
getSheetFromUrl
(
url
)
val
sheet
=
getSheetFromUrl
(
url
)
window
.
asDynamic
().
test
=
sheet
window
.
asDynamic
().
test
=
sheet
return
GSheet
(
sheet
)
return
GSheet
(
sheet
,
sheetNum
)
}
}
@NoLiveLiterals
@NoLiveLiterals
...
@@ -36,7 +36,7 @@ class GSheet private constructor(sheet: sheets.Spreadsheet): DataSource, NoteDat
...
@@ -36,7 +36,7 @@ class GSheet private constructor(sheet: sheets.Spreadsheet): DataSource, NoteDat
}
}
}
}
private
val
rows
=
sheet
.
sheets
!!
[
0
].
data
!!
[
0
].
rowData
!!
private
val
rows
=
sheet
.
sheets
!!
[
sheetNum
].
data
!!
[
0
].
rowData
!!
private
val
principleIndexes
=
rows
[
0
].
values
!!
.
mapIndexed
{
i
,
data
->
private
val
principleIndexes
=
rows
[
0
].
values
!!
.
mapIndexed
{
i
,
data
->
(
data
.
formattedValue
?.
trimAsPrinciple
()
?:
""
)
to
i
(
data
.
formattedValue
?.
trimAsPrinciple
()
?:
""
)
to
i
...
...
This diff is collapsed.
Click to expand it.
src/jsMain/kotlin/ui/SheetsModal.kt
+
15
−
1
View file @
e914415d
...
@@ -37,6 +37,7 @@ private object SheetsModal: ModalType {
...
@@ -37,6 +37,7 @@ private object SheetsModal: ModalType {
}
}
var
sheetUrl
by
remember
{
mutableStateOf
(
""
)
}
var
sheetUrl
by
remember
{
mutableStateOf
(
""
)
}
var
sheetNum
by
remember
{
mutableStateOf
(
1
)
}
var
sheet
by
remember
{
mutableStateOf
<
GSheet
?>(
null
)
}
var
sheet
by
remember
{
mutableStateOf
<
GSheet
?>(
null
)
}
setHint
(
setHint
(
...
@@ -86,13 +87,26 @@ private object SheetsModal: ModalType {
...
@@ -86,13 +87,26 @@ private object SheetsModal: ModalType {
value
(
sheetUrl
)
value
(
sheetUrl
)
})
})
}
}
withLabel
(
"Hányadik sheet (fül)"
)
{
id
->
Input
(
type
=
InputType
.
Number
,
attrs
=
{
id
(
id
)
classes
(
"uk-input"
)
onInput
{
sheetNum
=
it
.
value
?.
toInt
()
?:
return
@onInput
if
(
sheetNum
<=
0
)
{
sheetNum
=
1
}
}
value
(
sheetNum
)
})
}
Hr
{
}
Hr
{
}
divFloatRight
{
divFloatRight
{
Button
({
Button
({
classes
(
"uk-button"
,
"uk-button-primary"
)
classes
(
"uk-button"
,
"uk-button-primary"
)
onClick
{
onClick
{
scope
.
launch
{
scope
.
launch
{
sheet
=
GSheet
.
new
(
sheetUrl
)
sheet
=
GSheet
.
new
(
sheetUrl
,
sheetNum-1
)
sheet
?.
process
{
setState
(
ImportInProgress
(
it
))
}
sheet
?.
process
{
setState
(
ImportInProgress
(
it
))
}
setState
(
Ready
)
setState
(
Ready
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment