Workspace Constant CE Bug Fixes (#10811)

* init

* changes
This commit is contained in:
Rudhra Deep Biswas 2024-09-23 17:26:52 +05:30 committed by GitHub
parent cc9ef7ca7e
commit e70bd9d324
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 7 deletions

View file

@ -191,6 +191,8 @@
.tab.active {
border-radius: 0px;
color: #3e63dd;
padding-bottom: 8px;
border-bottom: 2px solid #3e63dd;
.workspace-constant-text {
padding-bottom: 8px;
@ -219,6 +221,9 @@
font-size: 12px;
color: var(--text-medium, #CFD3D8);
}
.tab-count.active {
color: #3e63dd;
}
}
}
.tab-count {

View file

@ -7,14 +7,12 @@ import React from 'react';
export const OrgConstantVariablesPreviewBox = ({ workspaceVariables, workspaceConstants, value, isFocused }) => {
const getResolveValueType = (currentValue) => {
if (!currentValue) return null;
if (currentValue.includes('constants')) {
return 'Workspace global constant';
}
if (currentValue.includes('secrets')) {
return 'Workspace secret constant';
}
if (currentValue.includes('constants')) {
return 'Workspace global constant';
}
if (currentValue.includes('client')) {
return 'client workspace variable';
@ -60,6 +58,7 @@ const ResolvedValue = ({ value, isFocused, state = {}, type }) => {
[preview, error] = [value, `Undefined constants: ${invalidConstants}`];
} else {
[preview, error] = resolveReferences(value, state, null, {}, true, true);
if (isSecret && !error) {
preview = hiddenSecretText;
}
@ -119,9 +118,13 @@ const ResolvedValue = ({ value, isFocused, state = {}, type }) => {
ref={heightRef}
className={`dynamic-variable-preview px-1 py-1 ${isValidError ? 'bg-red-lt' : 'bg-green-lt'}`}
>
<div className="alert-banner-type-text">
<div className="alert-banner-type-text" data-cy="variable-preview">
<div className="d-flex my-1">
<div className="flex-grow-1" style={{ fontWeight: 800, textTransform: 'capitalize' }}>
<div
className="flex-grow-1"
style={{ fontWeight: 800, textTransform: 'capitalize' }}
data-cy="alert-banner-type-text"
>
{isValidError ? 'Error' : isConstant ? null : ` ${type} - ${previewType}`}
</div>
</div>