diff --git a/CHANGELOG.md b/CHANGELOG.md index 64ce2a00..187b5e15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +# Versão [1.3.21] + +## Correções + +### Erro Validate Patch Fail. Please input patch file. (arquivos zip) [#1136](https://github.com/totvs/tds-vscode/issues/1136) + +Corrigido de validação de patch em arquivos Zip. + +### Erro "Get organization list could not be executed" ao aplicar patch em ambiente TSS [#1139](https://github.com/totvs/tds-vscode/issues/1139) + +Corrigido problema que causava erro ao aplicar patch em ambiente TSS. + +### Não permite aplicar patch com fontes mais antigos que o do RPO + +Removida a trava adicionada que estava impedindo a aplicação de patches com fontes mais antigos de o do RPO. + +### Validação de patch não finaliza no Linux/MaoOS + +Após validação no Linux/MacOS a ação de aplicação de patch não estava sendo liberada. + # Versão [1.3.20] ## Correções diff --git a/package.json b/package.json index 394cb3e4..b6c03850 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "tds-vscode", "displayName": "TOTVS Developer Studio for VSCode (AdvPL, TLPP e 4GL)", "description": "%tds.package.description%", - "version": "1.3.20", + "version": "1.3.21", "publisher": "TOTVS", "author": { "name": "TOTVS", @@ -82,7 +82,7 @@ "@material-ui/icons": "^4.11.2", "@material-ui/lab": "^4.11.3-deprecations.1", "@totvs/tds-da": "^1.2.62", - "@totvs/tds-ls": "^1.2.73", + "@totvs/tds-ls": "^1.2.74", "@types/react": "^16.14.20", "@types/vscode": "^1.63.1", "@vscode/debugadapter": "^1.51.1", diff --git a/src/patch/formApplyPatch.html b/src/patch/formApplyPatch.html index 6c42d83d..9e0fb588 100644 --- a/src/patch/formApplyPatch.html +++ b/src/patch/formApplyPatch.html @@ -231,6 +231,7 @@ window.addEventListener('message', event => { const message = event.data; // The JSON data our extension sent + //console.log("formApplyPatch receive: " + message.command); switch (message.command) { case 'setCurrentServer': const server = message.serverCurrent; @@ -238,11 +239,7 @@ document.getElementById('serverAddressID').value = server.address + ":" + server.port; document.getElementById('serverEnvironmentID').value = server.environment break; - case 'addFilepath': - addFile(message.file); - break; case 'patchValidationRet': - //console.log("patchValidationRet"); const file = message.file.toLowerCase(); //console.log("file: "+file); var patchs = tableAPI.data(); @@ -301,14 +298,7 @@ var ext = getExtension(filename); //console.log("ext: "+ext); - if (ext.toLowerCase() === 'zip') { - vscode.postMessage({ - command: 'extractPatchsFiles', - files: [fullPath] - }) - } else { - fnProc(filename, fullPath); - } + fnProc(filename, fullPath); } function getFilename(filePath) { @@ -362,14 +352,15 @@ //console.log("hasOld: "+hasOld); if (hasOld) { //console.log("ApplyOldID: "+(document.getElementById('ApplyOldID').checked?"checked":"not checked")); + document.getElementById('OutputMessage').style = "color: red"; if (!document.getElementById('ApplyOldID').checked) { - document.getElementById('OutputMessage').style = "color: red"; - document.getElementById('OutputMessage').innerHTML = "There are patches with resources older than RPO. To apply those patches you must enable 'Apply old files' checkbox."; - return; + // warning: has Old resource + document.getElementById('OutputMessage').innerHTML = "There are patches with resources older than RPO."; } else { - // has Old resource but user agreed to apply anyway - validationOk = true; + // warning: has Old resource but user choose to overwrite anyway + document.getElementById('OutputMessage').innerHTML = "There are patches with resources older than RPO and they will overwrite newer resources in RPO."; } + validationOk = true; } //console.log("validationInProgress: "+validationInProgress); //console.log("validationOk: "+validationOk); diff --git a/src/patch/patchApply.ts b/src/patch/patchApply.ts index 905e0fe7..f57b8342 100644 --- a/src/patch/patchApply.ts +++ b/src/patch/patchApply.ts @@ -201,54 +201,6 @@ export function patchApply( break; - case "extractPatchsFiles": - // msg emitida com tempo, pois o processo de verificação do zip - // é muito rápido (zip de expedição contiuna com +40M e 4 ptm, leva < 2 seg) - - vscode.window.withProgress( - { - location: vscode.ProgressLocation.Window, - cancellable: false, - title: `${localize( - "tds.vscode.starting.build.patch", - "Checking zip files" - )}`, - }, - async (progress) => { - progress.report({ increment: 0 }); - - await extractPatchsFiles(message.files).then( - async (files) => { - if (files.length === 0) { - vscode.window.showWarningMessage( - "No patch file found in zip files." - ); - } else { - const step = 100 / (files.length + 2); - - for await (const element of files) { - progress.report({ - increment: step, - }); - - if (currentPanel) { - currentPanel.webview.postMessage({ - command: "addFilepath", - file: element, - }); - } - } - } - }, - (reason: any) => { - vscode.window.showErrorMessage(reason); - } - ); - progress.report({ increment: 100 }); - } - ); - break; - case "showDuplicateWarning": vscode.window.showWarningMessage( "Already selected. File: " + message.filename @@ -468,7 +420,9 @@ async function doValidatePatch( var patchFilePath = patchFile.path; var retMessage = "No validation errors"; var oldResource = false; - if (patchFilePath.startsWith("/")) { + if (patchFilePath.startsWith("/") && patchFilePath.length > 2 && patchFilePath.at(2) === ':') { + // se formato for windows /d:/totvs/patch/12.1.2210/expedicao_continua_12_1_2210_atf_tttm120_hp.ptm + // remove a / inicial patchFilePath = patchFilePath.substring(1); } if (!response.error) {