-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
64 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2543,7 +2543,7 @@ Conduit.setMethod(function setRouteParameters(data) { | |
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 0.2.0 | ||
* @version 1.3.18 | ||
* @version 1.4.0 | ||
* | ||
* @param {string} name | ||
* @param {Mixed} value | ||
|
@@ -2582,8 +2582,8 @@ Conduit.setMethod(function cookie(name, value, options) { | |
this.new_cookies[name] = value; | ||
|
||
// If there is no domain set, see if it is required | ||
if ((options.domain === true || options.domain == null) && alchemy.settings.cookies.domain && this.url) { | ||
let wanted_domain = alchemy.settings.cookies.domain, | ||
if ((options.domain === true || options.domain == null) && alchemy.settings.frontend.cookies.domain && this.url) { | ||
let wanted_domain = alchemy.settings.frontend.cookies.domain, | ||
actual_domain = this.url.hostname; | ||
|
||
if (wanted_domain != actual_domain) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,6 +164,10 @@ Definition.enforceProperty(function schema(new_value, old_value) { | |
type = 'string'; | ||
} | ||
|
||
if (type == 'function') { | ||
type = 'string'; | ||
} | ||
|
||
new_value.addField('value', type, { | ||
description: this.description, | ||
allowed_values: this.allowed_values, | ||
|
@@ -917,15 +921,33 @@ GroupValue.setProperty(function is_group() { | |
GroupValue.setMethod(function toObject() { | ||
|
||
let result = {}, | ||
entry, | ||
key; | ||
|
||
for (key in this[VALUE]) { | ||
result[key] = this[VALUE][key].toObject(); | ||
entry = this[VALUE][key]; | ||
|
||
if (!entry) { | ||
continue; | ||
} | ||
|
||
result[key] = entry.toObject(); | ||
} | ||
|
||
return result; | ||
}); | ||
|
||
/** | ||
* Remove an entry | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
* @version 1.4.0 | ||
*/ | ||
GroupValue.setMethod(function remove(name) { | ||
this[VALUE][name] = undefined; | ||
}); | ||
|
||
/** | ||
* Get the proxy representation of this group value. | ||
* | ||
|
@@ -970,6 +992,17 @@ GroupValue.setMethod(function setValueSilently(value) { | |
this.definition.setValueSilently(this, value); | ||
}); | ||
|
||
/** | ||
* Inject the given group value | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
* @version 1.4.0 | ||
*/ | ||
GroupValue.setMethod(function injectSubGroupValue(name, value) { | ||
this[VALUE][name] = value; | ||
}); | ||
|
||
/** | ||
* Get all the setting values with executable actions in order. | ||
* | ||
|
@@ -1011,6 +1044,10 @@ GroupValue.setMethod(function getFlattenedValues() { | |
for (key in this[VALUE]) { | ||
entry = this[VALUE][key]; | ||
|
||
if (!entry) { | ||
continue; | ||
} | ||
|
||
if (entry.is_group) { | ||
result.push(...entry.getFlattenedValues()); | ||
} else { | ||
|
@@ -1218,6 +1255,10 @@ SettingValue.setMethod(function setDefaultValue(value) { | |
*/ | ||
SettingValue.setMethod(function setValueSilently(value) { | ||
|
||
if (value instanceof Value) { | ||
value = value[VALUE]; | ||
} | ||
|
||
// Even though the default value and this new value might be the same, | ||
// it is no longer considered to be the "default" value! | ||
this.has_default_value = false; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,10 +38,9 @@ const load = settings.createStage('load', async () => { | |
} | ||
}); | ||
|
||
|
||
/** | ||
* "datasource.connect.load_settings" | ||
* Load any possible settings in the database | ||
* "settings.perform_actions" | ||
* Do all the setting-associated actions. | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
|
@@ -51,4 +50,19 @@ const load = settings.createStage('load', async () => { | |
*/ | ||
const perform_actions = settings.createStage('perform_actions', async () => { | ||
await alchemy.system_settings.performAllActions(); | ||
}); | ||
|
||
/** | ||
* "settings.to_object" | ||
* Convert the `alchemy.settings` property to a simple object | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
* @version 1.4.0 | ||
* | ||
* @type {Alchemy.Stages.Stage} | ||
*/ | ||
const to_object = settings.createStage('to_object', async () => { | ||
// Create the settings object | ||
alchemy.settings = alchemy.system_settings.toObject(); | ||
}); |