Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: installation config in super admin console #1641

Merged
merged 7 commits into from Jan 15, 2021

Conversation

sony-mathew
Copy link
Contributor

@sony-mathew sony-mathew commented Jan 12, 2021

Description

  • Added the ability for super admins to view, edit and update installation config values. Also, they can add new installation config values. The impact of editing and adding depends on which all installation config values are being used in the code.
  • Known limitation now: Ability to edit hash values (for eg: feature flags) are disabled. This requires more work and will be taken up in a secondary set of changes.
  • Minor UX improvement. Clicking on the Sidekiq option in the super admin sidebar will now open the Sidekiq dashboard in a new tab rather than in the same tab that you were using super admin.
  • Added the scoping ability for installation configs to be selectively shown in the super admin console as some of them need not be exposed to the super admin and will be part of the Ops.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tested in a local development environment.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@pr-triage pr-triage bot added the PR: unreviewed This pull request is yet to be reviewed. label Jan 12, 2021
@pranavrajs
Copy link
Member

Screenshot 2021-01-12 at 6 57 49 PM

Copy link
Member

@pranavrajs pranavrajs left a comment

Choose a reason for hiding this comment

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

Please pull the existing database and see something breaks, I couldn't view the page because of the screenshot attached.

@pr-triage pr-triage bot added PR: reviewed-changes-requested Some / all of the reviewers have requested for changes and removed PR: unreviewed This pull request is yet to be reviewed. labels Jan 12, 2021
@pr-triage pr-triage bot added PR: unreviewed This pull request is yet to be reviewed. and removed PR: reviewed-changes-requested Some / all of the reviewers have requested for changes labels Jan 12, 2021
@sony-mathew
Copy link
Contributor Author

Please pull the existing database and see something breaks, I couldn't view the page because of the screenshot attached.

It's fixed now @pranavrajs . Thanks for reviewing.

@sojan-official
Copy link
Member

We should have a filter for the installation configs that are exposed in the UI. So we can hide the configs that shouldn't be tampered with.

@sony-mathew
Copy link
Contributor Author

@sojan-official I agree with that. Can we take that up in the next set of changes? Or do you think it is better to do it in this PR itself?

@sony-mathew
Copy link
Contributor Author

@pranavrajs @sojan-official I have incorporated the above-mentioned changes. Let me know if any changes need to be done on top of this.

@pranavrajs
Copy link
Member

@sony-mathew I cannot create a new installation config. https://www.loom.com/share/a8ebc9f990d14dc6a0eda720aa3daa80

@sony-mathew
Copy link
Contributor Author

@pranavrajs Fixed the issue.

* Added the ability for super admins to view, edit and update
installation config values. Also they can add new isntallation config
values. The impact of editing and adding depends on which all
installation config values are being used in the code.
* Known limitation now: Ability to edit hash values (for eg: feature
flags) are disabled. This requires more work and will be taken up in
a secondary set of changes.
* Minor UX improvement. Clicking on the Sidekiq option in the super
admin siebar will now open the sidekiq dashboard in a new tab rather
than in the same tab that you were using super admin.
* Added the locked attribute to instalaltion config table. Added
necessary migrations. Added changes in config loader.
* Added the changes on the installation config yml
* Locked the account feature defaults in code
* Added a new scope in installation config model
* Added scope in adminstrate controller for installation_config
* Fixed the error in new installation config create
* Added specs for installation config super admin controller
@sony-mathew sony-mathew force-pushed the feature/super-admin-installation-config branch from 9733566 to f637a05 Compare January 14, 2021 18:48
@pr-triage pr-triage bot added PR: partially-approved Not all reviewers have approved the PR and removed PR: unreviewed This pull request is yet to be reviewed. labels Jan 15, 2021
@pranavrajs pranavrajs merged commit 18d3c40 into develop Jan 15, 2021
@pranavrajs pranavrajs deleted the feature/super-admin-installation-config branch January 15, 2021 07:51
@pr-triage pr-triage bot added PR: merged The pull request is merged to another branch and removed PR: partially-approved Not all reviewers have approved the PR labels Jan 15, 2021
@orlando
Copy link

orlando commented Jan 26, 2021

I think this broke the bootstrap using docker. I get this error when running migrations.

undefined local variable or method `locked' for #<InstallationConfig:0x00007fdaf1615368>
Did you mean?  lock!
/gems/ruby/2.7.0/gems/activemodel-6.0.3.4/lib/active_model/attribute_methods.rb:432:in `method_missing'
/app/app/models/installation_config.rb:39:in `set_lock'
/gems/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `block in make_lambda'
/gems/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
/gems/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:605:in `block (2 levels) in default_terminator'
/gems/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:604:in `catch'
/gems/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:604:in `block in default_terminator'
/gems/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:201:in `block in halting'
/gems/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/gems/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `each'
/gems/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `invoke_before'
/gems/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:134:in `run_callbacks'
/gems/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:825:in `_run_validation_callbacks'
/gems/ruby/2.7.0/gems/activemodel-6.0.3.4/lib/active_model/validations/callbacks.rb:117:in `run_validations!'
/gems/ruby/2.7.0/gems/activemodel-6.0.3.4/lib/active_model/validations.rb:337:in `valid?'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:68:in `valid?'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:84:in `perform_validations'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:47:in `save'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:314:in `block in save'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in `transaction'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:212:in `transaction'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:314:in `save'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/suppressor.rb:44:in `save'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/persistence.rb:38:in `create'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/relation.rb:100:in `block in create'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/relation.rb:407:in `block in scoping'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/relation.rb:784:in `_scoping'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/relation.rb:407:in `scoping'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/relation.rb:100:in `create'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/relation.rb:169:in `find_or_create_by'
/gems/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/querying.rb:21:in `find_or_create_by'
/app/lib/config_loader.rb:62:in `save_as_new_config'

smshuja pushed a commit to smshuja/chatwoot that referenced this pull request Feb 2, 2021
* feat: installation config in super admin console

* Added the ability for super admins to view, edit and update
installation config values. Also they can add new isntallation config
values. The impact of editing and adding depends on which all
installation config values are being used in the code.
* Known limitation now: Ability to edit hash values (for eg: feature
flags) are disabled. This requires more work and will be taken up in
a secondary set of changes.
* Minor UX improvement. Clicking on the Sidekiq option in the super
admin siebar will now open the sidekiq dashboard in a new tab rather
than in the same tab that you were using super admin.

* fix: method name fix in custom adminsitrate field

* feat: added locked attribute to global config
* Added the locked attribute to instalaltion config table. Added
necessary migrations. Added changes in config loader.
* Added the changes on the installation config yml
* Locked the account feature defaults in code

* feat: show only editable configs in admin console
* Added a new scope in installation config model
* Added scope in adminstrate controller for installation_config

* fix: new installation config create error
* Fixed the error in new installation config create

* fix: specs coverage
* Added specs for installation config super admin controller

* chore: update git ignore with encrypted config ext
sladyn98 pushed a commit to BotCart/chatwoot that referenced this pull request Mar 1, 2021
* feat: installation config in super admin console

* Added the ability for super admins to view, edit and update
installation config values. Also they can add new isntallation config
values. The impact of editing and adding depends on which all
installation config values are being used in the code.
* Known limitation now: Ability to edit hash values (for eg: feature
flags) are disabled. This requires more work and will be taken up in
a secondary set of changes.
* Minor UX improvement. Clicking on the Sidekiq option in the super
admin siebar will now open the sidekiq dashboard in a new tab rather
than in the same tab that you were using super admin.

* fix: method name fix in custom adminsitrate field

* feat: added locked attribute to global config
* Added the locked attribute to instalaltion config table. Added
necessary migrations. Added changes in config loader.
* Added the changes on the installation config yml
* Locked the account feature defaults in code

* feat: show only editable configs in admin console
* Added a new scope in installation config model
* Added scope in adminstrate controller for installation_config

* fix: new installation config create error
* Fixed the error in new installation config create

* fix: specs coverage
* Added specs for installation config super admin controller

* chore: update git ignore with encrypted config ext
@github-actions
Copy link

github-actions bot commented Aug 9, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR: merged The pull request is merged to another branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants