Skip to content

Releases: spxbhuhb/zakadabar-stack

2021.8.17.1

17 Aug 08:29
Compare
Choose a tag to compare

Major Breaking Changes

In this release I've normalized package names. There is an upgrade script
in buildSrc that is able to apply most changes.

  • rename zakadabar.stack to zakadabar.core
  • move packages from zakadabar.core.backend to zakadabar.core
  • move packages from zakadabar.core.frontend to zakadabar.core.browser
  • shuffle files around have them in the right place
  • normalize accounts, i18, blobs package names

Things to fix manually:

  • change the JVM main class in build.gradle.kts to zakadabar.core.server.ServerKt
  • change browser form + select(bo::field) {...} to + bo::field query { ... }
  • rename business login plugin classes:
    • Auditor to BusinessLogicAuditor
    • Authorizer to BusinessLogicAuthorizer
    • Router to BusinessLogicRouter
    • Validator to BusinessLogicValidator

Core

added:

  • optional module dependencies
  • basic alarm support interface and fields to BusinessLogicCommon
  • LogAlarmSupport and LogAlarmSupport provider
  • `Router.prepareAction function (convert strings to action function and parameter)
  • zkLayoutStyles styles grid1, grid2, grid3
  • ZkTable.oneClick open details with one click
  • ZkTable now implements ZkFieldBackend

changed:

  • move RoutedModule from jvmMain to commonMain
  • fields and methods of tab container classes are now open
  • ZkFieldBase now has no type parameter
  • ZkFieldBase uses ZkFieldBackend instead the form itself
  • ZkFieldBase.readOnly is not an abstract field

... actually ... many other changes, but none reads these change logs anyway

Lib: Markdown

  • grow source code sections only when needed
  • move copy icon out of the source code section

Cookbook

added:

  • RecipeParser
  • automatically add platform before source code links in code sections
  • guide for cookbook and recipe for recipe

changed:

  • Recipe move from site into cookbook
  • move recipe.yaml content into recipie.md

2021.8.4

04 Aug 08:41
Compare
Choose a tag to compare

General

Clarification of visibility policy. From now on we use open and protected,
private is not recommended.

Core

added:

  • merge environment variables into settings
  • --ignore-environment server option to ignore environment variables
  • Lock class for multiplatform
  • BoSchemaEntry<T>.decodeFromText
  • BoSchemaEntry<T>.setFromText
  • EntityBoCompanion<T>.create(func: T.() -> Unit) convenience function
  • Logger.debug to log debug messages
  • Slf4jLogger wrapper around org.slf4j.Logger
  • ModuleStartupBucket
  • Logger.error(message, ex) function
  • Lock for common code
  • DefaultSettingProvider setting provider for common code

changed:

  • ExposedPaTable.table is now open
  • BoConstraint.type to constraintType because of serialization conflict
  • modules is now a ModuleStore and calls onModuleLoad when the module is added
  • StdOutLogger now adds severity label
  • move dependencies, moduleLogger, resolveDependencies, clearModules from global into ModuleStore
  • ModuleStore does not extend InstanceStore
  • ModuleStore is now thread safe
  • move SettingProvider from backend to stack
  • InstanceStore instances is now protected

Lib: Accounts

  • AccountBl.authorize throws Unauthorized when the account does not exist
  • AccountBl.authorize throws Unauthorized when the account state does not exist
  • security officer can create password credential record for other users even when there is no existing record

Lib: Blobs

added:

  • BlobBoCompanion<T,RT>.create(content : ByteArray, func: T.() -> Unit) convenience function

Lib: Email

New module for email sending.

Cookbook

  • module bundle recipe

Bender

changed:

  • replace translate with localized to avoid deprecation warning
  • remove data from BO package name
  • remove backend from BL, PA package names
  • replace package name frontend.pages with browser in generated browser code
  • table name pattern is now ${baseName}Table instead of ${baseName}ExposedTableGen
  • remove internal from table columns
  • table is now a class by default, table name is constructor parameter
  • pa name pattern is now ${baseName}Pa instead of ${baseName}ExposedPaGen
  • remove generated comments

fixed:

  • authorizer example in the documentation

2021.7.29

29 Jul 11:25
Compare
Choose a tag to compare

Breaking

  • ZkPage and all variations are now stateless by default
  • ZkArgPage: rename constructor parameter cssClass to css
  • ZkArgPage: args is now non-null, argsOrNull may be null
  • authorizer, auditor, router, validator implementations has to handle null query and action returns
  • ZkTable search is now case-insensitive
  • ZkPageStyles.fixed now has position: relative

Core

added:

  • basic support for LocalDate and LocalDateTime data types
  • actions and queries now can return with null result
  • BO wrappers for primitive types for actions and queries
  • auto-fetching select for entity references
  • specify a query for the table directly
  • EntityId.read function to read an entity directly from the id
  • newInstance function for common code and actual implementations
  • matcher property for ZkCustomColumn
  • convenience to add Ktor features to the server

changed:

  • ZkPage and all variations are now stateless by default
  • ZkArgPage constructor parameter cssClass to css
  • ZkArgPage args is now non-null, argsOrNull may be null
  • ZkPageStyles.fixed now has position: relative
  • ZkSelectBase hides arrow when in read-only mode
  • ZkSelect2Base hides arrow when in read-only mode
  • ZkTableStyles.tr uses pointer cursor
  • ZkTable search is now case-insensitive

fixed:

  • JDBC for Android: getObject now uses getLong without getInt
  • ZkCssStyleRule.gridGap used grid-column instead of grid-gap

Demos

changed:

  • added ;AUTO_SERVER=TRUE to H2 URLs

Lib: Accounts

added:

  • Login.onSuccess function to make customization easier

changes:

  • module.kt (JS) - instances can be passed to install to override defaults
  • Login.kt is now an open class

Site

  • cookbook is now a table

2021.7.20

20 Jul 10:06
Compare
Choose a tag to compare

Breaking Changes

  • Authorizer<EmptyEntityBo> has to be replaced with Authorizer<BaseBo>
  • object : EmptyAuthorizer<EmptyEntityBo>() has to be replaced with object : Authorizer<BaseBo>
  • SimpleRoleAuthorizer<EmptyEntityBo> has to be replaced with SimpleRoleAuthorizer<BaseBo>
  • object : KtorRouter<T>(this) { has to be replaces with object : KtorEntityRouter<T>(this)
  • classes that extend Router may have to add ? to RS
  • changed the breaking change policy

Project

  • move dependency versions into buildSrc:Versions.kt
  • split core into core-core and core-android
  • move doc out of core

Core

added:

  • BusinessLogicCommon class
  • schemaValidator global variable
  • ValidatorProvider interface
  • SchemaValidatorProvider class
  • ZkLite: JDBC driver for Android SQLite
  • basic support for LocalDate and LocalDateTime data types
  • localizedFormats global variable
  • convenience functions for Instant, LocalDate, LocalDateTime format and parse
  • LocalizedFormat interface
  • BuildinLocalizedFormats implementation of LocalizedFormat

changed:

  • move global routerProvider, auditorProvider, validatorProvider to common as expect
  • ActionBo type parameter upper bound is now Any instead of BaseBo
  • update authorizer, auditor, router, validator for ActionBo<T:Any>
  • provide truly entity-independent actions and queries
    • ActionBusinessLogic* now extends BusinessLogicCommon instead of EntityBusinessLogicCommon
    • QueryBusinessLogic* now extends BusinessLogicCommon instead of EntityBusinessLogicCommon
    • KtorRouter now does not handle entities, KtorEntityRouter does

Lib: Accounts

added:

  • Login.onSuccess function to make customization easier

changes:

  • module.kt (JS) - instances can be passed to install to override defaults
  • Login.kt is now an open class

Cookbook

New sub-project for code examples.

added:

  • Standalone Action BL For Logged-In Users
  • Standalone Action BL With Null Result
  • Standalone Query BL With Public Access
  • Standalone Query BL With Null Result
  • Access Server Description On the Frontend
  • Use Font Files
  • Database Transfer

Demos

changed:

  • added ;AUTO_SERVER=TRUE to H2 URLs

Site

  • doc is not bundled with the site but pulled from git
  • cookbook (very preliminary)

2021.7.9

10 Jul 04:34
Compare
Choose a tag to compare

Core

added:

  • SimpleRoleAuthorizer.LOGGED_IN - instance variable to avoid need for import
  • SimpleRoleAuthorizer.PUBLIC - instance variable to avoid need for import
  • SelectOptionProvider - interface to make form select definition easier

changed:

  • most business logic code moved from jvmMain to commonMain (should not break anything)
  • ValidityReport is now a BaseBo
  • BadRequest sends validity report
  • SchemaValidator throws BadRequest with validity report

fixed:

  • errors in upgrade documentation

Lib: Accounts

  • AccountList.asSelectProvider - convenience method to easily build selects for accounts

Lib: Markdown

  • code blocks and tables now use up to 90% of the screen

2021.7.5

05 Jul 09:14
Compare
Choose a tag to compare

2021.7.5

Breaking Changes

With this release we've introduced quite a few breaking changes. While the list of
changes is long, the upgrade is quite straightforward, don't worry about it.

core

  • Kotlin 1.5.20
  • Ktor 1.6.1
  • serialization 1.2.1
  • coroutines 1.5.0
  • Gradle 7.1
  • AccountPublicBo.displayName - remove
  • AccountPublicBo.id - rename to accountId
  • AccountPublicBo.organizationName - remove
  • AccountPublicBo.phone - new property
  • AccountPublicBo - is BaseBo instead of EntityBo
  • ActionBoCompanion - has no type parameter
  • BoSchema does not accept empty EntityId by default
  • DataConflictException - rename to DataConflict and move to zakadabar.stack.exceptions package
  • QueryBoCompanion - has no type parameter
  • QueryBo - type parameter can be anything (not a list by default)
  • RolesBase - change name to AppRolesBase and move into .authorize package
  • StackRoles.anonymous - remove
  • StackRoles.siteAdmin - remove
  • StackRoles.siteMember - replace with SimpleRoleAuthorizer.Companion.LOGGED_IN
  • StackRoles - change name to appRoles and move into .authorize package
  • ValidityReport now stores BOs instead of implementations
  • ZkCssStyleRule values now are plain strings (instead of any)
  • ZkElement.displayName - remove
  • zkFormStyles.buttons added marginBlockStart and marginBlockEnd
  • CommBase (JS) - 401 throws Unauthorized
  • Forbidden (JVM) - moved to common

lib: accounts

  • AccountPrivateBo - move fields to AccountStateBo and AccountCredentialsBo
  • AccountPrivateExposedTable is now a class instead of object, use AccountPrivateExposedTableCommon instead
  • AccountbyRole is now called AccountsByRole
  • KtorSessionBl now checks for ModuleSettings.loginActionRole instead of appRoles.siteMember
  • LoginAction now throws exception for all fails (even for locked)
  • RoleGrantExposedTable is now a class instead of an object, use RoleGrantExposedTableCommon instead
  • RolesByAccount contains AccountPublicBo instead of AccountPrivateBo

lib: blobs

  • BlobBo now has two type parameters
  • BlobBo.disposition new property
  • zkImageStyles rename to blobStyles
  • zkFormStyles.imageDropArea - move to blobStyles
  • zkFormStyles.imageDropAreaMessage - move to blobStyles
  • ZkImageField - constructor parameter changes

lib: i18n

  • Locale.status new property
  • Locales rename to LocaleCrud
  • Translations rename to TranslationCrud
  • TranslationBl now requires security officer for translation changes

Migration

Deployements

Check the upgrade page 2021.6-to-2021.7

Source Code

Use search & replace with regex on the whole project and replace:

QueryBoCompanion<[^>]+>

with

QueryBoCompanion

ActionBoCompanion<[a-zA-Z0-9]+>

with

ActionBoCompanion

import zakadabar\.stack\.StackRoles

with

import zakadabar.stack.authorize.appRoles

StackRoles

with

appRoles

import zakadabar\.stack\.RolesBase

with

import zakadabar.stack.authorize.AppRolesBase

StackRoles\.siteMember

with

LOGGED_IN
  • add import manually

Search for QueryBo<T> and replace it with QueryBo<List<T>> (manually).


Search for QueryBusinessLogicBase and add List to second parameter

class SimpleStandaloneQueryBl : QueryBusinessLogicBase<SimpleStandaloneQuery, List<SimpleQueryResult>>(


Search for ZkCssStyleSheet and fix errors:

  • add unit numbers, see Size Values
  • add .0 for double values (flexGrow)

Core

added:

  • CSS convenience classes, see Value Shorthands
  • CSS value postfixes: .px, .em, see Size Values
  • Make server description available without a session #32
  • BoSchema.custom - new function signature
  • BoSchema.validate - allowEmptyId parameter to allow empty EntityId
  • CustomBoConstraint - new constraint class
  • Forbidden - common exception (frontend and backend)
  • ListBoProperty - property class for lists
  • ListBoSchemaEntry - basic support for lists in schemas
  • ServerDescriptionBl - handles ServerDescriptionQuery, added automatically
  • ServerDescriptionQuery - reads ServerDescriptionBo from the server
  • Unauthorized - common exception (frontend and backend)
  • ValidityReport.allowEmptyId - when true, empty EntityId is allowed even for mandatory fields
  • ZkBuiltinStrings.loginMissingRole
  • ZkCrudTarget.onBeforeAddedCreate - last minute customization of the editor for create
  • ZkCrudTarget.onBeforeAddedDelete - last minute customization of the editor for delete
  • ZkCrudTarget.onBeforeAddedRead - last minute customization of the editor for read
  • ZkCrudTarget.onBeforeAddedUpdate - last minute customization of the editor for update
  • ZkForm.onCreateSuccess
  • ZkStringStore.childStores
  • application.stringStores
  • decodeURIComponent import from JavaScript
  • withConfirm - convenience for executing a code block after user confirmation
  • zkScrollBarStyles.hideScrollBar - style to hide the scrollbar completely
  • ZkQueryCrudTarget - crud target with a customized (not all fields) query for table
  • ZkTable.setData(query) - convenience to set data of a table from a query
  • KtorServerBuilder - handle Unauthorized
  • LinkedExposedPaBase - base persistence API for data linked to entities
  • LinkedExposedPaTable - base exposed table for data linked to entities

changed:

  • Kotlin 1.5.20
  • Ktor 1.6.1
  • serialization 1.2.1
  • coroutines 1.5.0
  • datetime 0.2.1
  • Gradle 7.1
  • Shadow 7.0.0
  • AccountPublicBo.displayName - remove
  • AccountPublicBo.id - rename to accountId
  • AccountPublicBo.organizationName - remove
  • AccountPublicBo.phone - new property
  • AccountPublicBo - is BaseBo instead of EntityBo
  • ActionBoCompanion has no type parameter
  • CommBase (JS) - 401 throws Unauthorized
  • DataConflictException - rename to DataConflict and move to zakadabar.stack.exceptions package
  • EmptySessionManager - reads server description with ServerDescriptionQuery
  • EntityBusinessLogicBase.pa is now public
  • QueryBoCompanion has no type parameter
  • QueryBo type parameter is not a list
  • Router.query change type parameter RQ from Any to QueryBo to ensure type safety
  • SimpleRoleAuthorizer supports LOGGED_IN special value
  • ValidityReport now stores BOs instead of implementations
  • ZkAppication - window.path.location is now decoded with decodeUriComponent before routing
  • ZkBuiltinStrings.confirmDelete - default text is "Are you sure you want to delete?"
  • ZkBuiltinStrings.confirmation - default text is "Please Confirm"
  • ZkElement.displayName - remove
  • ZkStringField - do not show mandatory mark when empty value is allowed
  • ZkStringStore.merge - also merge into child stores
  • ZkTextArea - do not show mandatory mark when empty value is allowed
  • ZkTextArea - remove hard-coded flexGrow = 1 and resize = "none"
  • zkFormStyles.buttons - added margin before and after
  • Forbidden - moved from JVM to common
  • Forbidden - is converted to Unauthorized when the principal is anonymous

deprecated:

  • BoSchema.custom old function with a function parameter
  • BuiltinStrings.cannotAttachMoreImage replaced by cannotAddMore

removed:

  • stdlib-jdk8 gradle dependency

fixed:

  • The server parameters (stack version and project name) are incorrect #51
  • The GitHub task number is misleading in release note 2021.6.16. #50
  • all form fields support readOnly
  • can chain form field decorator functions (readOnly, label, etc.)

Lib : Accounts

added:

  • AccountCredentialsBo (common)
  • AccountList (common)
  • AccountListSecure (common)
  • AccountStateBo (common)
  • CredentialTypes (common)
  • GetAccountState (common)
  • ModuleSettings.loginActionRole (common)
  • ModuleSettings.autoValidate (common)
  • ModuleSettings.enableAccountList (common)
  • ModuleSettings.phoneInAccountPublic (common)
  • AccountCredentialsExposedPa (JVM)
  • AccountCredentialsExposedTable (JVM)
  • AccountStateExposedPa (JVM)
  • AccountStateExposedTable (JVM)
  • AccountPrivateBlAuthorizer (JVM)
  • AccountPrivateBl.authorize (JVM) - audit for fail and success
  • many unit tests (JVM)
  • AccountSecure (JS) - account management CRUD for security officers
  • AccountTableSecure (JS) - list of accounts for security officers
  • ServerSettingsLoader - move settings loading out of Server

changed:

  • AccountPrivateBl - move authorization into AccountPrivateBlAuthorizer
  • CreateAccount - contains validated and locked
  • AccountPrivateBo - move fields to AccountStateBo and AccountCredentialsBo
  • CheckName is now a query
  • CheckNameResult contains AccountPublicBo instead of AccountPrivateBo
  • RolesByAccount contains AccountPublicBo instead of AccountPrivateBo
  • AccountPrivateExposedTable is now a class instead of object
  • KtorSessionBl now checks for ModuleSettings.loginActionRole instead of appRoles.siteMember
  • install now accepts accountPrivateBl as parameter
  • RoleBl constructor now requires a persistence api
  • RoleGrantExposedTable fields are now public
  • AccountPrivateTable fields are now public
  • LoginAction now throws exception for all fails (even for locked)
  • `...
Read more

2021.6.22

22 Jun 07:27
Compare
Choose a tag to compare

Core

added:

  • authorizer providers now support builder function to add queries and actions, see Authorizer
  • SimpleRoleAuthorizer now has a PUBLIC keyword to provide public access, see Authorizer
  • TestCompanionBase helper class for unit tests

changed:

  • Backend testing guide to use provided base classes
  • ZkInstantColumn now generates CSV data
  • ZkTable CSV export now uses ; as delimiter and BOM in front of the file

fixed:

  • ZkCrudTarget now adds zkPageStyles.fixed for the table

Lib: Accounts

added:

  • AuthTestCompanionBase helper class for authorized unit tests

fixed:

  • Additional roles are added only when the database is empty #48

Lib: Blobs

added:

  • upload and download convenience functions
  • documentation
  • unit tests

deprecated:

  • listByReference - use byReference instead

Lib: Markdown

fixed:

  • added hljs import for text blocks

2021.6.16

17 Jun 04:19
Compare
Choose a tag to compare

Core

fixed:

  • Can't Tab into form select. #35

Lib: Accounts

added:

  • ModuleSettings.emailInAccountPublic - hides email by default
  • AccountsByRole query

fixed:

  • When lib.accounts.yaml is missing, the browser frontend goes into a page refresh cycle #35
  • Broken browser frontend because of missing StackRoles

2021.6.15

15 Jun 07:53
Compare
Choose a tag to compare

Core

added:

  • module startup picture
  • backend testing documentation

Lib: Accounts

added:

  • add application specific roles during startup
  • provide basic authentication from header

2021.6.9

09 Jun 07:19
6201355
Compare
Choose a tag to compare

Core

changed:

  • ZkStringField does not show mandatory mark when min length is 0 and blanks are allowed

fixed:

  • ZkArgPage.open used the view name without a locale
  • ZkRecordIdField set the first item no matter what the user chose
  • ZkOptRecordIdField set the first item no matter what the user chose