Skip to content

Commit

Permalink
Add approve button as an indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
malberts committed Aug 5, 2024
1 parent 39892eb commit 0d67eba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions resources/PageApprovals.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.page-approval-container {
position: absolute;
top: -55px;
right: 0;
z-index: 1;
display: flex;
align-items: center;
Expand Down
6 changes: 3 additions & 3 deletions src/Presentation/OutputPageUiPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function presentUi( UiArguments $arguments ): void {
return;
}

$this->out->addHTML(
PageApprovals::getInstance()->getTemplateParser()->processTemplate(
$this->out->setIndicators( [
'page-approvals' => PageApprovals::getInstance()->getTemplateParser()->processTemplate(
'PageApprovalStatus',
[
'isPageApproved' => $arguments->pageIsApproved,
Expand All @@ -35,7 +35,7 @@ public function presentUi( UiArguments $arguments ): void {
'approvalTimestamp' => $arguments->approvalTimestamp
]
)
);
] );

$this->out->addModuleStyles( 'ext.pageApprovals.styles' );
$this->out->addModules( 'ext.pageApprovals.scripts' );
Expand Down
6 changes: 3 additions & 3 deletions tests/EntryPoints/PageApprovalsHooksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public function testOnOutputPageBeforeHTMLUiIsShown() {

PageApprovalsHooks::onOutputPageBeforeHTML( $this->out );

$this->assertStringContainsString(
'page-approval-container',
$this->out->getHTML(),
$this->assertArrayHasKey(
'page-approvals',
$this->out->getIndicators(),
'The page approval status should be displayed with a matching category.'
);
}
Expand Down

0 comments on commit 0d67eba

Please sign in to comment.