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

Add category to organisation #1147

Closed
Tracked by #1533
mahalakshme opened this issue Feb 29, 2024 · 13 comments
Closed
Tracked by #1533

Add category to organisation #1147

mahalakshme opened this issue Feb 29, 2024 · 13 comments
Assignees

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Feb 29, 2024

Need:

  • To be able to mark an org as prod
    ---- so that we dont delete by mistake a prod org,
    ---- so that we know for what orgs ETL should run,
    ---- to know what orgs need to be monitored.
  • If an org is created as prototype during sales stage, ability to mark that

Acceptance criteria:

  • When creating an org as super admin, I should be able to set the category for the org. The allowed categories are prod, UAT, prototype, temporary. Display it immediately below 'Username suffix' field. Similar dropdown as Account. The label name for the field is 'Category'.
  • Show the field in Create mode, when clicked on Show and when clicked on Edit.
  • The field is mandatory, hence when not set, show the error message as 'Please select a category' like below:
Screenshot 2024-04-01 at 10 30 10 AM
  • Also display the field to the right of 'Username suffix' here.
Screenshot 2024-04-01 at 10 52 32 AM
  • If the org is marked as prod, and when user clicks on Admin -> Organisation Details -> 'Delete all data' show the message 'Cannot delete since this organisation is marked as prod' in a red toast message below something like the below one.
Screenshot 2024-04-01 at 9 37 01 AM
  • Do not make it part of bundle export
  • Add migration to mark all existing orgs as 'prod' category

Technical:

Since more such fields will come up, store category in a JSON field, so that it is extendable for later. This is based on what was discussed during Monday discussion. Feel free to change it based on what is best.

Out of scope:

  • Moving prod org to UAT
@mahalakshme mahalakshme transferred this issue from avniproject/avni-product Feb 29, 2024
@mahalakshme mahalakshme moved this from In Analysis to In Analysis Review in Avni Product Feb 29, 2024
@mahalakshme
Copy link
Contributor Author

@vinayvenu / @arjunk review this

@mahalakshme mahalakshme changed the title Add label to an organisation Add super admin fields to an organisation Apr 1, 2024
@mahalakshme mahalakshme changed the title Add super admin fields to an organisation Add category to organisation Apr 1, 2024
@mahalakshme mahalakshme moved this from In Analysis Review to Ready in Avni Product Apr 1, 2024
@mahalakshme mahalakshme moved this from Ready to In Analysis in Avni Product Apr 3, 2024
@mahalakshme mahalakshme moved this from In Analysis to Ready in Avni Product Apr 3, 2024
@1t5j0y 1t5j0y moved this from Ready to In Progress in Avni Product Apr 4, 2024
@1t5j0y 1t5j0y self-assigned this Apr 4, 2024
@1t5j0y
Copy link
Contributor

1t5j0y commented Apr 5, 2024

The values do not seem to belong to a single dimension and 'category' is too generic. Defeats the purpose of having this as a JSON. Suggest we break them down to more specific dimensions so that it is more extensible in the future. i.e. have something like:

{
  "dataClassification": "prod", < prod | test >
  "usage": "prototype"  < demo | prototype | none > etc
}

or simplify this to having a set of well-defined tags of which one or many can be applied to an org.

@1t5j0y 1t5j0y removed their assignment Apr 5, 2024
@1t5j0y 1t5j0y moved this from In Progress to In Analysis in Avni Product Apr 5, 2024
@1t5j0y 1t5j0y moved this from In Analysis to Ready in Avni Product Apr 5, 2024
@mahalakshme
Copy link
Contributor Author

mahalakshme commented Apr 8, 2024

@vinayvenu I prefer in keeping them as one category or jusy may be with a different label. You can check the above comment and reply with your opinion.

@vinayvenu
Copy link
Member

@mahalakshme I agree with@1t5j0y here. Support looks for prod orgs that are active. Development needs uat orgs that are active, but may also need a backup. Website needs all orgs that have ever gone to prod but needs a separate category for those who have discontinued.

Bunching all of these into a single "category" feels wrong.

@mahalakshme
Copy link
Contributor Author

@vinayvenu @1t5j0y Once a card moves to Ready lane, it is upto the developer and what the team feels how they want to implement. I am responsible until moving a card to Ready lane. So feel free to decide.

@1t5j0y
Copy link
Contributor

1t5j0y commented Apr 8, 2024

Since this is (mostly) for internal usage and relies heavily on us maintaining this metadata correctly, I'm leaning towards the tags solution since it should serve the purpose and not require us to drill down into the possible dimensions.
Also, saves us effort on changes to webapp UI to manage this metadata if/when we introduce new dimensions or values for dimensions.
The tags solution does not cater to the other use case of uat-prod org linkage but that is probably best done via a more robust linking mechanism.

@mahalakshme
Copy link
Contributor Author

mahalakshme commented Apr 8, 2024

@1t5j0y I remember we discussed about tags solution only initially, since that is what I had analysed first. And based on the inputs from product team and sales team, I moved it to this solution which is the current AC. We also discussed the reasons for the same in the last call. I am not sure how to go about this now, the team can decide.

@petmongrels petmongrels moved this from Ready to In Progress in Avni Product Apr 8, 2024
@petmongrels petmongrels self-assigned this Apr 8, 2024
petmongrels added a commit to avniproject/avni-server that referenced this issue Apr 10, 2024
@petmongrels petmongrels moved this from In Progress to Code Review Ready in Avni Product Apr 10, 2024
@vinayvenu vinayvenu moved this from Code Review Ready to In Code Review in Avni Product Apr 12, 2024
@vinayvenu
Copy link
Member

vinayvenu commented Apr 12, 2024

Additional commits
9f7bda2

@vinayvenu vinayvenu moved this from In Code Review to QA Ready in Avni Product Apr 12, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Apr 23, 2024
@AchalaBelokar
Copy link

  • currently all origination is showing the category production.

@petmongrels
Copy link
Contributor

yes that is expected. implementation and support teams will be mark them UAT etc incrementally.

@AchalaBelokar AchalaBelokar moved this from In QA to Done in Avni Product Apr 23, 2024
@AchalaBelokar
Copy link

  • 1st I mark org as prod and then mark it as temporary and delete all the data I found this error.
    java.lang.NullPointerException at org.avni.server.web.OrganisationConfigSearchController.getOrganisationSearchConfig(OrganisationConfigSearchController.java:35) at sun.reflect.GeneratedMethodAccessor845.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:870) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:776) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:870) at javax.servlet.http.HttpServlet.service(HttpServlet.java:529) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855) at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.avni.server.framework.sync.MutableRequestFilter.doFilter(MutableRequestFilter.java:35) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.avni.server.framework.security.LimitHostNamesFilter.doFilterInternal(LimitHostNamesFilter.java:34) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.springframework.web.filter.ForwardedHeaderFilter.doFilterInternal(ForwardedHeaderFilter.java:152) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.avni.server.framework.security.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:73) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) at org.keycloak.adapters.tomcat.AbstractAuthenticatedActionsValve.invoke(AbstractAuthenticatedActionsValve.java:67) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) at org.keycloak.adapters.tomcat.AbstractKeycloakAuthenticatorValve.invoke(AbstractKeycloakAuthenticatorValve.java:181) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:670) at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:765) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1790) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:750)

@AchalaBelokar AchalaBelokar moved this from Done to Code Review with Comments in Avni Product May 1, 2024
@AchalaBelokar AchalaBelokar moved this from Code Review with Comments to QA Failed in Avni Product May 1, 2024
@vinayvenu vinayvenu reopened this May 1, 2024
@github-project-automation github-project-automation bot moved this from QA Failed to Triaged in Avni Product May 1, 2024
@AchalaBelokar AchalaBelokar moved this from Triaged to QA Failed in Avni Product May 1, 2024
@petmongrels petmongrels moved this from QA Failed to In Progress in Avni Product May 1, 2024
@petmongrels petmongrels moved this from In Progress to Code Review Ready in Avni Product May 2, 2024
@petmongrels petmongrels moved this from Code Review Ready to QA Ready in Avni Product May 2, 2024
@vinayvenu vinayvenu moved this from QA Ready to In QA in Avni Product May 3, 2024
@vinayvenu
Copy link
Member

Notes

  • Validations on server side = PrivilegeType.DownloadBundle. However, on the UI, we check that the user is not admin.
  • The validation for category is only implemented on the client, not the server

Issues

  • Missing Acceptance criteria - Category should be visible on the Organisation listing

Suggestion

  • It would be good if category is also visible on the header on the /home screen as well.

@vinayvenu vinayvenu moved this from In QA to QA Failed in Avni Product May 3, 2024
@petmongrels petmongrels moved this from QA Failed to In Progress in Avni Product May 3, 2024
petmongrels added a commit to avniproject/avni-server that referenced this issue May 3, 2024
@petmongrels petmongrels moved this from In Progress to QA Ready in Avni Product May 3, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product May 13, 2024
@AchalaBelokar
Copy link

AchalaBelokar commented May 15, 2024

  • I can easily change the category production to Uat through the admin
  • Checked with home page it is showing category
  • we can not deleted org data
  • I change the prod category to uat and now I am able to delete the data.
  • I also checked the etl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

5 participants