Skip to content

Commit 3a79696

Browse files
Revert "feat(custom-views): Add custom views to issue stream behind feature flag (#75883)"
This reverts commit 28a4dd2. Co-authored-by: MichaelSun48 <[email protected]>
1 parent 550a54c commit 3a79696

13 files changed

+222
-498
lines changed

static/app/components/draggableTabs/draggableTabList.tsx

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function BaseDraggableTabList({
3030
outerWrapStyles,
3131
onReorder,
3232
onAddView,
33+
showTempTab = false,
3334
tabVariant = 'filled',
3435
...props
3536
}: BaseDraggableTabListProps) {
@@ -71,7 +72,7 @@ function BaseDraggableTabList({
7172
useEffect(() => {
7273
setTabListState(state);
7374
// eslint-disable-next-line react-hooks/exhaustive-deps
74-
}, [state.selectedItem, state.selectedKey, props.children]);
75+
}, [state.disabledKeys, state.selectedItem, state.selectedKey, props.children]);
7576

7677
// Detect tabs that overflow from the wrapper and put them in an overflow menu
7778
const tabItemsRef = useRef<Record<string | number, HTMLLIElement | null>>({});
@@ -118,14 +119,11 @@ function BaseDraggableTabList({
118119
variant={tabVariant}
119120
/>
120121
</Reorder.Item>
121-
<TabDivider
122-
layout
123-
active={
124-
state.selectedKey === 'temporary-tab' ||
125-
(state.selectedKey !== item.key &&
126-
state.collection.getKeyAfter(item.key) !== state.selectedKey)
127-
}
128-
/>
122+
{(state.selectedKey === 'temporary-tab' ||
123+
(state.selectedKey !== item.key &&
124+
state.collection.getKeyAfter(item.key) !== state.selectedKey)) && (
125+
<TabDivider layout />
126+
)}
129127
</Fragment>
130128
))}
131129
</TabListWrap>
@@ -136,9 +134,9 @@ function BaseDraggableTabList({
136134
{t('Add View')}
137135
</AddViewButton>
138136
</MotionWrapper>
139-
<TabDivider layout active />
137+
<TabDivider layout />
140138
<MotionWrapper layout>
141-
{tempTab && (
139+
{showTempTab && tempTab && (
142140
<Tab
143141
key={tempTab.key}
144142
item={tempTab}
@@ -175,7 +173,12 @@ export interface DraggableTabListProps
175173
* To be used as a direct child of the <Tabs /> component. See example usage
176174
* in tabs.stories.js
177175
*/
178-
export function DraggableTabList({items, onAddView, ...props}: DraggableTabListProps) {
176+
export function DraggableTabList({
177+
items,
178+
onAddView,
179+
showTempTab,
180+
...props
181+
}: DraggableTabListProps) {
179182
const collection = useCollection({items, ...props}, collectionFactory);
180183

181184
const parsedItems = useMemo(
@@ -196,6 +199,7 @@ export function DraggableTabList({items, onAddView, ...props}: DraggableTabListP
196199
<BaseDraggableTabList
197200
items={parsedItems}
198201
onAddView={onAddView}
202+
showTempTab={showTempTab}
199203
disabledKeys={disabledKeys}
200204
{...props}
201205
>
@@ -206,18 +210,11 @@ export function DraggableTabList({items, onAddView, ...props}: DraggableTabListP
206210

207211
DraggableTabList.Item = Item;
208212

209-
const TabDivider = styled(motion.div)<{active: boolean}>`
210-
${p =>
211-
p.active &&
212-
`
213-
background-color: ${p.theme.gray200};
214-
height: 50%;
215-
width: 1px;
216-
border-radius: 6px;
217-
margin-right: ${space(0.5)};
218-
`}
219-
margin-top: 1px;
220-
margin-left: ${space(0.5)};
213+
const TabDivider = styled(motion.div)`
214+
height: 50%;
215+
width: 1px;
216+
border-radius: 6px;
217+
background-color: ${p => p.theme.gray200};
221218
`;
222219

223220
const TabListOuterWrap = styled('div')<{
@@ -255,13 +252,14 @@ const TabListWrap = styled('ul')`
255252
const AddViewButton = styled(Button)`
256253
display: flex;
257254
color: ${p => p.theme.gray300};
255+
padding-right: ${space(0.5)};
256+
margin: 4px 2px 2px 2px;
258257
font-weight: normal;
259-
padding: ${space(0.5)};
260-
transform: translateY(1px);
261258
`;
262259

263260
const StyledIconAdd = styled(IconAdd)`
264261
margin-right: 4px;
262+
margin-left: 2px;
265263
`;
266264

267265
const MotionWrapper = styled(motion.div)`

static/app/components/layouts/thirds.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,14 @@ export const Page = styled('main')<{withPadding?: boolean}>`
2222
*
2323
* Use `noActionWrap` to disable wrapping if there are minimal actions.
2424
*/
25-
export const Header = styled('header')<{
26-
borderStyle?: 'dashed' | 'solid';
27-
noActionWrap?: boolean;
28-
}>`
25+
export const Header = styled('header')<{noActionWrap?: boolean}>`
2926
display: grid;
3027
grid-template-columns: ${p =>
3128
!p.noActionWrap ? 'minmax(0, 1fr)' : 'minmax(0, 1fr) auto'};
3229
3330
padding: ${space(2)} ${space(2)} 0 ${space(2)};
3431
background-color: transparent;
35-
border-bottom: 1px ${p => p.borderStyle ?? 'solid'} ${p => p.theme.border};
32+
border-bottom: 1px solid ${p => p.theme.border};
3633
3734
@media (min-width: ${p => p.theme.breakpoints.medium}) {
3835
padding: ${space(2)} ${space(4)} 0 ${space(4)};

static/app/components/tabs/tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export interface BaseTabProps {
5353
tabProps: DOMAttributes<FocusableElement>;
5454
/**
5555
* This controls the border style of the tab. Only active when
56-
* `variant='filled'` since other variants do not have a border
56+
* `variant=filled` since other variants do not have a border
5757
*/
5858
borderStyle?: 'solid' | 'dashed';
5959
to?: string;

static/app/utils/withSavedSearches.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,17 @@ function withSavedSearches<P extends InjectedSavedSearchesProps>(
2424
props: Omit<P, keyof InjectedSavedSearchesProps> & Partial<InjectedSavedSearchesProps>
2525
) {
2626
const organization = useOrganization();
27-
const {data: savedSearches, isLoading} = useFetchSavedSearchesForOrg(
28-
{
29-
orgSlug: organization.slug,
30-
},
31-
{enabled: !organization.features.includes('issue-stream-custom-views')}
32-
);
33-
27+
const {data: savedSearches, isLoading} = useFetchSavedSearchesForOrg({
28+
orgSlug: organization.slug,
29+
});
3430
const params = useParams();
3531
const selectedSavedSearch = useSelectedSavedSearch();
3632

3733
return (
3834
<WrappedComponent
3935
{...(props as P)}
4036
savedSearches={props.savedSearches ?? savedSearches}
41-
savedSearchLoading={
42-
!organization.features.includes('issue-stream-custom-views') &&
43-
(props.savedSearchLoading ?? isLoading)
44-
}
37+
savedSearchLoading={props.savedSearchLoading ?? isLoading}
4538
savedSearch={props.savedSearch ?? selectedSavedSearch}
4639
selectedSearchId={params.searchId ?? null}
4740
/>

0 commit comments

Comments
 (0)