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

feat(shell-center-row): add slot for action-bar #1015

Merged
merged 16 commits into from
Jun 16, 2020

Conversation

asangma
Copy link
Contributor

@asangma asangma commented Jun 11, 2020

Related Issue: #1007

Summary

Add slot for ActionBar.

@asangma asangma added this to the Neptr milestone Jun 11, 2020
@asangma asangma self-assigned this Jun 11, 2020
@asangma asangma marked this pull request as ready for review June 16, 2020 15:17
@asangma asangma requested a review from a team as a code owner June 16, 2020 15:17
@asangma asangma requested a review from driskull June 16, 2020 15:17
@asangma
Copy link
Contributor Author

asangma commented Jun 16, 2020

@kat10140 Let me know if you want to sync re: doc for this.

@asangma
Copy link
Contributor Author

asangma commented Jun 16, 2020

@driskull Just realized I need to add some e2es and stuff.

@asangma
Copy link
Contributor Author

asangma commented Jun 16, 2020

Hokay! Added E2E for action-bar slot and tweaked Readme.

Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

Had a few comments. Good to merge after these are addressed. 👍

@@ -343,7 +343,7 @@ <h2>Boomer v Millennial - California</h2>
<tr>
<td class="sml"><calcite-icon icon="square" scale="s"></calcite-icon></td>
<td>01</td>
<td>Can't keep Johnny down.</td>
<td>LAST</td>
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: if this is meant to call out being last, can you update this to "This should be last" or something similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

border-left: none;
border-right: 1px solid var(--calcite-app-border);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Could you run Prettier on this file? It should add a trailing newline and ensure space between props and values.

border-right: 1px solid var(--calcite-app-border);
}
::slotted(calcite-action-bar[position="end"]) {
border-left: 1px solid var(--calcite-app-border);
Copy link
Member

Choose a reason for hiding this comment

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

Can you store 1px solid var(--calcite-app-border) in a var and reuse?


expect(actionBarContainer).not.toBeNull();
});

Copy link
Member

Choose a reason for hiding this comment

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

This needs a test for the start/end positioning of action-bar.

Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

Just some cleanup suggestions.

);

const actionBar = getSlotted<HTMLCalciteActionBarElement>(el, SLOTS.actionBar);
Copy link
Member

Choose a reason for hiding this comment

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

suggestion:

const actionBarNode = getSlotted<HTMLCalciteActionBarElement>(el, SLOTS.actionBar) ? (
      <div class={{ [CSS.actionBarContainer]: true, [CSS_UTILITY.rtl]: rtl }}>
        <slot name={SLOTS.actionBar} />
      </div>
    ) : null;

</div>
);

const children = [contentNode];
Copy link
Member

Choose a reason for hiding this comment

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

suggestion:

const children = [actionBarNode, contentNode];

if(actionBar.position === "end"){
children.reverse();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't I need to nest this in a conditional for whether or not there's an action-bar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh...I see. Lemme try dat.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think so. it won't render anything null


const actionBar = getSlotted<HTMLCalciteActionBarElement>(el, SLOTS.actionBar);

if (!actionBar) {
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: remove this block.

@asangma
Copy link
Contributor Author

asangma commented Jun 16, 2020

Thanks @jcfranco. I'll do all the things.

@asangma
Copy link
Contributor Author

asangma commented Jun 16, 2020

@jcfranco @driskull Please give it another review. 🙏

Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

👍

@@ -73,7 +73,7 @@ export class CalciteActionBar {
/**
* Arranges the component depending on the elements 'dir' property.
*/
@Prop({ reflect: true }) position: CalcitePosition;
@Prop({ reflect: true }) position: CalcitePosition = "start";
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this to have a value or can we assume start if not present?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am using that attribute in the styles in center-row.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although...yeah. I see. I'll update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@driskull Done. Thanks.

Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

💥

@@ -10,6 +10,8 @@
--calcite-app-shell-center-row-height-small: 33%;
--calcite-app-shell-center-row-height-medium: 70%;
--calcite-app-shell-center-row-height-large: 100%;

--calcite-app-shell-center-row-border: 1px solid var(--calcite-app-border);
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I meant to suggest a sass var for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh. Is it better as a sass var?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jcfranco I'm down to do that but we would wanna update all the sass files to use that var, yeah?

@asangma asangma merged commit 676ce47 into master Jun 16, 2020
@asangma asangma deleted the alan0002/center-row-action-bar-1007 branch June 16, 2020 22:18
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.

3 participants