Skip to content

Commit

Permalink
fixup featuredTags
Browse files Browse the repository at this point in the history
  • Loading branch information
zbycz committed Oct 28, 2023
1 parent 7794435 commit 2f201bb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
48 changes: 26 additions & 22 deletions src/components/FeaturePanel/FeaturePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const FeaturePanel = () => {

const { point, tags, osmMeta, skeleton, deleted } = feature;
const editEnabled = !skeleton;
const showTagsTable = deleted || showTags || !feature.schema;
const showTagsTable = deleted || showTags || (!skeleton && !feature.schema);

const osmappLink = getFullOsmappLink(feature);

Expand All @@ -48,34 +48,38 @@ export const FeaturePanel = () => {
editEnabled={editEnabled && !point}
/>

<OsmError />
{!skeleton && (
<>
<OsmError />

<Properties
showTags={showTagsTable}
key={getUrlOsmId(osmMeta) + (deleted && 'del')}
/>
<Properties
showTags={showTagsTable}
key={getUrlOsmId(osmMeta) + (deleted && 'del')}
/>

{advanced && <Members />}
{advanced && <Members />}

<PublicTransport tags={tags} />
<PublicTransport tags={tags} />

{editEnabled && (
<>
<EditButton isAddPlace={point} isUndelete={deleted} />
{editEnabled && (
<>
<EditButton isAddPlace={point} isUndelete={deleted} />

<EditDialog
feature={feature}
isAddPlace={point}
isUndelete={deleted}
key={
getUrlOsmId(osmMeta) + (deleted && 'del') // we need to refresh inner state
}
/>
<EditDialog
feature={feature}
isAddPlace={point}
isUndelete={deleted}
key={
getUrlOsmId(osmMeta) + (deleted && 'del') // we need to refresh inner state
}
/>
</>
)}

{point && <ObjectsAround advanced={advanced} />}
</>
)}

{point && <ObjectsAround advanced={advanced} />}

<PanelFooter>
<FeatureDescription setAdvanced={setAdvanced} />
<Coordinates />
Expand All @@ -87,7 +91,7 @@ export const FeaturePanel = () => {
type="checkbox"
onChange={toggleShowTags}
checked={showTagsTable}
disabled={point || deleted || !feature.schema}
disabled={point || deleted || (!skeleton && !feature.schema)}
/>{' '}
{t('featurepanel.show_tags')}
</label>{' '}
Expand Down
2 changes: 1 addition & 1 deletion src/services/tagging/idTaggingScheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export const getSchemaForFeature = (feature: Feature) => {
keysTodo.resolveTags(preset.tags); // remove tags which are already covered by Preset keys
keysTodo.remove('name'); // always rendered by FeaturePanel

const featuredTags = getFeaturedTags(feature);
const featuredTags = feature.deleted ? [] : getFeaturedTags(feature);
keysTodo.resolveTags(featuredTags);

const matchedFields = matchFieldsFromPreset(preset, keysTodo, feature);
Expand Down

0 comments on commit 2f201bb

Please sign in to comment.