• Kostas Papadimitriou's avatar
    Services api/presentation logic cleanup · 30713232
    Kostas Papadimitriou authored
    - Remove presentation information from Service model (order, icon)
    - To access the list of services filled with both presentation and api
      data use Service.catalog(). The method fills a dict with service
      identifiers and service metadata through the following steps
        - Initialize a service dict using
          astakos.im.presentation.service_defaults
        - Extend (merge and overwrite) it with the correspoding entry in
          astakos.im.presentation.SERVICES if exists.
        - Merge once again if user has set service metadata in
          ASTAKOS_SERVICE_META setting. This way user can change only the
          desired service parameters.
    
    - An example of ASTAKOS_SERVICE_META containing keys which
    
        ASTAKOS_SERVICE_META = {
            'myservice': {
                'name': 'service_identifier',
                'url': 'https://service.url/service/ui/',
                'verbose_name': 'My service name',
                'order': 1,
    
                # cloudbar specific parameters
                'cloudbar': {
                    'show': True,
                    'title': 'My service name in cloudbar'
                    # defaults to verbose_name
                },
    
                # dashboard specific parameters
                'dashboard': {
                    'show': True,
                    # we use different ordering in dashboard
                    'order': 100,
                    'description': 'My service description'
                }
            }
        }
    
    - Updated dashboard to use Service.catalog() instead of hardcoded
      html.
    - Updated service-* commands to keep up with model changes
    30713232
settings.py 10.5 KB