Skip to content

Commit 528434a

Browse files
UI: updates to how we handle unknown mount type (hashicorp#9349) (hashicorp#9378)
* updates to how we handle unknown mount type * update test Co-authored-by: Dan Rivera <dan.rivera@hashicorp.com>
1 parent 1515ea7 commit 528434a

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

ui/app/components/secret-engine/list.hbs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,13 @@
8383
@hasChevron={{false}}
8484
data-test-popup-menu-trigger
8585
/>
86-
{{#if (not-eq (get (engines-display-data backend.type) "type") "generic")}}
87-
<dd.Interactive
88-
@route={{backend.backendConfigurationLink}}
89-
@model={{backend.id}}
90-
data-test-popup-menu="view-configuration"
91-
>
92-
View configuration
93-
</dd.Interactive>
94-
{{/if}}
86+
<dd.Interactive
87+
@route={{backend.backendConfigurationLink}}
88+
@model={{backend.id}}
89+
data-test-popup-menu="view-configuration"
90+
>
91+
View configuration
92+
</dd.Interactive>
9593
{{#if (not-eq backend.type "cubbyhole")}}
9694
<dd.Interactive
9795
@color="critical"

ui/app/components/secret-engine/list.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ export default class SecretEngineList extends Component<Args> {
8080
} else {
8181
return `${displayData.displayName}`;
8282
}
83-
} else if (displayData.type === 'generic') {
84-
// If a mounted engine type doesn't match any known type, the type is returned as 'generic' and set this tooltip.
83+
} else if (displayData.type === 'unknown') {
84+
// If a mounted engine type doesn't match any known type, the type is returned as 'unknown' and set this tooltip.
8585
// Handles issue when a user externally mounts an engine that doesn't follow the expected naming conventions for what's in the binary, despite being a valid engine.
86-
return 'This plugin is not supported by the UI. Please use the CLI to manage this engine.';
86+
return `This engine's type is not recognized by the UI. Please use the CLI to manage this engine.`;
8787
} else {
8888
// If the engine type is recognized but not supported, we only show configuration view and set this tooltip.
8989
return 'The UI only supports configuration views for these secret engines. The CLI must be used to manage other engine resources.';

ui/app/helpers/engines-display-data.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ import { ALL_ENGINES } from 'vault/utils/all-engines-metadata';
2424
export default function engineDisplayData(methodType: string) {
2525
const engine = ALL_ENGINES?.find((t) => t.type === methodType);
2626
if (!engine && methodType) {
27-
// Fallback to a generic engine if no match found but type is provided
27+
// Fallback to a unknown engine if no match found but type is provided
2828
return {
29-
displayName: 'Generic plugin',
30-
type: 'generic',
29+
displayName: 'Unknown plugin',
30+
type: 'unknown',
31+
isOldEngine: true,
3132
glyph: 'lock',
3233
mountCategory: ['secret', 'auth'],
3334
};

ui/tests/integration/components/list-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ module('Integration | Component | secret-engine/list', function (hooks) {
7373
assert
7474
.dom('.hds-tooltip-container')
7575
.hasText(
76-
'This plugin is not supported by the UI. Please use the CLI to manage this engine.',
77-
'shows tooltip text for unsupported engine'
76+
`This engine's type is not recognized by the UI. Please use the CLI to manage this engine.`,
77+
'shows tooltip text for unknown engine'
7878
);
7979
});
8080

0 commit comments

Comments
 (0)