1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-05 19:23:19 +00:00

PM-23824 update the text from save->update when update is available

This commit is contained in:
voommen-livefront
2025-08-07 09:47:33 -05:00
parent abaee7d9f2
commit d4467d691f
5 changed files with 27 additions and 2 deletions

View File

@@ -34,7 +34,11 @@
@if (canSetupConnection) {
<button type="button" class="tw-mt-3" bitButton (click)="setupConnection()">
<span>{{ "connectIntegrationButtonDesc" | i18n: name }}</span>
@if (IsUpdateAvailable()) {
<span>{{ "updateIntegrationButtonDesc" | i18n: name }}</span>
} @else {
<span>{{ "connectIntegrationButtonDesc" | i18n: name }}</span>
}
</button>
}

View File

@@ -125,6 +125,10 @@ export class IntegrationCardComponent implements AfterViewInit, OnDestroy {
return this.isConnected !== undefined;
}
IsUpdateAvailable(): boolean {
return !!this.integrationSettings.configuration;
}
async setupConnection() {
// invoke the dialog to connect the integration
const dialog = openHecConnectDialog(this.dialogService, {

View File

@@ -28,7 +28,11 @@
</div>
<ng-container bitDialogFooter>
<button type="submit" bitButton bitFormButton buttonType="primary" [disabled]="loading">
{{ "save" | i18n }}
@if (isUpdateAvailable()) {
{{ "update" | i18n }}
} @else {
{{ "save" | i18n }}
}
</button>
<button type="button" bitButton bitDialogClose buttonType="secondary" [disabled]="loading">
{{ "cancel" | i18n }}

View File

@@ -55,6 +55,10 @@ export class ConnectHecDialogComponent implements OnInit {
});
}
isUpdateAvailable(): boolean {
return !!this.connectInfo.configuration;
}
getSettingsAsJson(configuration: string) {
try {
return JSON.parse(configuration);

View File

@@ -9523,6 +9523,15 @@
}
}
},
"updateIntegrationButtonDesc": {
"message": "Update $INTEGRATION$",
"placeholders": {
"integration": {
"content": "$1",
"example": "Crowdstrike"
}
}
},
"integrationCardTooltip": {
"message": "Launch $INTEGRATION$ implementation guide.",
"placeholders": {