Skip to content

Commit

Permalink
click tips to enable extended properties (#6900)
Browse files Browse the repository at this point in the history
Co-authored-by: zhouwenxuan <[email protected]>
  • Loading branch information
Aries-0331 and zhouwenxuan authored Oct 15, 2024
1 parent d89adb2 commit d122730
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion frontend/src/components/dir-view-mode/dir-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => {
updateEnableMetadata(value);
}, [updateEnableMetadata]);

const onExtendedProperties = useCallback(() => {
setShowMetadataStatusManagementDialog(true);
}, []);

if (!enableMetadataManagement) return null;

return (
Expand All @@ -46,7 +50,7 @@ const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => {
moreOperationClick={moreOperationClick}
>
{!enableMetadata ? (
<ExtensionPrompts />
<ExtensionPrompts onExtendedProperties={onExtendedProperties} />
) : Array.isArray(navigation) && navigation.length > 0 ? (
<MetadataTreeView userPerm={userPerm} currentPath={currentPath} />
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
.extension-prompts-container:hover {
color: #703719;
background-color: #fffbed;
cursor: pointer;
}

.extension-prompts-container:hover .extension-prompts-icon {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import React from 'react';
import React, { useCallback } from 'react';
import Icon from '../../icon';
import { gettext } from '../../../utils/constants';

import './index.css';

const ExtensionPrompts = () => {
const ExtensionPrompts = ({ onExtendedProperties }) => {
const handlePromptsClick = useCallback(() => {
onExtendedProperties();
}, [onExtendedProperties]);

return (
<div
className='extension-prompts-container'
aria-label={gettext('Extension Prompts')}
onClick={handlePromptsClick}
>
<div className='extension-prompts-icon-wrapper'>
<Icon
Expand Down

0 comments on commit d122730

Please sign in to comment.