yii2-bootstrap4 icon indicating copy to clipboard operation
yii2-bootstrap4 copied to clipboard

Fixes issue #181

Open marcovtwout opened this issue 5 years ago • 9 comments

Q A
Is bugfix? no
New feature? yes
Breaks BC? yes
Tests pass? yes
Fixed issues #181

marcovtwout avatar Jan 24 '20 16:01 marcovtwout

step forward

WinterSilence avatar May 14 '21 04:05 WinterSilence

Yes, @marcovtwout could you refactor it to use the new parent's method?

bizley avatar May 14 '21 08:05 bizley

@bizley PR updated, but I assume tests will fail until yiisoft/yii gets the next stable release.

marcovtwout avatar May 14 '21 08:05 marcovtwout

Yes, not a problem, we will wait. Thank you.

bizley avatar May 14 '21 08:05 bizley

I assume tests will fail until yiisoft/yii gets the next stable release.

Then we need to bump minimal version in composer.json before release.

samdark avatar May 14 '21 22:05 samdark

@marcovtwout possible error: yii\bootstrap4\ToggleButtonGroup::$name is empty when model not set https://github.com/yiisoft/yii2-bootstrap4/blob/37a0cc2f11f6f38b562ab9306eed2f899b72838a/src/ToggleButtonGroup.php#L92 (i checked chain yii\widgets\InputWidget::init() - yii\bootstrap4\ToggleButtonGroup::init()). Current test not cover this case, need test something like this:

    public function testCheckboxNoModel()
    {
        \yii\bootstrap4\Html::$counter = 0;
        $html = ToggleButtonGroup::widget([
            'type' => ToggleButtonGroup::TYPE_CHECKBOX,
            'name' => 'nomodel[value]',
            'items' => [
                '1' => 'item 1',
                '2' => 'item 2',
            ],
        ]);

        $this->assertContains('...', $html);
    }

WinterSilence avatar May 14 '21 23:05 WinterSilence

@WinterSilence I don't think that is correct - all input widgets require either model+attribute or name to be set: https://github.com/yiisoft/yii2/blob/master/framework/widgets/InputWidget.php#L74-L76 - so name should always be available.

marcovtwout avatar May 17 '21 08:05 marcovtwout

@marcovtwout you right, my fail - config loaded before init()

WinterSilence avatar May 17 '21 12:05 WinterSilence

Updated Changelog and composer.json. Note that yii2 2.0.43 is not release yet, I suggest to rerun tests and merge this PR after 2.0.43 is released.

marcovtwout avatar May 31 '21 12:05 marcovtwout

@samdark Could you trigger the build again to see if it now passes? If it passes, it can be merged.

marcovtwout avatar Dec 15 '22 11:12 marcovtwout

Done. Failed.

samdark avatar Dec 17 '22 17:12 samdark

@samdark The failed CI is unrelated to this PR, see https://github.com/yiisoft/yii2-bootstrap4/issues/230

marcovtwout avatar Dec 20 '22 13:12 marcovtwout

👍🏻

bizley avatar Dec 23 '22 14:12 bizley