Skip to content

Conversation

@FriedhelmWS
Copy link
Contributor

@FriedhelmWS FriedhelmWS commented Nov 6, 2025

Description

  1. Fixed admin settings precedence order in scope assignment logic
  2. Moved AI features registration before permission wrapper setup
  3. Updated permission control logic to handle string/array scopes
  4. Replaced synchronous BehaviorSubject access with reactive combineLatest approach
  5. Removed unsafe double type casting in saved objects wrapper

Issues Resolved

NA

Screenshot

NA

Testing the changes

Changelog

  • skip

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

❌ Empty Changelog Section

The Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section.

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.76%. Comparing base (a2d096f) to head (53eb240).

Files with missing lines Patch % Lines
...ttings/public/management_app/advanced_settings.tsx 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10869      +/-   ##
==========================================
- Coverage   60.76%   60.76%   -0.01%     
==========================================
  Files        4533     4533              
  Lines      122127   122128       +1     
  Branches    20459    20460       +1     
==========================================
  Hits        74207    74207              
- Misses      42687    42688       +1     
  Partials     5233     5233              
Flag Coverage Δ
Linux_1 26.57% <0.00%> (ø)
Linux_2 38.92% <100.00%> (ø)
Linux_3 39.41% <0.00%> (-0.01%) ⬇️
Linux_4 33.75% <33.33%> (ø)
Windows_1 26.58% <0.00%> (ø)
Windows_2 38.90% <100.00%> (ø)
Windows_3 39.42% <0.00%> (-0.01%) ⬇️
Windows_4 33.75% <33.33%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry and removed failed changeset labels Nov 6, 2025
isOverridden: config.isOverridden(setting[0]),
isPermissionControlled:
all[setting[0]].scope === UiSettingScope.DASHBOARD_ADMIN && !isDashboardAdmin,
((typeof all[setting[0]].scope === 'string' &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to add a comment to describe the logic, it's hard to read

getAvailableLanguages$(http, data).pipe(
map((languages) => languages.length > 0 && assistantEnabled$.value)
combineLatest([getAvailableLanguages$(http, data), assistantEnabled$]).pipe(
map(([languages, enabled]) => languages.length > 0 && enabled)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: just for readability

Suggested change
map(([languages, enabled]) => languages.length > 0 && enabled)
map(([languages, assistantEnabled]) => languages.length > 0 && assistantEnabled)

// Use uiSettings.defaults from the config file
this.validateAndUpdateConfiguredDefaults(config.uiSettingsConfig.defaults);

this.register(getAIFeaturesSetting());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, does the order matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just a minor improvement as for settings we should define what exists before we define how to control access to it

groupedChanges[UiSettingScope.USER][key] = val;
} else if (this.adminUiSettingsKeys.includes(key)) {
groupedChanges[UiSettingScope.DASHBOARD_ADMIN][key] = val;
} else if (this.userLevelSettingsKeys.includes(key)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the order matter? If yes, would be nice to add a comment or unit test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to maintain the existing logic hierarchy that the admin-level configurations should has higher privilege level as initiatively admin setting > user settings > workspace settings > global settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

all-star-contributor Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants