Skip to content

Commit

Permalink
feat(Viewer): Disable qualification modification on public
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Jan 13, 2025
1 parent f086a70 commit decf24b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/cozy-viewer/src/Panel/Qualification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const ComponentFromMetadataQualificationType = {
bills: QualificationListItemInformation
}

const Qualification = ({ file, isReadOnly }) => {
const Qualification = ({ file, isPublic, isReadOnly }) => {
const { metadata = {} } = file
const actionBtnRef = useRef([])
const [showQualifModal, setShowQualifModal] = useState(false)
Expand Down Expand Up @@ -75,13 +75,13 @@ const Qualification = ({ file, isReadOnly }) => {
{hasSupportedQualification(file) ? (
<QualificationListItemQualification
file={file}
isReadOnly={isReadOnly}
isReadOnly={isPublic ? true : isReadOnly}
onClick={() => setShowQualifModal(true)}
/>
) : (
<QualificationListItemQualificationEmpty
file={file}
isReadOnly={isReadOnly}
isReadOnly={isPublic ? true : isReadOnly}
onClick={() => setShowQualifModal(true)}
/>
)}
Expand Down Expand Up @@ -109,7 +109,7 @@ const Qualification = ({ file, isReadOnly }) => {
<Fragment key={idx}>
<QualificationListItemComp
file={file}
isReadOnly={isReadOnly}
isReadOnly={isPublic ? true : isReadOnly}
ref={actionBtnRef.current[idx]}
formattedMetadataQualification={meta}
toggleActionsMenu={val => toggleActionsMenu(idx, name, val)}
Expand All @@ -124,7 +124,7 @@ const Qualification = ({ file, isReadOnly }) => {
file={file}
optionFile={optionFile}
ref={actionBtnRef.current[optionFile.id]}
isReadOnly={isReadOnly}
isReadOnly={isPublic ? true : isReadOnly}
/>
)}
</List>
Expand Down

0 comments on commit decf24b

Please sign in to comment.