mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-09-16 01:10:56 +00:00
Merge branch 'main' into maxgoedjen-patch-1
This commit is contained in:
commit
6d9b2f9744
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@ -11,7 +11,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
name: Analyze (${{ matrix.language }})
|
name: Analyze (${{ matrix.language }})
|
||||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
runs-on: ${{ (matrix.language == 'swift' && 'macos-26') || 'ubuntu-latest' }}
|
||||||
permissions:
|
permissions:
|
||||||
security-events: write
|
security-events: write
|
||||||
packages: read
|
packages: read
|
||||||
|
2
.github/workflows/nightly.yml
vendored
2
.github/workflows/nightly.yml
vendored
@ -7,7 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: macos-15
|
runs-on: macos-26
|
||||||
permissions:
|
permissions:
|
||||||
id-token: write
|
id-token: write
|
||||||
contents: write
|
contents: write
|
||||||
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -8,7 +8,7 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
runs-on: macos-15
|
runs-on: macos-26
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
@ -32,7 +32,7 @@ jobs:
|
|||||||
id-token: write
|
id-token: write
|
||||||
contents: write
|
contents: write
|
||||||
attestations: write
|
attestations: write
|
||||||
runs-on: macos-15
|
runs-on: macos-26
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -5,7 +5,7 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
runs-on: macos-15
|
runs-on: macos-26
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -5,16 +5,16 @@ struct EditSecretView<StoreType: SecretStoreModifiable>: View {
|
|||||||
|
|
||||||
let store: StoreType
|
let store: StoreType
|
||||||
let secret: StoreType.SecretType
|
let secret: StoreType.SecretType
|
||||||
let dismissalBlock: (_ renamed: Bool) -> ()
|
|
||||||
|
|
||||||
@State private var name: String
|
@State private var name: String
|
||||||
@State private var publicKeyAttribution: String
|
@State private var publicKeyAttribution: String
|
||||||
@State var errorText: String?
|
@State var errorText: String?
|
||||||
|
|
||||||
init(store: StoreType, secret: StoreType.SecretType, dismissalBlock: @escaping (Bool) -> ()) {
|
@Environment(\.dismiss) var dismiss
|
||||||
|
|
||||||
|
init(store: StoreType, secret: StoreType.SecretType) {
|
||||||
self.store = store
|
self.store = store
|
||||||
self.secret = secret
|
self.secret = secret
|
||||||
self.dismissalBlock = dismissalBlock
|
|
||||||
name = secret.name
|
name = secret.name
|
||||||
publicKeyAttribution = secret.publicKeyAttribution ?? ""
|
publicKeyAttribution = secret.publicKeyAttribution ?? ""
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ struct EditSecretView<StoreType: SecretStoreModifiable>: View {
|
|||||||
}
|
}
|
||||||
HStack {
|
HStack {
|
||||||
Button(.editCancelButton) {
|
Button(.editCancelButton) {
|
||||||
dismissalBlock(false)
|
dismiss()
|
||||||
}
|
}
|
||||||
.keyboardShortcut(.cancelAction)
|
.keyboardShortcut(.cancelAction)
|
||||||
Button(.editSaveButton, action: rename)
|
Button(.editSaveButton, action: rename)
|
||||||
@ -58,7 +58,7 @@ struct EditSecretView<StoreType: SecretStoreModifiable>: View {
|
|||||||
Task {
|
Task {
|
||||||
do {
|
do {
|
||||||
try await store.update(secret: secret, name: name, attributes: attributes)
|
try await store.update(secret: secret, name: name, attributes: attributes)
|
||||||
dismissalBlock(true)
|
dismiss()
|
||||||
} catch {
|
} catch {
|
||||||
errorText = error.localizedDescription
|
errorText = error.localizedDescription
|
||||||
}
|
}
|
||||||
|
@ -41,15 +41,12 @@ struct SecretListItemView: View {
|
|||||||
deletedSecret(secret)
|
deletedSecret(secret)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.sheet(isPresented: $isRenaming) {
|
.sheet(isPresented: $isRenaming, onDismiss: {
|
||||||
if let modifiable = store as? AnySecretStoreModifiable {
|
|
||||||
EditSecretView(store: modifiable, secret: secret) { renamed in
|
|
||||||
isRenaming = false
|
|
||||||
if renamed {
|
|
||||||
renamedSecret(secret)
|
renamedSecret(secret)
|
||||||
|
}, content: {
|
||||||
|
if let modifiable = store as? AnySecretStoreModifiable {
|
||||||
|
EditSecretView(store: modifiable, secret: secret)
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,9 @@ struct StoreListView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func secretRenamed(secret: AnySecret) {
|
private func secretRenamed(secret: AnySecret) {
|
||||||
// Toggle so name updates in list.
|
// Pull new version from store, so we get all updated attributes
|
||||||
activeSecret = nil
|
activeSecret = nil
|
||||||
activeSecret = secret
|
activeSecret = storeList.allSecrets.first(where: { $0.id == secret.id })
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@ -28,7 +28,7 @@ struct StoreListView: View {
|
|||||||
store: store,
|
store: store,
|
||||||
secret: secret,
|
secret: secret,
|
||||||
deletedSecret: secretDeleted,
|
deletedSecret: secretDeleted,
|
||||||
renamedSecret: secretRenamed
|
renamedSecret: secretRenamed,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user