Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drip
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
backup
Drip
Commits
d3d72a39
Commit
d3d72a39
authored
6 years ago
by
Julia Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Extract labels
parent
77bda6bf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/labels.js
+21
-8
21 additions, 8 deletions
components/labels.js
components/settings.js
+22
-8
22 additions, 8 deletions
components/settings.js
with
43 additions
and
16 deletions
components/labels.js
+
21
−
8
View file @
d3d72a39
export
const
settings
=
{
export
const
settings
=
{
errors
:
{
shared
:
{
noData
:
'
There is no data to export
'
,
cancel
:
'
Cancel
'
couldNotConvert
:
'
Could not convert data to CSV
'
,
problemSharing
:
'
There was a problem sharing the data export file
'
},
},
exportTitle
:
'
My Drip data export
'
,
export
:
{
exportSubject
:
'
My Drip data export
'
,
errors
:
{
exportLabel
:
'
Export data
'
,
noData
:
'
There is no data to export
'
,
importLabel
:
'
Import data
'
couldNotConvert
:
'
Could not convert data to CSV
'
,
problemSharing
:
'
There was a problem sharing the data export file
'
},
title
:
'
My Drip data export
'
,
subject
:
'
My Drip data export
'
,
button
:
'
Export data
'
,
},
import
:
{
button
:
'
Import data
'
,
title
:
'
Keep existing data?
'
,
message
:
`There are two options for the import:
1. Keep existing cycle days and replace only the ones in the import file.
2. Delete all existing cycle days and import cycle days from file.`
,
replaceOption
:
'
Import and replace
'
,
deleteOption
:
'
Import and delete existing
'
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
components/settings.js
+
22
−
8
View file @
d3d72a39
...
@@ -22,13 +22,27 @@ export default class Settings extends Component {
...
@@ -22,13 +22,27 @@ export default class Settings extends Component {
<
View
style
=
{
styles
.
homeButton
}
>
<
View
style
=
{
styles
.
homeButton
}
>
<
Button
<
Button
onPress
=
{
openShareDialogAndExport
}
onPress
=
{
openShareDialogAndExport
}
title
=
{
labels
.
export
Label
}
>
title
=
{
labels
.
export
.
button
}
>
<
/Button
>
<
/Button
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
homeButton
}
>
<
View
style
=
{
styles
.
homeButton
}
>
<
Button
<
Button
onPress
=
{
getFileContentAndImport
}
title
=
{
labels
.
import
.
button
}
title
=
{
labels
.
importLabel
}
>
onPress
=
{()
=>
{
Alert
.
alert
(
labels
.
import
.
title
,
labels
.
import
.
message
,
[{
text
:
labels
.
import
.
replaceOption
,
onPress
:
()
=>
getFileContentAndImport
({
deleteExisting
:
false
})
},
{
text
:
labels
.
import
.
deleteOption
,
onPress
:
()
=>
getFileContentAndImport
({
deleteExisting
:
true
})
},
{
text
:
labels
.
shared
.
cancel
,
style
:
'
cancel
'
,
onPress
:
()
=>
{
}
}]
)
}}
>
<
/Button
>
<
/Button
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
...
@@ -51,19 +65,19 @@ async function openShareDialogAndExport() {
...
@@ -51,19 +65,19 @@ async function openShareDialogAndExport() {
try
{
try
{
await
Share
.
open
({
await
Share
.
open
({
title
:
labels
.
export
T
itle
,
title
:
labels
.
export
.
t
itle
,
url
:
data
,
url
:
data
,
subject
:
labels
.
export
S
ubject
,
subject
:
labels
.
export
.
s
ubject
,
type
:
'
text/csv
'
,
type
:
'
text/csv
'
,
showAppsToView
:
true
showAppsToView
:
true
})
})
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
err
)
console
.
error
(
err
)
return
alertError
(
labels
.
errors
.
problemSharing
)
return
alertError
(
labels
.
export
.
errors
.
problemSharing
)
}
}
}
}
async
function
getFileContentAndImport
()
{
async
function
getFileContentAndImport
(
{
deleteExisting
}
)
{
let
fileInfo
let
fileInfo
try
{
try
{
fileInfo
=
await
new
Promise
((
resolve
,
reject
)
=>
{
fileInfo
=
await
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -87,7 +101,7 @@ async function getFileContentAndImport() {
...
@@ -87,7 +101,7 @@ async function getFileContentAndImport() {
}
}
try
{
try
{
await
importCsv
(
fileContent
,
false
)
await
importCsv
(
fileContent
,
deleteExisting
)
Alert
.
alert
(
'
Success
'
,
'
Data successfully imported
'
)
Alert
.
alert
(
'
Success
'
,
'
Data successfully imported
'
)
}
catch
(
err
)
{
}
catch
(
err
)
{
alertError
(
err
.
message
)
alertError
(
err
.
message
)
...
...
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