fix: url labels on client, not backend
parent
4d7ef092fb
commit
116e850b66
|
@ -448,22 +448,7 @@ pub async fn put_object(
|
||||||
(None, None)
|
(None, None)
|
||||||
}
|
}
|
||||||
PutInput::Address { entity: in_address } => {
|
PutInput::Address { entity: in_address } => {
|
||||||
let address = in_address.try_into().map_err(ErrorBadRequest)?;
|
let address: Address = in_address.try_into().map_err(ErrorBadRequest)?;
|
||||||
|
|
||||||
let label_entry = match &address {
|
|
||||||
Address::Hash(_) | Address::Uuid(_) => None,
|
|
||||||
Address::Attribute(_) => None,
|
|
||||||
Address::Url(url) => Some(Entry {
|
|
||||||
entity: address.clone(),
|
|
||||||
attribute: LABEL_ATTR.to_string(),
|
|
||||||
value: url.clone().into(),
|
|
||||||
provenance: match &query.provenance {
|
|
||||||
Some(s) => format!("API {}", s),
|
|
||||||
None => "API".to_string(),
|
|
||||||
},
|
|
||||||
timestamp: chrono::Utc::now().naive_utc(),
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
|
|
||||||
let _address = address.clone();
|
let _address = address.clone();
|
||||||
let _job_container = state.job_container.clone();
|
let _job_container = state.job_container.clone();
|
||||||
|
@ -497,10 +482,6 @@ pub async fn put_object(
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(label_entry) = label_entry {
|
|
||||||
connection.insert_entry(label_entry)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok((None, Some(address)))
|
Ok((None, Some(address)))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -36,9 +36,9 @@
|
||||||
|
|
||||||
let displayLabel = address;
|
let displayLabel = address;
|
||||||
$: {
|
$: {
|
||||||
displayLabel = Array.from(new Set(inferredIds.concat(labels || []))).join(
|
const allLabels = [].concat(inferredIds).concat(labels || []);
|
||||||
" | "
|
displayLabel = Array.from(new Set(allLabels)).join(" | ");
|
||||||
);
|
|
||||||
if (!displayLabel && $entityInfo?.t === "Attribute") {
|
if (!displayLabel && $entityInfo?.t === "Attribute") {
|
||||||
displayLabel = `${$i18n.t("Attribute")}: ${$entityInfo.c}`;
|
displayLabel = `${$i18n.t("Attribute")}: ${$entityInfo.c}`;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,12 @@
|
||||||
<Ellipsis value={displayLabel} />
|
<Ellipsis value={displayLabel} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if banner}
|
{#if banner}
|
||||||
<div class="type">{$entityInfo?.t}</div>
|
<div class="type">
|
||||||
|
{$entityInfo?.t}
|
||||||
|
{#if $entityInfo?.t === "Url"}
|
||||||
|
— {$entityInfo.c}
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if $vaultInfo?.desktop}
|
{#if $vaultInfo?.desktop}
|
||||||
|
|
Loading…
Reference in New Issue