feat(kubernetes): add note teaser and styled application note on details EE-5364 (#9016)

pull/5002/merge
Prabhat Khera 2023-06-09 08:35:29 +12:00 committed by GitHub
parent 58c1a60fee
commit 3233987a21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 24 additions and 10 deletions

View File

@ -86,8 +86,6 @@ github.com/docker/cli v20.10.12+incompatible h1:lZlz0uzG+GH+c0plStMUdF/qk3ppmgns
github.com/docker/cli v20.10.12+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v23.0.2+incompatible h1:q81C2qQ/EhPm8COZMUGOQYh4qLv4Xu6CXELJ3WK/mlU=
github.com/docker/docker v23.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho=
github.com/docker/docker v23.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=

View File

@ -48,11 +48,23 @@
feature-id="enforceDeploymentOptions"
disabled="true"
checked="false"
field-class="'col-sm-10'"
field-class="'col-sm-12'"
label-class="'col-sm-2'"
tooltip="'Hides the \'Add with form\' buttons and prevents adding/editing of resources via forms'"
></por-switch-field>
</div>
<div class="form-group">
<por-switch-field
label="'Require a note on applications'"
name="'toggle_requireNoteOnApplications'"
feature-id="requireNoteOnApplications"
disabled="true"
checked="false"
field-class="'col-sm-12'"
label-class="'col-sm-2'"
tooltip="'BE allows entry of notes in Add/Edit application. Using this setting will enforce entry of a note in Add/Edit application (and prevent complete clearing of it in Application details).'"
></por-switch-field>
</div>
<!-- !deployment options -->
<!-- actions -->
<div class="form-group">

View File

@ -15,6 +15,7 @@ angular.module('portainer.app').controller('SettingsController', [
$scope.enforceDeploymentOptions = FeatureId.ENFORCE_DEPLOYMENT_OPTIONS;
$scope.updateSettings = updateSettings;
$scope.handleSuccess = handleSuccess;
$scope.requireNoteOnApplications = FeatureId.K8S_REQUIRE_NOTE_ON_APPLICATIONS;
$scope.backupOptions = options;

View File

@ -7,6 +7,7 @@
.btn-none:focus {
outline: none;
color: inherit;
}
.btn-warninglight {

View File

@ -1,4 +1,4 @@
import { User, Clock, Edit, ChevronDown, ChevronUp } from 'lucide-react';
import { User, Clock, Edit, ChevronRight, ChevronUp } from 'lucide-react';
import moment from 'moment';
import { useEffect, useState } from 'react';
import { Pod } from 'kubernetes-types/core/v1';
@ -197,16 +197,16 @@ export function ApplicationSummaryWidget() {
<form className="form-horizontal">
<div className="form-group">
<div className="col-sm-12 vertical-center">
<Edit /> Note
<Button
size="xsmall"
size="small"
type="button"
color="light"
color="none"
data-cy="k8sAppDetail-expandNoteButton"
onClick={() => setIsNoteOpen(!isNoteOpen)}
className="!m-0 !p-0"
>
{isNoteOpen ? 'Collapse' : 'Expand'}
{isNoteOpen ? <ChevronUp /> : <ChevronDown />}
{isNoteOpen ? <ChevronUp /> : <ChevronRight />} <Edit />{' '}
Note
</Button>
</div>
</div>
@ -267,7 +267,7 @@ export function ApplicationSummaryWidget() {
{
op: 'replace',
path: `/metadata/annotations/${appNoteAnnotation}`,
value: 'applicationNoteFormValues',
value: applicationNoteFormValues,
},
];
if (application?.kind) {

View File

@ -41,4 +41,5 @@ export enum FeatureId {
K8SINSTALL = 'k8s-install',
K8S_ANNOTATIONS = 'k8s-annotations',
CA_FILE = 'ca-file',
K8S_REQUIRE_NOTE_ON_APPLICATIONS = 'k8s-note-on-applications',
}

View File

@ -46,6 +46,7 @@ export async function init(edition: Edition) {
[FeatureId.K8S_ROLLING_RESTART]: Edition.BE,
[FeatureId.K8S_ANNOTATIONS]: Edition.BE,
[FeatureId.CA_FILE]: Edition.BE,
[FeatureId.K8S_REQUIRE_NOTE_ON_APPLICATIONS]: Edition.BE,
};
state.currentEdition = currentEdition;