From 446c5b8cc17c876d1cba8f055d4604844e9986f5 Mon Sep 17 00:00:00 2001 From: Andrew Ferreira Date: Thu, 25 May 2023 19:53:03 -0300 Subject: [PATCH 1/2] fix: adiciona `state_reason` --- scripts/actions/issues.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/actions/issues.mjs b/scripts/actions/issues.mjs index 331af2ea..c72297a1 100644 --- a/scripts/actions/issues.mjs +++ b/scripts/actions/issues.mjs @@ -21,6 +21,7 @@ const data = { body: issue.data.body, date: Date.parse(issue.data.created_at), state: issue.data.state, + state_reason: issue.data.state_reason, number: issue.data.number, labels: issue.data.labels, From 31bc8508922e00106c672246a49b72a83496d6be Mon Sep 17 00:00:00 2001 From: Andrew Ferreira Date: Mon, 29 May 2023 12:44:20 -0300 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20impede=20que=20o=20bot=C3=A3o=20de?= =?UTF-8?q?=20exporta=C3=A7=C3=A3o=20apare=C3=A7a=20quando=20n=C3=A3o=20h?= =?UTF-8?q?=C3=A1=20o=20que=20exportar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- browser/events/dev.ts | 40 ++++--- electron/menu/dev.ts | 2 +- modules/assets/main.scss | 35 ------ .../components/ConfigPlunderGridAttack.vue | 2 +- .../components/ConfigPlunderGridGroups.vue | 2 +- .../components/ConfigPlunderGridOthers.vue | 2 +- .../components/ConfigPlunderGridTemplateC.vue | 2 +- modules/components/ConfigPlunderGridWall.vue | 2 +- modules/components/ErrorLogElectron.vue | 32 ------ .../components/ErrorLogExportButton.vue | 13 ++- modules/components/ErrorLogGeneral.vue | 32 ------ modules/router/error.ts | 21 ---- modules/router/index.ts | 13 ++- modules/views/ConfigView.vue | 37 ++++-- modules/views/ErrorLogView.vue | 108 ++++++++++-------- typings/error.d.ts | 4 +- typings/modules.d.ts | 4 +- 17 files changed, 139 insertions(+), 212 deletions(-) delete mode 100644 modules/components/ErrorLogElectron.vue rename renderer/components/ButtonErrorExport.vue => modules/components/ErrorLogExportButton.vue (82%) delete mode 100644 modules/components/ErrorLogGeneral.vue delete mode 100644 modules/router/error.ts diff --git a/browser/events/dev.ts b/browser/events/dev.ts index e71ae576..6c503484 100644 --- a/browser/events/dev.ts +++ b/browser/events/dev.ts @@ -5,24 +5,30 @@ export function setDevEvents(isDev: boolean) { if (!isDev) return; // A callback desse evento varia conforme o que está sendo testado no momento. - ipcRenderer.on('its-dev-magic', () => { + ipcRenderer.on('dev:magic', () => { console.log('It\'s dev magic!'); - - const previous = document.querySelector('#bot_check[ares="test"]'); - if (previous) { - previous.remove(); - } else { - const botCheck = document.createElement('div'); - botCheck.setAttribute('id', 'bot_check'); - botCheck.setAttribute('ares', 'test'); - - const content = document.queryAndAssert('table#contentContainer'); - content.appendChild(botCheck); - }; + mockRendererProcessError(); }); - ipcRenderer.on('emit-mock-error', () => { - const err = new RendererProcessError('Lorem ipsum dolor sit amet, consectetur adipiscing elit.'); - RendererProcessError.catch(err); - }); + ipcRenderer.on('dev:mock-captcha', () => mockCaptcha()); + ipcRenderer.on('dev:mock-error', () => mockRendererProcessError()); +}; + +function mockCaptcha(): void { + const previous = document.querySelector('#bot_check[ares="test"]'); + if (previous) { + previous.remove(); + } else { + const botCheck = document.createElement('div'); + botCheck.setAttribute('id', 'bot_check'); + botCheck.setAttribute('ares', 'test'); + + const content = document.queryAndAssert('table#contentContainer'); + content.appendChild(botCheck); + }; +}; + +function mockRendererProcessError(): void { + const err = new RendererProcessError('Lorem ipsum dolor sit amet, consectetur adipiscing elit.'); + RendererProcessError.catch(err); }; \ No newline at end of file diff --git a/electron/menu/dev.ts b/electron/menu/dev.ts index 80531bfa..8e8ef58e 100644 --- a/electron/menu/dev.ts +++ b/electron/menu/dev.ts @@ -78,6 +78,6 @@ export function setModuleDevMenu(browserWindow: Electron.BrowserWindow) { function castDevMagic() { const allWebContents = webContents.getAllWebContents(); for (const contents of allWebContents) { - contents.send('its-dev-magic'); + contents.send('dev:magic'); }; }; \ No newline at end of file diff --git a/modules/assets/main.scss b/modules/assets/main.scss index d76571a8..bac3cb2a 100644 --- a/modules/assets/main.scss +++ b/modules/assets/main.scss @@ -10,36 +10,6 @@ html { overflow: hidden; } -.module-nav-bar { - height: 30px; - padding-left: 0.5em; - padding-right: 0.5em; - user-select: none; -} - -@mixin module-tabbed-view-wrapper($margin-bottom: 0) { - position: absolute; - top: 30px; - bottom: 0; - width: 100%; - padding-left: 0.3em; - margin-top: 0.5em; - overflow: hidden; - user-select: none; - - @if $margin-bottom > 0 { - margin-bottom: $margin-bottom; - } -} - -.module-view { - height: 100%; - width: 100%; - overflow-x: hidden; - overflow-y: auto; - user-select: none; -} - .config-divider { margin-top: 1em !important; margin-bottom: 0.5em !important; @@ -47,9 +17,4 @@ html { .config-divider:first-of-type { margin-top: 0.3em !important; -} - -.error-log { - margin-bottom: 0.5em; - user-select: text; } \ No newline at end of file diff --git a/modules/components/ConfigPlunderGridAttack.vue b/modules/components/ConfigPlunderGridAttack.vue index ef8df9c9..c24ceb42 100644 --- a/modules/components/ConfigPlunderGridAttack.vue +++ b/modules/components/ConfigPlunderGridAttack.vue @@ -11,7 +11,7 @@ const props = defineProps<{ }>(); const emit = defineEmits<{ - (event: 'update:config', name: T, value: PlunderConfigType[T]): void; + (e: 'update:config', name: T, value: PlunderConfigType[T]): void; }>(); const maxDistance = ref(props.config.maxDistance); diff --git a/modules/components/ConfigPlunderGridGroups.vue b/modules/components/ConfigPlunderGridGroups.vue index 44eeff6d..454ab263 100644 --- a/modules/components/ConfigPlunderGridGroups.vue +++ b/modules/components/ConfigPlunderGridGroups.vue @@ -13,7 +13,7 @@ const props = defineProps<{ }>(); const emit = defineEmits<{ - (event: 'update:config', name: T, value: PlunderConfigType[T]): void; + (e: 'update:config', name: T, value: PlunderConfigType[T]): void; }>(); const previousGroups = await ipcInvoke('get-village-groups'); diff --git a/modules/components/ConfigPlunderGridOthers.vue b/modules/components/ConfigPlunderGridOthers.vue index 814658de..7e3a6fe6 100644 --- a/modules/components/ConfigPlunderGridOthers.vue +++ b/modules/components/ConfigPlunderGridOthers.vue @@ -10,7 +10,7 @@ const props = defineProps<{ }>(); const emit = defineEmits<{ - (event: 'update:config', name: T, value: PlunderConfigType[T]): void; + (e: 'update:config', name: T, value: PlunderConfigType[T]): void; }>(); const minutesUntilReload = ref(props.config.minutesUntilReload); diff --git a/modules/components/ConfigPlunderGridTemplateC.vue b/modules/components/ConfigPlunderGridTemplateC.vue index 4a778246..b4471d30 100644 --- a/modules/components/ConfigPlunderGridTemplateC.vue +++ b/modules/components/ConfigPlunderGridTemplateC.vue @@ -10,7 +10,7 @@ const props = defineProps<{ }>(); const emit = defineEmits<{ - (event: 'update:config', name: T, value: PlunderConfigType[T]): void; + (e: 'update:config', name: T, value: PlunderConfigType[T]): void; }>(); const useCPattern = ref(props.config.useCPattern); diff --git a/modules/components/ConfigPlunderGridWall.vue b/modules/components/ConfigPlunderGridWall.vue index 984c73b0..163be9d4 100644 --- a/modules/components/ConfigPlunderGridWall.vue +++ b/modules/components/ConfigPlunderGridWall.vue @@ -13,7 +13,7 @@ const props = defineProps<{ }>(); const emit = defineEmits<{ - (event: 'update:config', name: T, value: PlunderConfigType[T]): void; + (e: 'update:config', name: T, value: PlunderConfigType[T]): void; }>(); const dialog = useDialog(); diff --git a/modules/components/ErrorLogElectron.vue b/modules/components/ErrorLogElectron.vue deleted file mode 100644 index 95b0fa0d..00000000 --- a/modules/components/ErrorLogElectron.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - \ No newline at end of file diff --git a/renderer/components/ButtonErrorExport.vue b/modules/components/ErrorLogExportButton.vue similarity index 82% rename from renderer/components/ButtonErrorExport.vue rename to modules/components/ErrorLogExportButton.vue index 6f7772a7..7768dbc0 100644 --- a/renderer/components/ButtonErrorExport.vue +++ b/modules/components/ErrorLogExportButton.vue @@ -4,7 +4,11 @@ import { NButton, useMessage } from 'naive-ui'; import { ipcInvoke } from '$renderer/ipc'; defineProps<{ - buttonTop: string; + top: string; +}>(); + +const emit = defineEmits<{ + (e: 'export'): void; }>(); const message = useMessage(); @@ -15,6 +19,7 @@ async function exportLog() { const status = await ipcInvoke('error:export'); if (status === 'sucess') { message.success('Tudo certo!'); + emit('export'); } else if (status === 'error') { message.error('Erro ao exportar o registro de erros.'); }; @@ -24,7 +29,7 @@ async function exportLog() { \ No newline at end of file diff --git a/modules/views/ErrorLogView.vue b/modules/views/ErrorLogView.vue index d3f1dd14..7ca5a5bf 100644 --- a/modules/views/ErrorLogView.vue +++ b/modules/views/ErrorLogView.vue @@ -1,64 +1,78 @@ \ No newline at end of file diff --git a/typings/error.d.ts b/typings/error.d.ts index 7a20d1a2..56095042 100644 --- a/typings/error.d.ts +++ b/typings/error.d.ts @@ -16,4 +16,6 @@ type ElectronErrorLogType = EnvironmentInfo & ErrorLogBase; type OmitOptionalErrorLogProps = Omit; type AllErrorLogTypes = | OmitOptionalErrorLogProps & Partial> - | OmitOptionalErrorLogProps & Partial>; \ No newline at end of file + | OmitOptionalErrorLogProps & Partial>; + +type ErrorCard = Omit & { id: string }; \ No newline at end of file diff --git a/typings/modules.d.ts b/typings/modules.d.ts index 7c19407b..8e42c33f 100644 --- a/typings/modules.d.ts +++ b/typings/modules.d.ts @@ -23,12 +23,10 @@ type SingleModules = type NestedModules = 'app-config' | 'error-log'; type ModuleNames = NestedModules | SingleModules; -type ErrorModuleRoutes = 'error-electron' | 'error-general'; - type ConfigModuleRoutes = 'config-advanced' | 'config-general' | 'config-notifications' | 'config-plunder'; -type ModuleRoutes = ConfigModuleRoutes | ErrorModuleRoutes | ModuleNames; +type ModuleRoutes = ConfigModuleRoutes | ModuleNames; // WEBSITE type WebsiteModuleNames = 'any-allowed' | 'ares' | 'issues' | 'repo'; \ No newline at end of file