Skip to content

Commit 1dddc59

Browse files
kamalqureshiraheeliftikhar5
authored andcommitted
Updated Global CSS
1 parent caacd01 commit 1dddc59

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

client/packages/lowcoder/src/comps/comps/preLoadComp/actionConfigs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
shareAppAction,
1515
testAllDatasourcesAction,
1616
applyGlobalJSAction,
17-
applyGlobalCSSAction,
17+
applyCSSAction,
1818
applyThemeAction,
1919
setCanvasSettingsAction,
2020
setCustomShortcutsAction,
@@ -43,7 +43,7 @@ export const actionCategories: ActionCategory[] = [
4343
shareAppAction,
4444
testAllDatasourcesAction,
4545
applyGlobalJSAction,
46-
applyGlobalCSSAction,
46+
applyCSSAction,
4747
applyThemeAction,
4848
setCanvasSettingsAction,
4949
setCustomShortcutsAction

client/packages/lowcoder/src/comps/comps/preLoadComp/actionInputSection.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,6 @@ export function ActionInputSection() {
289289
if (currentAction.requiresComponentSelection && !selectedComponent) return true;
290290
if (currentAction.requiresEditorComponentSelection && !selectedEditorComponent) return true;
291291
if (currentAction.requiresInput && !actionValue.trim()) return true;
292-
if (currentAction.requiresStyle && !selectedEditorComponent) return true;
293-
if (currentAction.isTheme && !selectedTheme) return true;
294-
if (currentAction.isCustomShortcuts && !selectedCustomShortcutAction) return true;
295292

296293
return false;
297294
}, [

client/packages/lowcoder/src/comps/comps/preLoadComp/actions/appConfiguration.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export const applyGlobalJSAction: ActionConfig = {
277277
scriptComp.dispatchChangeValueAction(jsCode);
278278
runScript(jsCode, false);
279279

280-
message.success('Global JavaScript applied successfully!');
280+
message.success('JavaScript applied successfully!');
281281

282282
} catch (error) {
283283
console.error('Error applying global JavaScript:', error);
@@ -286,13 +286,13 @@ export const applyGlobalJSAction: ActionConfig = {
286286
}
287287
};
288288

289-
export const applyGlobalCSSAction: ActionConfig = {
290-
key: 'apply-global-css',
291-
label: 'Apply global CSS',
289+
export const applyCSSAction: ActionConfig = {
290+
key: 'apply-css',
291+
label: 'Apply CSS',
292292
category: 'app-configuration',
293293
requiresInput: true,
294294
requiresStyle: true,
295-
inputPlaceholder: 'Enter CSS code to apply globally...',
295+
inputPlaceholder: 'Enter CSS code to apply...',
296296
inputType: 'textarea',
297297
validation: (value: string) => {
298298
if (!value.trim()) {
@@ -322,21 +322,21 @@ export const applyGlobalCSSAction: ActionConfig = {
322322
return;
323323
}
324324

325-
const globalCSSComp = preloadComp.children.globalCSS;
326-
if (!globalCSSComp) {
327-
message.error('Global CSS component not found');
325+
const cssComp = preloadComp.children.css;
326+
if (!cssComp) {
327+
message.error('CSS component not found');
328328
return;
329329
}
330330

331-
globalCSSComp.dispatchChangeValueAction(cssCode);
331+
cssComp.dispatchChangeValueAction(cssCode);
332332

333-
await globalCSSComp.run('global-css', cssCode);
333+
await cssComp.run('css', cssCode);
334334

335-
message.success('Global CSS applied successfully!');
335+
message.success('CSS applied successfully!');
336336

337337
} catch (error) {
338-
console.error('Error applying global CSS:', error);
339-
message.error('Failed to apply global CSS. Check console for details.');
338+
console.error('Error applying CSS:', error);
339+
message.error('Failed to apply CSS. Check console for details.');
340340
}
341341
}
342342
};

0 commit comments

Comments
 (0)