Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,465,495
Community Members
 
Community Events
176
Community Groups

How to set the width of a Client Side Extension column?

Edited

Hello,

I'm updating a Bitbucket add-on to Bitbucket 8 and I'm using Client Side Extensions CSE the first time. I need a custom-column in pull-requests and can achieve this with the following code:

import {ButtonExtension} from '@atlassian/clientside-extensions';

/**
* @clientside-extension
* @extension-point bitbucket.ui.pullrequest.commits.table.column.after
*/
export default ButtonExtension.factory((pluginApi, context) => {
// Visiblity depends per row, but for demo is always disabled.
const isHidden = true;

return {
hidden: isHidden,
header: 'My Header',
iconBefore: 'page',
label: 'My Label',
className: 'my-class',
onAction: () => {
},
};
});

This works, but the column is unexpectedly wide, it has a (implicit) width of 320px. I like to have the width set to 80px. Until now I haven't found any way to configure this statically in the CSE code or any CSS.

More background:

CSE renders the column always, but only if isHidden is false a DIV inside the TD is created. The className is set only to that DIV, but not for the empty TD nor the header TH, so creating a CSS like the following doesn't work:

/* Doesn't work: */
.my-class {
width: 80px;
}

I can use a MutationObserver, but this results in a flicker.

My questions are:

  1. How to set the width of a CSE-column statically?
  2. Ans aside from that: Can I hide/show the CSE-column itself dynamically?

Kind regards,

Jo

1 answer

0 votes

Hi Johannes,

Considering the nature of your question you may find someone who can help in our Developer Community at https://community.developer.atlassian.com/.

Cheers,

Christian

Premier Support Engineer

Atlassian

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events