Fix/UI misc (#1606)

* stop expansion when description icon clicked

* add test for ensuring string sanitization

* rename log out to terminate in sessions component and remove sanitization bypass as unneeded

* remove unecessary instances of safe string
This commit is contained in:
Lucy C
2022-07-01 18:25:45 -06:00
committed by GitHub
parent 8ba932aa36
commit 6d805ae941
15 changed files with 41 additions and 50 deletions

View File

@@ -4,7 +4,6 @@ import { ApiService } from 'src/app/services/api/embassy-api.service'
import {
AlertController,
IonContent,
IonicSafeString,
LoadingController,
ModalController,
NavController,

View File

@@ -4,11 +4,7 @@ import {
Inject,
Input,
} from '@angular/core'
import {
AlertController,
IonicSafeString,
LoadingController,
} from '@ionic/angular'
import { AlertController, LoadingController } from '@ionic/angular'
import {
AbstractMarketplaceService,
MarketplacePkg,
@@ -153,14 +149,14 @@ export class MarketplaceShowControlsComponent {
}
private async presentAlertBreakages(breakages: Breakages): Promise<boolean> {
let message: string | IonicSafeString =
let message: string =
'As a result of this update, the following services will no longer work properly and may crash:<ul>'
const localPkgs = this.patch.getData()['package-data']
const bullets = Object.keys(breakages).map(id => {
const title = localPkgs[id].manifest.title
return `<li><b>${title}</b></li>`
})
message = new IonicSafeString(`${message}${bullets}</ul>`)
message = `${message}${bullets}</ul>`
return new Promise(async resolve => {
const alert = await this.alertCtrl.create({

View File

@@ -3,7 +3,6 @@ import {
AlertController,
LoadingController,
NavController,
IonicSafeString,
ModalController,
} from '@ionic/angular'
import { ApiService } from 'src/app/services/api/embassy-api.service'
@@ -121,9 +120,7 @@ export class ServerShowPage {
const minutes = Object.keys(this.patch.getData()['package-data']).length * 2
const alert = await this.alertCtrl.create({
header: 'Warning',
message: new IonicSafeString(
`This action will tear down all service containers and rebuild them from scratch. No data will be deleted. This action is useful if your system gets into a bad state, and it should only be performed if you are experiencing general performance or reliability issues. It may take up to ${minutes} minutes to complete. During this time, you will lose all connectivity to your Embassy.`,
),
message: `This action will tear down all service containers and rebuild them from scratch. No data will be deleted. This action is useful if your system gets into a bad state, and it should only be performed if you are experiencing general performance or reliability issues. It may take up to ${minutes} minutes to complete. During this time, you will lose all connectivity to your Embassy.`,
buttons: [
{
text: 'Cancel',
@@ -145,9 +142,7 @@ export class ServerShowPage {
async presentAlertRepairDisk() {
const alert = await this.alertCtrl.create({
header: 'Warning',
message: new IonicSafeString(
`<p>This action will attempt to preform a disk repair operation and system reboot. No data will be deleted. This action should only be executed if directed by a Start9 support specialist. We recommend backing up your device before preforming this action.</p><p>If anything happens to the device during the reboot (between the bep and chime), such as loosing power, a power surge, unplugging the drive, or unplugging the Embassy, the filesystem <i>will</i> be in an unrecoverable state. Please proceed with caution.</p>`,
),
message: `<p>This action will attempt to preform a disk repair operation and system reboot. No data will be deleted. This action should only be executed if directed by a Start9 support specialist. We recommend backing up your device before preforming this action.</p><p>If anything happens to the device during the reboot (between the bep and chime), such as loosing power, a power surge, unplugging the drive, or unplugging the Embassy, the filesystem <i>will</i> be in an unrecoverable state. Please proceed with caution.</p>`,
buttons: [
{
text: 'Cancel',

View File

@@ -67,7 +67,7 @@
strong
(click)="presentAlertKillAll()"
>
Log out all
Terminate all
</ion-button>
</ion-item-divider>
<div *ngFor="let session of otherSessions">

View File

@@ -1,9 +1,5 @@
import { Component } from '@angular/core'
import {
AlertController,
IonicSafeString,
LoadingController,
} from '@ionic/angular'
import { AlertController, LoadingController } from '@ionic/angular'
import { ErrorToastService } from '@start9labs/shared'
import { ApiService } from 'src/app/services/api/embassy-api.service'
import { PlatformType, Session } from 'src/app/services/api/api.types'
@@ -53,16 +49,14 @@ export class SessionsPage {
async presentAlertKillAll() {
const alert = await this.alertCtrl.create({
header: 'Confirm',
message: new IonicSafeString(
`Log out <b>all</b> other web sessions?<br /><br />Note: you will <b>not</b> be logged out of your current session on this device.`,
),
message: `Terminate <b>all</b> other web sessions?<br /><br />Note: you will <b>not</b> be logged out of your current session on this device.`,
buttons: [
{
text: 'Cancel',
role: 'cancel',
},
{
text: 'Log out all',
text: 'Terminate all',
handler: () => {
this.kill(this.otherSessions.map(s => s.id))
},
@@ -76,14 +70,14 @@ export class SessionsPage {
async presentAlertKill(id: string) {
const alert = await this.alertCtrl.create({
header: 'Confirm',
message: 'Log out other web session?',
message: 'Terminate other web session?',
buttons: [
{
text: 'Cancel',
role: 'cancel',
},
{
text: 'Log Out',
text: 'Terminate',
handler: () => {
this.kill([id])
},
@@ -96,7 +90,7 @@ export class SessionsPage {
async kill(ids: string[]): Promise<void> {
const loader = await this.loadingCtrl.create({
message: `Logging out session${ids.length > 1 ? 's' : ''}...`,
message: `Terminating session${ids.length > 1 ? 's' : ''}...`,
})
await loader.present()