Commit 9a14ed89 authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Remove export_formats feature flag

parent a04c4e1a
...@@ -130,7 +130,6 @@ function ExportAnnotations({ ...@@ -130,7 +130,6 @@ function ExportAnnotations({
[allAnnotationsOption, selectedUserId, userList], [allAnnotationsOption, selectedUserId, userList],
); );
const exportFormatsEnabled = store.isFeatureEnabled('export_formats');
const [exportFormat, setExportFormat] = useState(exportFormats[0]); const [exportFormat, setExportFormat] = useState(exportFormats[0]);
const fileInputId = useId(); const fileInputId = useId();
...@@ -325,14 +324,11 @@ function ExportAnnotations({ ...@@ -325,14 +324,11 @@ function ExportAnnotations({
required required
maxLength={250} maxLength={250}
/> />
{exportFormatsEnabled && (
<div className="grow-0 ml-2 min-w-[5rem]"> <div className="grow-0 ml-2 min-w-[5rem]">
<SelectNext <SelectNext
value={exportFormat} value={exportFormat}
onChange={setExportFormat} onChange={setExportFormat}
buttonContent={ buttonContent={exportFormat.shortTitle ?? exportFormat.title}
exportFormat.shortTitle ?? exportFormat.title
}
data-testid="export-format-select" data-testid="export-format-select"
right right
> >
...@@ -353,7 +349,6 @@ function ExportAnnotations({ ...@@ -353,7 +349,6 @@ function ExportAnnotations({
))} ))}
</SelectNext> </SelectNext>
</div> </div>
)}
</div> </div>
</div> </div>
</> </>
...@@ -370,7 +365,6 @@ function ExportAnnotations({ ...@@ -370,7 +365,6 @@ function ExportAnnotations({
</p> </p>
)} )}
<CardActions> <CardActions>
{exportFormatsEnabled && (
<Button <Button
data-testid="copy-button" data-testid="copy-button"
icon={CopyIcon} icon={CopyIcon}
...@@ -379,7 +373,6 @@ function ExportAnnotations({ ...@@ -379,7 +373,6 @@ function ExportAnnotations({
> >
Copy to clipboard Copy to clipboard
</Button> </Button>
)}
<Button <Button
data-testid="export-button" data-testid="export-button"
variant="primary" variant="primary"
......
...@@ -232,20 +232,14 @@ describe('ExportAnnotations', () => { ...@@ -232,20 +232,14 @@ describe('ExportAnnotations', () => {
assert.equal(input.prop('defaultValue'), 'suggested-filename'); assert.equal(input.prop('defaultValue'), 'suggested-filename');
}); });
[ it('displays format selector', async () => {
{ exportFormatsEnabled: true, expectedAmountOfSelects: 2 },
{ exportFormatsEnabled: false, expectedAmountOfSelects: 1 },
].forEach(({ exportFormatsEnabled, expectedAmountOfSelects }) => {
it('displays format selector when feature is enabled', async () => {
fakeStore.isFeatureEnabled.callsFake(
ff => exportFormatsEnabled || ff !== 'export_formats',
);
const wrapper = createComponent(); const wrapper = createComponent();
const selects = await waitForElement(wrapper, SelectNext); const select = await waitForElement(
wrapper,
'[data-testid="export-format-select"]',
);
assert.equal(selects.length, expectedAmountOfSelects); assert.isDefined(select);
});
}); });
it('lists supported export formats', async () => { it('lists supported export formats', async () => {
...@@ -464,18 +458,9 @@ describe('ExportAnnotations', () => { ...@@ -464,18 +458,9 @@ describe('ExportAnnotations', () => {
}); });
context('when copying annotations export to clipboard', () => { context('when copying annotations export to clipboard', () => {
[true, false].forEach(exportFormatsEnabled => { it('displays copy button', () => {
it('displays copy button if `export_formats` FF is enabled', () => {
fakeStore.isFeatureEnabled.callsFake(ff =>
ff === 'export_formats' ? exportFormatsEnabled : true,
);
const wrapper = createComponent(); const wrapper = createComponent();
assert.equal( assert.isTrue(wrapper.exists('[data-testid="copy-button"]'));
wrapper.exists('[data-testid="copy-button"]'),
exportFormatsEnabled,
);
});
}); });
[ [
...@@ -515,8 +500,6 @@ describe('ExportAnnotations', () => { ...@@ -515,8 +500,6 @@ describe('ExportAnnotations', () => {
getExpectedInvokedContentBuilder, getExpectedInvokedContentBuilder,
}) => { }) => {
it('copies export content as rich or plain text depending on format', async () => { it('copies export content as rich or plain text depending on format', async () => {
fakeStore.isFeatureEnabled.callsFake(ff => ff === 'export_formats');
const wrapper = createComponent(); const wrapper = createComponent();
const copyButton = wrapper.find('button[data-testid="copy-button"]'); const copyButton = wrapper.find('button[data-testid="copy-button"]');
...@@ -541,7 +524,6 @@ describe('ExportAnnotations', () => { ...@@ -541,7 +524,6 @@ describe('ExportAnnotations', () => {
); );
it('adds error toast message when copying annotations fails', async () => { it('adds error toast message when copying annotations fails', async () => {
fakeStore.isFeatureEnabled.callsFake(ff => ff === 'export_formats');
fakeCopyPlainText.rejects(new Error('Something failed')); fakeCopyPlainText.rejects(new Error('Something failed'));
const wrapper = createComponent(); const wrapper = createComponent();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment