New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single service mode #68
Changes from 3 commits
58e90c7
20815d5
958e60e
369e97a
f378ba5
21f1e66
c559016
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -124,9 +124,9 @@ export default class UnifileService { | |||
}); | ||||
} | ||||
|
||||
cd (path) { | ||||
cd (path, preventAuth=false) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you should add it as a flag a the CloudExplorer2/src/js/UnifileService.js Line 56 in 958e60e
service map should be Map<String, {displayName, requiresAuth}>
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in fact some services won't require auth, but this is about another topic here: when CE starts, if the path is "/" it will list services, and if there is only one service we want to The best thing would be to send a |
||||
return new Promise((resolve, reject) => { | ||||
if (path.length === 1 && path[0] !== this.currentPath[0]) { | ||||
if (!preventAuth && path.length === 1 && path[0] !== this.currentPath[0]) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this check is weird (it was weird already) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah.. it's a way to check if we are opening a service or a folder... we should probably use isService or something There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could retrieve the service with the path, right? If it's the first part of the path, use the service There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, then that's what |
||||
this.auth(path[0]) | ||||
.then(() => { | ||||
this.currentPath = path; | ||||
|
@@ -299,6 +299,7 @@ export default class UnifileService { | |||
} | ||||
|
||||
static isService (file) { | ||||
return typeof file.isLoggedIn !== 'undefined'; | ||||
console.log('isService', file, file.isLoggedIn); | ||||
return typeof file.mime === 'application/json'; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. weird, pls comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the console log is a mistake do you think this is ok for a comment?
Do you think I should rather add a specific field "isService" to the data returned by the server side? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see a lot of use case when a regular file will have a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so do you think I should re-open this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
for a static file this would be strange There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're thinking too much with Silex, not CE. As a developer, my FTP might be full of JSON config files I saved here. You wouldn't want that to mess up CE |
||||
} | ||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think initDone should be part of the component state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but more generally, I don't quite understand this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes again that's a way to open a service when CE starts, so only the 1st time and if it is "/" which is
ls
maybe i should put all this somewhere else...