-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMPROVE] Hipchat Enterprise Importer (#12985)
* Added message showing the file size limit on the importers * Importer improvements * Added missing reference * Removed globals * Fixed data importers * Fixed import * Removed log * Changed hipchat enterprise importer to prepare files from the file system * Use a file URL on the importer * Avoid duplicated emails * Prevent duplicated emails from crashing the import process * Identify errors on the import process * Fixed attachment import * Fixed problem with invalid users when creating channels * Added labels for checkboxes
- Loading branch information
Showing
18 changed files
with
685 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
import { RocketChat } from 'meteor/rocketchat:lib'; | ||
|
||
RocketChat.API.v1.addRoute('uploadImportFile', { authRequired: true }, { | ||
post() { | ||
const { binaryContent, contentType, fileName, importerKey } = this.bodyParams; | ||
|
||
Meteor.runAsUser(this.userId, () => { | ||
RocketChat.API.v1.success(Meteor.call('uploadImportFile', binaryContent, contentType, fileName, importerKey)); | ||
}); | ||
|
||
return RocketChat.API.v1.success(); | ||
}, | ||
|
||
}); | ||
|
||
RocketChat.API.v1.addRoute('downloadPublicImportFile', { authRequired: true }, { | ||
post() { | ||
const { fileUrl, importerKey } = this.bodyParams; | ||
|
||
Meteor.runAsUser(this.userId, () => { | ||
RocketChat.API.v1.success(Meteor.call('downloadPublicImportFile', fileUrl, importerKey)); | ||
}); | ||
|
||
return RocketChat.API.v1.success(); | ||
}, | ||
|
||
}); | ||
|
||
RocketChat.API.v1.addRoute('getImportFileData', { authRequired: true }, { | ||
get() { | ||
const { importerKey } = this.requestParams(); | ||
let result; | ||
Meteor.runAsUser(this.userId, () => { | ||
result = Meteor.call('getImportFileData', importerKey); | ||
}); | ||
|
||
return RocketChat.API.v1.success(result); | ||
}, | ||
|
||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.