Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Right layout panel #1085

Merged
merged 37 commits into from
Apr 14, 2020
Merged

[Feature] Right layout panel #1085

merged 37 commits into from
Apr 14, 2020

Conversation

ibelar
Copy link
Contributor

@ibelar ibelar commented Apr 10, 2020

Implementation of Panel\Right

Display on-demand content via a right-side panel. It can display static or dynamic content via callback.
Panel is displayed (show) via a javascript event and content can be loaded via callback. The callback URL may also carry data from the triggering element, allowing to load model data into panel.

Panel look and size, as well as panel content, can be customized via HTML template or css class definition.

Sample usage:

$panel_1 = $app->layout->addRightPanel(new \atk4\ui\Panel\Right());
$btn = Button::addTo($app, ['Button 1']);
$btn->js(true)->data('btn', '1');
$btn->on('click', $panel_1->jsOpen(['btn'], 'orange'));

$btn = Button::addTo($app, ['Button 2']);
$btn->js(true)->data('btn', '2');
$btn->on('click', $panel_1->jsOpen(['btn'], 'orange'));

$panel_1->onOpen(function($p) {
    $btn_number = $_GET['btn'] ?? null;
    $text =  'You loaded panel content using button #' . $btn_number;
    Message::addTo($p, ['Panel 1', 'text' => $text]);
});

Note:

see: demos/layout-panel.php for more info.
required atkjs-ui version 1.13.0

Screen Shot 2020-04-10 at 2 01 36 PM

@ibelar ibelar changed the title Feature/right panel [Feature] Right layout panel Apr 10, 2020
@codecov
Copy link

codecov bot commented Apr 10, 2020

Codecov Report

Merging #1085 into develop will increase coverage by 0.15%.
The diff coverage is 87.14%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1085      +/-   ##
=============================================
+ Coverage      75.81%   75.96%   +0.15%     
- Complexity      2627     2653      +26     
=============================================
  Files            125      128       +3     
  Lines           6172     6242      +70     
=============================================
+ Hits            4679     4742      +63     
- Misses          1493     1500       +7     
Impacted Files Coverage Δ Complexity Δ
src/Panel/Right.php 83.01% <83.01%> (ø) 19.00 <19.00> (?)
src/Layout/Generic.php 100.00% <100.00%> (ø) 1.00 <1.00> (?)
src/Panel/Content.php 100.00% <100.00%> (ø) 6.00 <6.00> (?)
src/Card.php 70.73% <0.00%> (+0.81%) 60.00% <0.00%> (ø%)
src/Message.php 72.22% <0.00%> (+5.55%) 8.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 46d359f...46d359f. Read the comment docs.

@ibelar ibelar mentioned this pull request Apr 14, 2020
@DarkSide666 DarkSide666 self-requested a review April 14, 2020 21:21
Copy link
Member

@DarkSide666 DarkSide666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work !!!

@DarkSide666 DarkSide666 merged commit 03f0ab2 into develop Apr 14, 2020
@DarkSide666 DarkSide666 deleted the feature/right-panel branch April 14, 2020 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants