Updated the ChangeLog.md and fixed some minor bugs

canary
WolverinDEV 2020-12-03 12:09:36 +01:00
parent 8824525d38
commit 6221cd9028
6 changed files with 29 additions and 16 deletions

View File

@ -1,4 +1,8 @@
# Changelog: # Changelog:
* **03.12.20**
- Fixed server connection tab move handler
- Fixed file browser context menu when having an overlay
* **02.12.20** * **02.12.20**
- Fixed a bug within the client entry move mechanic of the channel tree which prevented any client selection - Fixed a bug within the client entry move mechanic of the channel tree which prevented any client selection
- Selecting clicked client when moving - Selecting clicked client when moving

View File

@ -113,10 +113,14 @@ class FileCommandHandler extends AbstractCommandHandler {
finishFileInfo(returnCode: string) : FileInfo[] | "unknown-request" | "unfinished-request" { finishFileInfo(returnCode: string) : FileInfo[] | "unknown-request" | "unfinished-request" {
const qIndex = this.pendingFileInfos.findIndex(e => e.returnCode === returnCode); const qIndex = this.pendingFileInfos.findIndex(e => e.returnCode === returnCode);
if(qIndex === -1) return "unknown-request"; if(qIndex === -1) {
return "unknown-request";
}
const [ query ] = this.pendingFileInfos.splice(qIndex, 1); const [ query ] = this.pendingFileInfos.splice(qIndex, 1);
if(!query.finished) return "unfinished-request"; if(!query.finished) {
return "unfinished-request";
}
return query.currentFiles; return query.currentFiles;
} }
@ -440,8 +444,9 @@ export class FileManager {
} }
requestFileInfo(files: { channelId?: number, channelPassword?: string, path: string }[]) : Promise<(FileInfo | CommandResult)[]> { requestFileInfo(files: { channelId?: number, channelPassword?: string, path: string }[]) : Promise<(FileInfo | CommandResult)[]> {
if(files.length === 0) if(files.length === 0) {
return Promise.resolve([]); return Promise.resolve([]);
}
const returnCode = this.commandHandler.registerFileInfo(); const returnCode = this.commandHandler.registerFileInfo();
const infos = files.map(e => { const infos = files.map(e => {
@ -455,23 +460,26 @@ export class FileManager {
return this.connectionHandler.serverConnection.send_command("ftgetfileinfo", infos, { flagset: ["as-list"] }).then(cmdResult => { return this.connectionHandler.serverConnection.send_command("ftgetfileinfo", infos, { flagset: ["as-list"] }).then(cmdResult => {
const bulks = cmdResult.getBulks(); const bulks = cmdResult.getBulks();
if(bulks.length != files.length) if(bulks.length != files.length) {
return Promise.reject(tr("response bulk miss match")); return Promise.reject(tr("response bulk miss match"));
}
const infos = this.commandHandler.finishFileInfo(returnCode); const infos = this.commandHandler.finishFileInfo(returnCode);
if(!Array.isArray(infos)) { if(!Array.isArray(infos)) {
if(infos === "unfinished-request") if(infos === "unfinished-request") {
return Promise.reject(tr("the server failed to full fill the request")); return Promise.reject(tr("the server failed to full fill the request"));
else } else {
return Promise.reject(tr("request gone away while parsing response")); return Promise.reject(tr("request gone away while parsing response"));
}
} }
let result: (FileInfo | CommandResult)[] = []; let result: (FileInfo | CommandResult)[] = [];
for(let index = 0; index < files.length; index++) { for(let index = 0; index < files.length; index++) {
if(bulks[index].id === 0) { if(bulks[index].id === 0) {
const info = infos.pop_front(); const info = infos.pop_front();
if(!info) if(!info) {
return Promise.reject(tr("Missing info for bulk ") + index); return Promise.reject(tr("Missing info for bulk ") + index);
}
result.push(info); result.push(info);
} else { } else {

View File

@ -608,7 +608,7 @@ const FileListEntry = (props: { row: TableRow<ListedFileInfo>, columns: TableCol
pageX: e.pageX, pageX: e.pageX,
pageY: e.pageY pageY: e.pageY
}); });
e.preventDefault(); e.stopPropagation();
}} }}
draggable={!props.row.userData.virtual} draggable={!props.row.userData.virtual}
onDragStart={event => { onDragStart={event => {
@ -901,9 +901,7 @@ export class FileBrowser extends ReactComponentBase<FileListTableProperties, Fil
} }
private onBodyContextMenu(event: React.MouseEvent) { private onBodyContextMenu(event: React.MouseEvent) {
if (event.isDefaultPrevented()) return;
event.preventDefault(); event.preventDefault();
this.props.events.fire("action_select_files", {mode: "exclusive", files: []}); this.props.events.fire("action_select_files", {mode: "exclusive", files: []});
this.props.events.fire("action_selection_context_menu", {pageY: event.pageY, pageX: event.pageX}); this.props.events.fire("action_selection_context_menu", {pageY: event.pageY, pageX: event.pageX});
} }

View File

@ -145,7 +145,7 @@ export function initializeRemoteFileBrowserController(connection: ConnectionHand
const response = channelInfos[index]; const response = channelInfos[index];
if (response instanceof CommandResult) { if (response instanceof CommandResult) {
/* some kind of error occured (maybe password set, or non existing) */ /* some kind of error occurred (maybe password set, or non existing) */
result.push({ result.push({
type: FileType.DIRECTORY, type: FileType.DIRECTORY,
name: requestArray[index].name, name: requestArray[index].name,

View File

@ -69,10 +69,12 @@ const ExpendState = (props: { extended: boolean, events: Registry<TransferInfoEv
const [expended, setExpended] = useState(props.extended); const [expended, setExpended] = useState(props.extended);
props.events.reactUse("action_toggle_expansion", event => setExpended(event.visible)); props.events.reactUse("action_toggle_expansion", event => setExpended(event.visible));
return <div className={cssStyle.expansionContainer + (expended ? " " + cssStyle.expended : "")} return (
onClick={() => props.events.fire("action_toggle_expansion", {visible: !expended})}> <div className={cssStyle.expansionContainer + (expended ? " " + cssStyle.expended : "")}
<HTMLRenderer purify={false}>{iconArrow}</HTMLRenderer> onClick={() => props.events.fire("action_toggle_expansion", {visible: !expended})}>
</div>; <HTMLRenderer purify={false}>{iconArrow}</HTMLRenderer>
</div>
);
}; };
const ToggleFinishedTransfersCheckbox = (props: { events: Registry<TransferInfoEvents> }) => { const ToggleFinishedTransfersCheckbox = (props: { events: Registry<TransferInfoEvents> }) => {

View File

@ -145,7 +145,8 @@ export class Table extends React.Component<TableProperties, TableState> {
<div <div
className={cssStyle.container + " " + (this.props.className || " ")} className={cssStyle.container + " " + (this.props.className || " ")}
onDrop={e => this.props.onDrop && this.props.onDrop(e)} onDrop={e => this.props.onDrop && this.props.onDrop(e)}
onDragOver={e => this.props.onDragOver && this.props.onDragOver(e)}> onDragOver={e => this.props.onDragOver && this.props.onDragOver(e)}
>
<div <div
ref={this.refHeader} ref={this.refHeader}
className={cssStyle.header + " " + (this.props.headerClassName || " ")} className={cssStyle.header + " " + (this.props.headerClassName || " ")}