Skip to content

Change metadata tag language setting style #7636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const MetadataFaceRecognitionDialog = ({ value: oldValue, repoID, toggleDialog:
{!showTurnOffConfirmDialog && (
<>
<ModalBody className="metadata-face-recognition-dialog">
{!enableMetadata && <p className="tip">{gettext('Please enable the extended properties setting first')}</p>}
{!enableMetadata && <p className="tip">{gettext('Please turn on extended properties setting first')}</p>}
<Switch
checked={value}
disabled={submitting || !enableMetadata}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const MetadataOCRStatusManagementDialog = ({ value: oldValue, repoID, toggleDial
{!showTurnOffConfirmDialog && (
<>
<ModalBody className="metadata-status-management-dialog">
{!enableMetadata && <p className="tip">{gettext('Please enable the extended properties setting first')}</p>}
{!enableMetadata && <p className="tip">{gettext('Please turn on extended properties setting first')}</p>}
<Switch
checked={value}
disabled={submitting || !enableMetadata}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useCallback } from 'react';
import PropTypes from 'prop-types';
import { ModalBody, ModalFooter, Button } from 'reactstrap';
import { ModalBody, ModalFooter, Button, FormGroup, Label } from 'reactstrap';
import classnames from 'classnames';
import Switch from '../../../../components/switch';
import { gettext } from '../../../../utils/constants';
Expand All @@ -10,8 +10,6 @@ import { Utils } from '../../../../utils/utils';
import TurnOffConfirmDialog from '../turn-off-confirm-dialog';
import { SeahubSelect } from '../../../../components/common/select';

import './index.css';

const langOptions = [
{
value: 'zh-cn',
Expand Down Expand Up @@ -81,7 +79,7 @@ const MetadataTagsStatusDialog = ({ value: oldValue, lang: oldLang, repoID, togg
{!showTurnOffConfirmDialog && (
<>
<ModalBody className="metadata-face-recognition-dialog">
{!enableMetadata && <p className="tip">{gettext('Please enable the extended properties setting first')}</p>}
{!enableMetadata && <p className="tip">{gettext('Please turn on extended properties setting first')}</p>}
<Switch
checked={value}
disabled={submitting || !enableMetadata}
Expand All @@ -91,21 +89,21 @@ const MetadataTagsStatusDialog = ({ value: oldValue, lang: oldLang, repoID, togg
onChange={onValueChange}
placeholder={gettext('Tags')}
/>
<p className="tip m-0">
<p className="tip">
{gettext('Enable tags to add tags to files and search files by tags.')}
</p>
{value && (
<div className="tags-language-container">
<span>{gettext('Tags language:')}</span>
{value &&
<FormGroup className="mt-6">
<Label>{gettext('Language for tags generated by AI')}</Label>
<SeahubSelect
className='tags-language-selector'
className='tags-language-selector w-75'
value={langOptions.find(o => o.value === lang) || langOptions[1]}
options={langOptions}
onChange={onSelectChange}
isClearable={false}
/>
</div>
)}
</FormGroup>
}
</ModalBody>
<ModalFooter>
<Button color="secondary" onClick={onToggle}>{gettext('Cancel')}</Button>
Expand Down