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:
@@ -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>
|
||||
}
|
||||
|
||||
|
||||
@@ -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, {
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -55,6 +55,10 @@ export class ConnectHecDialogComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
isUpdateAvailable(): boolean {
|
||||
return !!this.connectInfo.configuration;
|
||||
}
|
||||
|
||||
getSettingsAsJson(configuration: string) {
|
||||
try {
|
||||
return JSON.parse(configuration);
|
||||
|
||||
@@ -9523,6 +9523,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"updateIntegrationButtonDesc": {
|
||||
"message": "Update $INTEGRATION$",
|
||||
"placeholders": {
|
||||
"integration": {
|
||||
"content": "$1",
|
||||
"example": "Crowdstrike"
|
||||
}
|
||||
}
|
||||
},
|
||||
"integrationCardTooltip": {
|
||||
"message": "Launch $INTEGRATION$ implementation guide.",
|
||||
"placeholders": {
|
||||
|
||||
Reference in New Issue
Block a user