Skip to content

Commit

Permalink
saving screens
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihaly-Arvai committed Nov 23, 2023
1 parent 7af173d commit 8c18b8c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions content-script/datasource-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const datasourceViewer = () => {
mutations.forEach((mutation) => {
mutation.addedNodes.forEach((addedNode) => {
if (addedNode instanceof HTMLElement && addedNode.closest('app-datasource-picker')) {
console.log('DOM changed from extension within app-datasource-picker');
console.debug('DOM changed from extension within app-datasource-picker');

const elementsWithDataItemId = addedNode.querySelectorAll('[data-itemid]') as NodeListOf<HTMLElement>;

Expand All @@ -79,7 +79,7 @@ const datasourceViewer = () => {
const explorerUrl = constructExplorerUrl(queryParams);
const contentEditorUrl = constructContentEditorUrl(queryParams);
const linkSpan = createLinkSpan(explorerUrl, contentEditorUrl);

element.appendChild(linkSpan);
}
});
Expand Down
32 changes: 18 additions & 14 deletions popup/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ declare const chrome: any;

import {
Box,
Flex,
FormControl,
FormLabel,
SimpleGrid,
Spacer,
Stack,
Switch,
Text,
Expand All @@ -17,7 +19,7 @@ const Settings = () => {
const [datasourceEnabled, setDatasourceEnabled] = useState(true);

useEffect(() => {
// Load extension settings on component mount
// Load extension settings
chrome.storage.sync.get('datasourceEnabled', (result: { datasourceEnabled?: boolean }) => {
setDatasourceEnabled(result.datasourceEnabled ?? true);
});
Expand All @@ -43,26 +45,28 @@ const Settings = () => {
</Text>
</Box>

{/* Datasource Viewer Setting */}
{/* Feature list */}
<Box>
<FormControl as={SimpleGrid} columns={{ base: 2, lg: 4 }}>
<FormLabel htmlFor='datasourceSwitch'>
<FormControl as={SimpleGrid}>
<Flex>
<Tooltip
label="Displays direct Explorer/Content Editor link for data source items in the 'Assign Content Item' dialog">
Enable Datasource Viewer:
<FormLabel htmlFor='datasourceSwitch'>
Enable Datasource Viewer:
</FormLabel>
</Tooltip>
</FormLabel>
<Switch
id='datasourceSwitch'
isChecked={datasourceEnabled}
onChange={handleSwitchChange}
/>
<Spacer />
<Switch
id='datasourceSwitch'
isChecked={datasourceEnabled}
onChange={handleSwitchChange}
/>

</Flex>
</FormControl>
{/* Additional feature switches can be added here */}
</Box>

{/* Additional settings or components can be added here */}
<Wrap>
{/* Additional settings or components can be added here */}
</Wrap>
</Stack>
);
Expand Down
Binary file modified screenshots/screen4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8c18b8c

Please sign in to comment.