Full generation, file type cleanup
This commit is contained in:
@ -67,17 +67,22 @@ struct PageContentResultsView: View {
|
||||
@ObservedObject
|
||||
var results: PageGenerationResults
|
||||
|
||||
#warning("Rework to only show a single popup will all files, and indicate missing ones")
|
||||
private var totalFileCount: Int {
|
||||
results.usedFiles.count + results.missingFiles.count + results.missingLinkedFiles.count
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
TextWithPopup(
|
||||
symbol: .photoOnRectangleAngled,
|
||||
text: "\(results.files.count + results.missingFiles.count) images and files",
|
||||
items: results.files.sorted().map { $0.id })
|
||||
text: "\(totalFileCount) images and files",
|
||||
items: results.usedFiles.sorted().map { $0.id })
|
||||
.foregroundStyle(.secondary)
|
||||
|
||||
TextWithPopup(
|
||||
symbol: .docBadgePlus,
|
||||
text: "\(results.linkedPages.count + results.missingPages.count) page links",
|
||||
text: "\(results.linkedPages.count + results.missingLinkedPages.count) page links",
|
||||
items: results.linkedPages.sorted().map { $0.localized(in: language).title })
|
||||
.foregroundStyle(.secondary)
|
||||
|
||||
@ -87,18 +92,18 @@ struct PageContentResultsView: View {
|
||||
items: results.externalLinks.sorted())
|
||||
.foregroundStyle(.secondary)
|
||||
|
||||
if !results.missingPages.isEmpty {
|
||||
if !results.missingLinkedPages.isEmpty {
|
||||
TextWithPopup(
|
||||
symbol: .exclamationmarkTriangleFill,
|
||||
text: "\(results.missingPages.count) missing pages",
|
||||
items: results.missingPages.sorted())
|
||||
text: "\(results.missingLinkedPages.count) missing pages",
|
||||
items: results.missingLinkedPages.keys.sorted())
|
||||
.foregroundStyle(.red)
|
||||
}
|
||||
if !results.missingFiles.isEmpty {
|
||||
TextWithPopup(
|
||||
symbol: .exclamationmarkTriangleFill,
|
||||
text: "\(results.missingFiles.count) missing files",
|
||||
items: results.missingFiles.sorted())
|
||||
items: results.missingFiles.keys.sorted())
|
||||
.foregroundStyle(.red)
|
||||
}
|
||||
if !results.invalidCommands.isEmpty {
|
||||
@ -111,7 +116,3 @@ struct PageContentResultsView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
PageContentResultsView(results: .init())
|
||||
}
|
||||
|
Reference in New Issue
Block a user