This commit is contained in:
Maxi Redigonda 2022-02-24 09:26:12 -03:00
parent 784d470ba5
commit 15379cf3a4
6 changed files with 10 additions and 6 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ server/vendor
server/files/
!server/files/.gitkeep
!server/files/.htaccess
!server/files/emilia-clarke-profile.jpg
server/.dbdata
server/.fakemail
server/apidoc

View File

@ -20,6 +20,8 @@ class AdminPanelMyAccount extends React.Component {
}
getEditorProps() {
console.log('ADMIN PROPS: ', this.props);
return {
myAccount: true,
staffId: this.props.userId * 1,

View File

@ -24,6 +24,7 @@
opensupports_version = '4.11.0';
root = "<?=$url ?>";
apiRoot = '<?=$url ?>/api';
console.log('INIT API ROOT: ', apiRoot);
globalIndexPath = "<?=$path ?>";
showLogs = false;
</script>

View File

@ -54,10 +54,12 @@ module.exports = {
},
getAPIUrl() {
console.log('apiRoot: ', apiRoot);
return apiRoot;
},
getURL() {
console.log('root: ', root);
return root;
}
};

View File

@ -60,7 +60,7 @@ require './system/delete-api-key.rb'
require './system/get-api-keys.rb'
require './system/disable-registration.rb'
require './system/enable-registration.rb'
require './system/file-upload-download.rb'
require './system/file-upload-download.rb' # These tests break the profile picture
require './system/csv-import.rb'
require './ticket/create-tag.rb'
require './ticket/edit-tag.rb'

View File

@ -55,15 +55,13 @@ describe 'File Upload and Download' do
end
it 'should upload profile picture' do
file = File.new('../server/files/profile.jpg', 'w+')
file.puts('file content')
file.close
file = File.open("../server/files/emilia-clarke-profile.jpg")
request('/staff/edit', {
'csrf_userid' => $csrf_userid,
'csrf_token' => $csrf_token,
'staffId' => $csrf_userid,
'file' => File.open( "../server/files/profile.jpg")
'file' => File.open("../server/files/emilia-clarke-profile.jpg")
})
user = $database.getRow('staff', $csrf_userid)
@ -75,7 +73,7 @@ describe 'File Upload and Download' do
'file' => user['profile_pic']
}, 'GET')
(result.body).should.include('file content')
(result['status']).should.equal('success')
end
it 'should add images to ticket content when creating a new ticket' do