Skip to content

Commit

Permalink
fix(signatures): pasting wormholes again no longer resets EOL and mas…
Browse files Browse the repository at this point in the history
…s status
  • Loading branch information
updraft0 committed Jun 13, 2024
1 parent 8ce8799 commit 4cc8be2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ui/src/main/css/views/nav-top-view.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,8 @@ div#nav-top-view {
& span.eve-server-status.ti-satellite {
color: $green-dark;
}

& span.eve-server-status.ti-satellite-off {
color: $red;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ enum SignatureUpdate:
def toScanned: Option[NewSystemSignature] = this match
case Added(a) => Some(a)
case Removed(_) => None
case Unchanged(_, u) => u
case Updated(_, u) => Some(u)
case Unchanged(p, _) => Some(p.asNew)
case Updated(p, u) => Some(p.asNewFromUpdate(u))

class PasteSignaturesView(
existingSigs: Array[MapSystemSignature],
Expand Down Expand Up @@ -361,3 +361,26 @@ private[view] def wormholeTypeCell(

private inline def massSizeNotUnknown(ms: WormholeMassSize) =
if (ms == WormholeMassSize.Unknown) "?" else ms.toString

// NOTE: this is necessary to not have the wormhole attributes overridden while pasting signatures - might need
// reworking if paste signature view allows editing
extension (v: MapSystemSignature)
def asNew: NewSystemSignature =
v match
case u: MapSystemSignature.Unknown => NewSystemSignature.Unknown(u.id, u.createdAt)
case s: MapSystemSignature.Site => NewSystemSignature.Site(s.id, s.createdAt, s.signatureGroup, s.name)
case w: MapSystemSignature.Wormhole =>
NewSystemSignature.Wormhole(
w.id,
w.createdAt,
w.eolAt.isDefined,
w.connectionType,
w.massStatus,
w.massSize,
w.connectionId
)
def asNewFromUpdate(u: NewSystemSignature): NewSystemSignature =
(v, u) match
case (w: MapSystemSignature.Wormhole, nw: NewSystemSignature.Wormhole) =>
nw.copy(createdAt = w.createdAt, isEol = w.eolAt.isDefined, massStatus = w.massStatus, massSize = w.massSize)
case (_, _) => u

0 comments on commit 4cc8be2

Please sign in to comment.