diff --git a/CHANGELOG.md b/CHANGELOG.md index f6a24cd1ab..5a7ee3212b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,12 +8,19 @@ e este projeto adere ao [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Melhorias - Implementa hook no método registerRegistrationMetadata da oportunidade, para possibilitar incremento de novos registros atrevéz de plugins e módulos - Implementa novos hook's para possibilitar manipulação da tela de listagem de fases +- Implementa possibilidade de definir mascaras em inputs do entity-field +- Implementa contante global mcTabActive para guadar a aba que o mc-tab está selecionada +- Implementa getter lastPhase() para as inscrições, possibilitando recuperar a entidade da inscrição na ultima fase ### Correções - Corrige erro no carregamento do formulário de avaliação para o avaliador - Ajusta estêncil do upload de imagem para carregar ja no tamanho máximo permitido - Corrige db-update que atualiza legado da distribuição de avaliaçações por categoria - Corrige db-update que cria as colunas eligible e score +- Corrige remoção de abas do componente mc-tabs + +### Melhorias não funcionais +- Refatora script start.sh e middleware ExecutionTime para fornecer um log mais limpo para o desenvolvedor ## [7.4] 2024-05-28 ### Novas funcionalidades diff --git a/docker/development/start.sh b/docker/development/start.sh index be8065538e..75c1138a44 100755 --- a/docker/development/start.sh +++ b/docker/development/start.sh @@ -1,3 +1,3 @@ #!/bin/bash -php -S 0.0.0.0:80 -t /var/www/html /var/www/dev/router.php \ No newline at end of file +php -S 0.0.0.0:80 -q -t /var/www/html /var/www/dev/router.php \ No newline at end of file diff --git a/src/core/Entities/Opportunity.php b/src/core/Entities/Opportunity.php index f90bd0a0cc..a46d299d7a 100644 --- a/src/core/Entities/Opportunity.php +++ b/src/core/Entities/Opportunity.php @@ -1139,7 +1139,7 @@ function registerRegistrationMetadata($also_previous_phases = false){ $app->registerMetadata($metadata, Registration::class); } - $app->applyHookBoundTo($this, "{$this->hookPrefix}.registrationMetadada"); + $app->applyHookBoundTo($this, "{$this->hookPrefix}.registrationMetadata"); if($also_previous_phases && $this->parent) { $this->previousPhase->registerRegistrationMetadata(); diff --git a/src/core/Entity.php b/src/core/Entity.php index fe27a636a4..e7b714eb4d 100644 --- a/src/core/Entity.php +++ b/src/core/Entity.php @@ -1215,12 +1215,12 @@ public function postPersist($args = null){ $hook_prefix = $this->getHookPrefix(); -// $app->applyHookBoundTo($this, "{$hook_prefix}.insert:after"); -// -// if ($this->usesPermissionCache()) { -// $this->createPermissionsCacheForUsers([$this->ownerUser]); -// $app->enqueueEntityToPCacheRecreation($this); -// } + $app->applyHookBoundTo($this, "{$hook_prefix}.insert:after"); + + if ($this->usesPermissionCache()) { + $this->createPermissionsCacheForUsers([$this->ownerUser]); + $app->enqueueEntityToPCacheRecreation($this); + } } /** diff --git a/src/core/Middlewares/ExecutionTime.php b/src/core/Middlewares/ExecutionTime.php index 95d5df4462..0ea7b41cb5 100644 --- a/src/core/Middlewares/ExecutionTime.php +++ b/src/core/Middlewares/ExecutionTime.php @@ -11,7 +11,8 @@ public function __invoke(Request $request, RequestHandler $handler) { $app = App::i(); $app->log->info('========================================================================='); - + $app->log->debug($_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI']); + $response = $handler->handle($request); $endTime = microtime(true); diff --git a/src/modules/Components/components/mc-image-uploader/script.js b/src/modules/Components/components/mc-image-uploader/script.js index b271d29db8..1a5285ca3c 100644 --- a/src/modules/Components/components/mc-image-uploader/script.js +++ b/src/modules/Components/components/mc-image-uploader/script.js @@ -139,13 +139,13 @@ app.component("mc-image-uploader", { }, loadImage(event, modal) { - modal.open(); - // Reference to the DOM input element const { files } = event.target; - const filename = event.target.value.split(/(\\|\/)/g).pop(); - // Ensure that you have a file before attempting to read it if (files && files[0]) { + modal.open(); + const filename = event.target.value.split(/(\\|\/)/g).pop(); + + // Ensure that you have a file before attempting to read it // 1. Revoke the object URL, to allow the garbage collector to destroy the uploaded before file if (this.image.src) { URL.revokeObjectURL(this.image.src); diff --git a/src/modules/Components/components/mc-tab/script.js b/src/modules/Components/components/mc-tab/script.js index 78842538c7..4c259a0ba8 100644 --- a/src/modules/Components/components/mc-tab/script.js +++ b/src/modules/Components/components/mc-tab/script.js @@ -34,12 +34,14 @@ app.component('mc-tab', { const hash = '#' + (!props.disabled ? props.slug : '') const isActive = Vue.ref(false) const tabsProvider = Vue.inject('tabsProvider') + const global = useGlobalState(); let timeout = null Vue.watch( () => tabsProvider.activeTab, () => { isActive.value = props.slug === tabsProvider.activeTab?.slug + global.mcTabActive = tabsProvider.activeTab?.slug; window.clearTimeout(timeout) if (props.cache) { @@ -67,6 +69,15 @@ app.component('mc-tab', { }) }) + Vue.onBeforeUnmount(() => { + const tab = tabsProvider.tabs.find((tab) => tab.hash == hash); + + const index = tabsProvider.tabs.indexOf(tab); + if (index > -1) { + tabsProvider.tabs.splice(index, 1); + } + }); + return { cached, hash, diff --git a/src/modules/Entities/components/entity-field/script.js b/src/modules/Entities/components/entity-field/script.js index 739a5f2ec9..eea0210c7d 100644 --- a/src/modules/Entities/components/entity-field/script.js +++ b/src/modules/Entities/components/entity-field/script.js @@ -122,6 +122,10 @@ app.component('entity-field', { type: Boolean, default: false }, + mask: { + type: String, + default: null, + }, }, computed: { diff --git a/src/modules/Entities/components/entity-field/template.php b/src/modules/Entities/components/entity-field/template.php index 4a590cf9b3..d7cdfaf9bc 100644 --- a/src/modules/Entities/components/entity-field/template.php +++ b/src/modules/Entities/components/entity-field/template.php @@ -25,6 +25,7 @@ +
diff --git a/src/modules/Opportunities/components/opportunity-phases-timeline/template.php b/src/modules/Opportunities/components/opportunity-phases-timeline/template.php index e4b4422ff8..5d42752c6b 100644 --- a/src/modules/Opportunities/components/opportunity-phases-timeline/template.php +++ b/src/modules/Opportunities/components/opportunity-phases-timeline/template.php @@ -12,6 +12,7 @@ '); ?>
+ applyComponentHook('item', 'before'); ?>
@@ -44,4 +45,5 @@ applyComponentHook('item', 'end'); ?>
+ applyComponentHook('item', 'after'); ?>
\ No newline at end of file diff --git a/src/modules/Opportunities/views/registration/single.php b/src/modules/Opportunities/views/registration/single.php index eaec2c3330..dcafad2cfd 100644 --- a/src/modules/Opportunities/views/registration/single.php +++ b/src/modules/Opportunities/views/registration/single.php @@ -42,6 +42,8 @@ + applyTemplateHook('single-tab', 'begin') ?> +
@@ -299,5 +301,7 @@
+ + applyTemplateHook('single-tab', 'end') ?>
\ No newline at end of file diff --git a/src/modules/OpportunityPhases/Module.php b/src/modules/OpportunityPhases/Module.php index b83c4834ad..b77f544485 100644 --- a/src/modules/OpportunityPhases/Module.php +++ b/src/modules/OpportunityPhases/Module.php @@ -551,6 +551,11 @@ function _init () { return; }); + $app->hook('entity(Registration).get(lastPhase)', function(&$value) use ($app) { + /** @var Registration $this */ + $value = $app->repo('Registration')->findOneBy(['number' => $this->number, 'opportunity' => $this->opportunity->lastPhase]); + }); + /** * Getters das fases de avaliação */