Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Created ButtonComponent and extended LinkComponent to receive components to be wrapped as links #2255

Merged
merged 1 commit into from
Apr 8, 2021

Conversation

ftovaro
Copy link
Contributor

@ftovaro ftovaro commented Mar 31, 2021

Signed-off-by: ftovaro [email protected]

What this PR does / why we need it:
It solves two things:

  1. We can now have buttons without a button group
  2. We can pass components to a LinkComponent to use it as a link

Which issue(s) this PR fixes

Special notes for your reviewer:
This is how the button looks like, here is being used as a link:

Screen Shot 2021-04-05 at 2 33 04 PM

This is the HTML generated for the button inside a LinkComponent:

<a target="_blank" href="http:https://www.google.com" class="ng-star-inserted">
   <app-view-container class="component" ...>
      <app-single-button class="ng-star-inserted">
         <button class="btn btn-outline btn-sm"> single button in link</button>
      </app-single-button>
   </app-view-container>
</a>

This is how you can pass a component to a LinkComponent:

btn := component.NewButton("button in link", action.Payload{})
btnLink := component.NewLink("title", "value","http:https://www.google.com", component.WithComponent(btn))

Release note:

release-note

@ftovaro ftovaro changed the title Create single button component Create single button component [WIP] Mar 31, 2021
@ftovaro ftovaro force-pushed the issue-2208 branch 5 times, most recently from 462c002 to ef81939 Compare April 5, 2021 19:45
@ftovaro ftovaro changed the title Create single button component [WIP] Created SingleButtonComponent and extended LinkComponent to receive components to be wrapped as links Apr 5, 2021
@ftovaro ftovaro marked this pull request as ready for review April 5, 2021 19:55
pkg/view/component/base.go Outdated Show resolved Hide resolved
pkg/view/component/single_button.go Outdated Show resolved Hide resolved
pkg/view/component/link.go Show resolved Hide resolved
@ftovaro ftovaro changed the title Created SingleButtonComponent and extended LinkComponent to receive components to be wrapped as links Created ButtonComponent and extended LinkComponent to receive components to be wrapped as links Apr 6, 2021
@ftovaro ftovaro force-pushed the issue-2208 branch 2 times, most recently from ca49071 to c2c1156 Compare April 6, 2021 21:15
@ftovaro ftovaro requested a review from wwitzel3 April 6, 2021 21:23
@ftovaro ftovaro force-pushed the issue-2208 branch 9 times, most recently from 15f0b62 to d7f8342 Compare April 7, 2021 01:10
pkg/view/component/button.go Show resolved Hide resolved
pkg/view/component/button.go Show resolved Hide resolved
pkg/view/component/button_group.go Outdated Show resolved Hide resolved
pkg/view/component/button_group.go Outdated Show resolved Hide resolved
pkg/view/component/port.go Outdated Show resolved Hide resolved
pkg/view/component/table.go Outdated Show resolved Hide resolved
pkg/view/flexlayout/flexlayout.go Outdated Show resolved Hide resolved
pkg/view/flexlayout/flexlayout_test.go Outdated Show resolved Hide resolved
@ftovaro ftovaro force-pushed the issue-2208 branch 9 times, most recently from ce209e4 to 6c1a43c Compare April 7, 2021 17:31
@GuessWhoSamFoo GuessWhoSamFoo merged commit e7a019e into vmware-archive:master Apr 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buttons should be able to link
4 participants