1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-24 13:43:12 +02:00

Archiver file extension

This commit is contained in:
Chen-I Lim 2021-01-26 11:23:20 -08:00
parent 314db69a5f
commit 03ab512657
3 changed files with 6 additions and 5 deletions

1
.gitignore vendored
View File

@ -44,6 +44,7 @@ debug
__debug_bin
files
octo*.db
focalboard*.db
.eslintcache
.vscode/settings.json
.prettierrc.json

View File

@ -65,14 +65,14 @@ class ViewController:
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-M-d"
let dateString = dateFormatter.string(from: Date())
let filename = "archive-\(dateString).octo"
let filename = "archive-\(dateString).focalboard"
// Save file
let savePanel = NSSavePanel()
savePanel.canCreateDirectories = true
savePanel.nameFieldStringValue = filename
// BUGBUG: Specifying the allowedFileTypes causes Catalina to hang / error out
//savePanel.allowedFileTypes = [".octo"]
//savePanel.allowedFileTypes = [".focalboard"]
savePanel.begin { (result) in
if result.rawValue == NSApplication.ModalResponse.OK.rawValue,
let fileUrl = savePanel.url {
@ -97,7 +97,7 @@ class ViewController:
savePanel.canCreateDirectories = true
savePanel.nameFieldStringValue = filename
// BUGBUG: Specifying the allowedFileTypes causes Catalina to hang / error out
//savePanel.allowedFileTypes = [".octo"]
//savePanel.allowedFileTypes = [".focalboard"]
savePanel.begin { (result) in
if result.rawValue == NSApplication.ModalResponse.OK.rawValue,
let fileUrl = savePanel.url {

View File

@ -38,7 +38,7 @@ class Archiver {
const content = JSON.stringify(archive)
const date = new Date()
const filename = `archive-${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}.octo`
const filename = `archive-${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}.focalboard`
const link = document.createElement('a')
link.style.display = 'none'
@ -56,7 +56,7 @@ class Archiver {
static importFullArchive(onComplete?: () => void): void {
const input = document.createElement('input')
input.type = 'file'
input.accept = '.octo'
input.accept = '.focalboard'
input.onchange = async () => {
const file = input.files && input.files[0]
const contents = await (new Response(file)).text()