Compare commits
303
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bcf052d9b | ||
|
|
39eec09209 | ||
|
|
e536f9fd10 | ||
|
|
a5b7794207 | ||
|
|
1923a20da7 | ||
|
|
54077725c3 | ||
|
|
6b0149803a | ||
|
|
833c2ed13b | ||
|
|
3cd17b7ede | ||
|
|
406576ddfa | ||
|
|
57babbe441 | ||
|
|
c08f7f211c | ||
|
|
156fe5976c | ||
|
|
ac61f85e70 | ||
|
|
2f498be587 | ||
|
|
8d2fb538fd | ||
|
|
2126696559 | ||
|
|
1c39c27e22 | ||
|
|
eba7e41fd4 | ||
|
|
8148e4aee0 | ||
|
|
35acaa2b13 | ||
|
|
a51c3f4cdb | ||
|
|
8dfcdeea23 | ||
|
|
f025b72d6b | ||
|
|
ef0e3d649f | ||
|
|
cd00bcb1e1 | ||
|
|
64c451bf91 | ||
|
|
c77bf2c270 | ||
|
|
f45d4a84f7 | ||
|
|
ce6a3d6751 | ||
|
|
c07ffb68fc | ||
|
|
2d31913837 | ||
|
|
bef052ad3a | ||
|
|
89f996902b | ||
|
|
c7c3a68691 | ||
|
|
852305b7d1 | ||
|
|
68353f9d06 | ||
|
|
f7615a93d5 | ||
|
|
184397a327 | ||
|
|
6519b88dfc | ||
|
|
48dbe959f6 | ||
|
|
70a48596ba | ||
|
|
faa561da2b | ||
|
|
df01eabcf1 | ||
|
|
8969bd23bb | ||
|
|
75613cf061 | ||
|
|
4e71d6f2f6 | ||
|
|
c0b0a47612 | ||
|
|
20666218d2 | ||
|
|
5bac054311 | ||
|
|
597d28b399 | ||
|
|
80c90f23d1 | ||
|
|
7d8a07e703 | ||
|
|
6423529dd0 | ||
|
|
45e7c10cb8 | ||
|
|
057b304a5a | ||
|
|
534ca928b4 | ||
|
|
ddddaeb113 | ||
|
|
146f938051 | ||
|
|
6eebd96605 | ||
|
|
c218c068bd | ||
|
|
ad51832b5d | ||
|
|
93badabcb1 | ||
|
|
db12594332 | ||
|
|
9203cffd27 | ||
|
|
181a7cb27d | ||
|
|
0418be4318 | ||
|
|
1ff6a953bb | ||
|
|
7d18914ae6 | ||
|
|
76c1bce7d7 | ||
|
|
b594936463 | ||
|
|
02e76c8227 | ||
|
|
c511f19cc8 | ||
|
|
f5d0abc28b | ||
|
|
037580b305 | ||
|
|
d0823d4236 | ||
|
|
538fb173c2 | ||
|
|
c1552cf7fc | ||
|
|
535008ebc1 | ||
|
|
4fffb9f7a7 | ||
|
|
4e519d4c96 | ||
|
|
78cfb29908 | ||
|
|
20f0ceeda6 | ||
|
|
cde05c1197 | ||
|
|
7114c564da | ||
|
|
496e281f2a | ||
|
|
10ae512731 | ||
|
|
3f7f2797a6 | ||
|
|
c6bfc61909 | ||
|
|
fd701068ae | ||
|
|
cca29bf723 | ||
|
|
b55ee70fe8 | ||
|
|
5a613bacf0 | ||
|
|
fe1df8d4ea | ||
|
|
0d836875c7 | ||
|
|
bd8084ac99 | ||
|
|
04c292f167 | ||
|
|
a302b10f66 | ||
|
|
b97d016c13 | ||
|
|
0aa4d1956a | ||
|
|
267df80161 | ||
|
|
cde312b6d4 | ||
|
|
59eee2e5dd | ||
|
|
b3b4059ec8 | ||
|
|
f3c5c0976d | ||
|
|
a9daab5a15 | ||
|
|
6f7a9cbd7b | ||
|
|
18c2a18ec8 | ||
|
|
defe9d432b | ||
|
|
a02ef3c101 | ||
|
|
93432a2658 | ||
|
|
8e78de4dc5 | ||
|
|
4469191c99 | ||
|
|
ead813989d | ||
|
|
0f3aa320be | ||
|
|
3044f8df04 | ||
|
|
608a65147f | ||
|
|
c7e45ae13a | ||
|
|
30a30731ec | ||
|
|
c08921d3e6 | ||
|
|
5bebf98339 | ||
|
|
5d08caae8c | ||
|
|
22b7771305 | ||
|
|
cf9f4f39e4 | ||
|
|
886d7f1a25 | ||
|
|
8c9410a307 | ||
|
|
ff2865c1dc | ||
|
|
92480b8446 | ||
|
|
c22b9dbb76 | ||
|
|
cbb19b1d93 | ||
|
|
2aa79c7494 | ||
|
|
17266dacb1 | ||
|
|
1ab0bb9254 | ||
|
|
cc05428640 | ||
|
|
cade6cb684 | ||
|
|
3c40c20d27 | ||
|
|
097645eadd | ||
|
|
62b289e179 | ||
|
|
8d82f86c29 | ||
|
|
1ac77680e0 | ||
|
|
8746d4c13d | ||
|
|
fbb80c4a94 | ||
|
|
7e8f23e514 | ||
|
|
3afad96aa7 | ||
|
|
a98b52a46b | ||
|
|
5d9e2b0bb8 | ||
|
|
c20f45dcfc | ||
|
|
215bf69cb0 | ||
|
|
fff3e5e9d4 | ||
|
|
413a278373 | ||
|
|
5d6fc6005c | ||
|
|
d9d5dc5626 | ||
|
|
2ff2ae3f0a | ||
|
|
cfacf4e150 | ||
|
|
d8551e4640 | ||
|
|
373138d70f | ||
|
|
10d252819d | ||
|
|
ca5c85e656 | ||
|
|
a6aaf4b0b1 | ||
|
|
44e8808079 | ||
|
|
59b0224eff | ||
|
|
65723ea9ec | ||
|
|
50a239a016 | ||
|
|
5ef013ca62 | ||
|
|
ff477c3930 | ||
|
|
1cdc6f0fd2 | ||
|
|
49e0e6c1c9 | ||
|
|
7e9def9df4 | ||
|
|
009b36b49e | ||
|
|
44ddf7acef | ||
|
|
6b3a589aa0 | ||
|
|
95f1ed33ec | ||
|
|
993c582bd9 | ||
|
|
a72698e1a9 | ||
|
|
c905fdd9b5 | ||
|
|
34bfd3a8f3 | ||
|
|
dfbb182a94 | ||
|
|
aba4f02bad | ||
|
|
a27da0fced | ||
|
|
0c7ef06031 | ||
|
|
e6d6dce3a8 | ||
|
|
24d2dcf363 | ||
|
|
25ea5cdb1b | ||
|
|
cf3d697bc5 | ||
|
|
6fd45f653c | ||
|
|
d97d0040c2 | ||
|
|
aa62417916 | ||
|
|
62e3286c71 | ||
|
|
d433991b61 | ||
|
|
bc24efa812 | ||
|
|
6d52a2f3da | ||
|
|
66961d18dc | ||
|
|
fa0027d4f1 | ||
|
|
a24b099831 | ||
|
|
6860d0b27d | ||
|
|
dad1c190fc | ||
|
|
36faff6917 | ||
|
|
7ddddb7500 | ||
|
|
b56f0f7062 | ||
|
|
9121879e1a | ||
|
|
69132faffa | ||
|
|
4a6c409a1f | ||
|
|
4351ce6ee4 | ||
|
|
1b56a260b8 | ||
|
|
de4b3af28f | ||
|
|
321d5b49bd | ||
|
|
ee3f7520b3 | ||
|
|
5a3578eca9 | ||
|
|
366d7c0fce | ||
|
|
860c8e8ae2 | ||
|
|
05d606d6a7 | ||
|
|
2dc9ccda6d | ||
|
|
9187186c62 | ||
|
|
5813a8aadf | ||
|
|
15bedfbc76 | ||
|
|
4c037774de | ||
|
|
fe0ec420eb | ||
|
|
860792ff3f | ||
|
|
169d07b0cc | ||
|
|
8c5a5af41b | ||
|
|
411fb0c120 | ||
|
|
27c60277f2 | ||
|
|
dafd7f298d | ||
|
|
e67da0b198 | ||
|
|
4f0a837e20 | ||
|
|
864fd2a45a | ||
|
|
8877c9c73d | ||
|
|
ab870347ed | ||
|
|
06f2408ebc | ||
|
|
a53d28310f | ||
|
|
9568d0cd6d | ||
|
|
aba5edce02 | ||
|
|
791e4f92a1 | ||
|
|
566648de3f | ||
|
|
a13e66d559 | ||
|
|
3a269ed329 | ||
|
|
7f762df952 | ||
|
|
27a3431e76 | ||
|
|
7cc495dc65 | ||
|
|
b581a45e05 | ||
|
|
76fc3f8201 | ||
|
|
555b4fadf1 | ||
|
|
79817f5463 | ||
|
|
ff6a8d781d | ||
|
|
789a908a31 | ||
|
|
336f2c2d5b | ||
|
|
8b6c844a55 | ||
|
|
f1c83fbd80 | ||
|
|
0f4020dc7b | ||
|
|
62fa1695df | ||
|
|
de2668a621 | ||
|
|
a34e278a40 | ||
|
|
461043bd82 | ||
|
|
7f9b143e1a | ||
|
|
91c4c77676 | ||
|
|
d1f1817744 | ||
|
|
8393a5ba04 | ||
|
|
cf410ab91e | ||
|
|
df6c8a4ecc | ||
|
|
be6e0879e4 | ||
|
|
731b06a987 | ||
|
|
6f89bf2a45 | ||
|
|
4eda091fdb | ||
|
|
b63aa4b19c | ||
|
|
8c780573f4 | ||
|
|
0b0182f550 | ||
|
|
158f4d29f6 | ||
|
|
139c5791a5 | ||
|
|
27ef97bf34 | ||
|
|
d6f968eee4 | ||
|
|
a6ce7bcdf6 | ||
|
|
0200434227 | ||
|
|
9a5bcf290d | ||
|
|
ec183e481c | ||
|
|
924a819baa | ||
|
|
3af6645ad8 | ||
|
|
824bc2ac28 | ||
|
|
febdac5713 | ||
|
|
22dd3a214c | ||
|
|
4382868f82 | ||
|
|
5c019a1557 | ||
|
|
bdcb5d859e | ||
|
|
1810cec80a | ||
|
|
472cc716c4 | ||
|
|
3167c8b213 | ||
|
|
2abf455abf | ||
|
|
f2450fb539 | ||
|
|
c0dfb33916 | ||
|
|
477697a70c | ||
|
|
5de36f5669 | ||
|
|
a71529a058 | ||
|
|
deff17e622 | ||
|
|
8c822c59ac | ||
|
|
c79380191b | ||
|
|
a779803763 | ||
|
|
1b98f8985e | ||
|
|
56d54d441f | ||
|
|
9dbe2d211c | ||
|
|
aae8694618 | ||
|
|
6a95ff366f | ||
|
|
c3b619fbbf | ||
|
|
366a8ba565 | ||
|
|
50da4a77de |
@@ -306,48 +306,6 @@ dotnet_naming_rule.other_public_protected_fields_disallowed_rule.symbols
|
||||
dotnet_naming_rule.other_public_protected_fields_disallowed_rule.style = disallowed_style
|
||||
dotnet_naming_rule.other_public_protected_fields_disallowed_rule.severity = error
|
||||
|
||||
##########################################
|
||||
# StyleCop Field Naming Rules
|
||||
# Naming rules for fields follow the StyleCop analyzers
|
||||
# This does not override any rules using disallowed_style above
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
|
||||
##########################################
|
||||
|
||||
# All constant fields must be PascalCase
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1303.md
|
||||
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private
|
||||
dotnet_naming_symbols.stylecop_constant_fields_group.required_modifiers = const
|
||||
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_kinds = field
|
||||
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.symbols = stylecop_constant_fields_group
|
||||
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.style = pascal_case_style
|
||||
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.severity = warning
|
||||
|
||||
# All static readonly fields must be PascalCase
|
||||
# Ajusted to ignore private fields.
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1311.md
|
||||
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
|
||||
dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly
|
||||
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field
|
||||
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group
|
||||
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style
|
||||
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.severity = warning
|
||||
|
||||
# No non-private instance fields are allowed
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1401.md
|
||||
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
|
||||
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_kinds = field
|
||||
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.symbols = stylecop_fields_must_be_private_group
|
||||
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.style = disallowed_style
|
||||
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.severity = error
|
||||
|
||||
# Local variables must be camelCase
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1312.md
|
||||
dotnet_naming_symbols.stylecop_local_fields_group.applicable_accessibilities = local
|
||||
dotnet_naming_symbols.stylecop_local_fields_group.applicable_kinds = local
|
||||
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.symbols = stylecop_local_fields_group
|
||||
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.style = camel_case_style
|
||||
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.severity = silent
|
||||
|
||||
# This rule should never fire. However, it's included for at least two purposes:
|
||||
# First, it helps to understand, reason about, and root-case certain types of issues, such as bugs in .editorconfig parsers.
|
||||
# Second, it helps to raise immediate awareness if a new field type is added (as occurred recently in C#).
|
||||
@@ -357,7 +315,6 @@ dotnet_naming_rule.sanity_check_uncovered_field_case_rule.symbols = sanity_chec
|
||||
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.style = internal_error_style
|
||||
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.severity = error
|
||||
|
||||
|
||||
##########################################
|
||||
# Other Naming Rules
|
||||
##########################################
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
# Umbraco Code of Conduct
|
||||
|
||||
## Preamble
|
||||
|
||||
We are the friendly CMS. And our friendliness stems from our values. That's why we have set for ourselves, Umbraco HQ, and the community, five values to guide us in everything we do:
|
||||
|
||||
* Trust - We believe in and empower people
|
||||
* Respect - We treat others as we would like to be treated
|
||||
* Open - We share our thoughts and knowledge
|
||||
* Hungry - We want to do things better, best is next
|
||||
* Friendly - We want to build long-lasting relationships
|
||||
|
||||
With these values in mind, we want to offer the Umbraco community a code of conduct that specifies a baseline standard of behavior so that people with different social values and communication styles can work together.
|
||||
|
||||
This code of conduct is based on the widely used Contributor Covenant, as described in [https://www.contributor-covenant.org/](https://www.contributor-covenant.org/)
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
Examples of behavior that contributes to a positive environment for our community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders (e.g. Meetup & festival organizers, moderators, maintainers, ...) are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
||||
|
||||
Specific enforcement steps are listed in the [Code of Conduct Enforcement Guidelines](https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/.github/CODE_OF_CONDUCT_ENFORCEMENT.md) document which is an appendix of this document, updated and maintained by the Code of Conduct Team.
|
||||
|
||||
## Scope
|
||||
This Code of Conduct applies within all community spaces and events supported by Umbraco HQ or using the Umbraco name. It also applies when an individual is officially representing the community in public spaces.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior, may be reported at [conduct@umbraco.com](mailto:conduct@umbraco.com). All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
Or alternatively, you can reach out directly to any of the team members behind the address above:
|
||||
|
||||
* Sebastiaan Janssen (He, Him - Languages spoken: English, Dutch, Danish(Read)) [sebastiaan@umbraco.com](mailto:sebastiaan@umbraco.com)
|
||||
* Ilham Boulghallat (She, Her - Languages spoken: English, French, Arabic) [ilham@umbraco.com](mailto:ilham@umbraco.com)
|
||||
* Arnold Visser (He, Him - Languages spoken: English, Dutch) [arnold@umbraco.com](mailto:arnold@umbraco.com)
|
||||
|
||||
The review process is done with full respect for the privacy and security of the reporter of any incident.
|
||||
|
||||
People with a conflict of interest should exclude themselves or if necessary be excluded by the other team members.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
**1. Correction**
|
||||
Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
||||
|
||||
Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
**2. Warning**
|
||||
Community Impact: A violation through a single incident or series of actions.
|
||||
|
||||
Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
||||
|
||||
**3. Temporary Ban**
|
||||
Community Impact: A serious violation of community standards, including sustained inappropriate behavior.
|
||||
|
||||
Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
||||
|
||||
**4. Permanent Ban**
|
||||
Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
Consequence: A permanent ban from any sort of public interaction within the community.
|
||||
|
||||
## Attribution
|
||||
This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
|
||||
|
||||
This Code of Conduct will be maintained and reviewed by the team listed above.
|
||||
@@ -1,57 +0,0 @@
|
||||
# Umbraco Code of Conduct Enforcement guidelines - Consequence Ladder
|
||||
|
||||
These are the steps followed by the [Umbraco Code of Conduct Team](https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/.github/CODE_OF_CONDUCT.md) when we respond to an issue or incident brought to our attention by a community member.
|
||||
|
||||
This is an appendix to the Code of Conduct and is updated and maintained by the Code of Conduct Team.
|
||||
|
||||
To make sure that all reports will be reviewed and investigated promptly and fairly, as highlighted in the Umbraco Code of Conduct, we are following [Mozilla’s Consequence Ladder approach](https://github.com/mozilla/inclusion/blob/master/code-of-conduct-enforcement/consequence-ladder.md).
|
||||
|
||||
This approach helps the Team enforce the Code of Conduct in a structured manner and can be used as a way of communicating escalation. Each time the Team takes an action (warning, ban) the individual is made aware of future consequences. The Team can either follow the order of the levels in the ladder or decide to jump levels. When needed, the team can go directly to a permanent ban.
|
||||
|
||||
**Level 0: No Action**
|
||||
Recommendations do not indicate a violation of the Code of Conduct.
|
||||
|
||||
**Level 1: Simple Warning Issued**
|
||||
A private, written warning from the Code of Conduct Team, with clarity of violation, consequences of continued behavior.
|
||||
|
||||
**Level 2: Warning**
|
||||
A private, written warning from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
|
||||
|
||||
* Communication of next-level consequences if behaviors are repeated (according to this ladder).
|
||||
|
||||
**Level 3: Warning + Mandatory Cooling Off Period (Access Retained)**
|
||||
A private warning from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
|
||||
|
||||
* Request to avoid interaction on community messaging platforms (public forums, Our, commenting on issues).
|
||||
* This includes avoiding any interactions in any Umbraco channels, spaces/offices, as well as external channels like social media (e.g. Twitter, Facebook, LinkedIn). For example, 'following/liking/retweeting' would be considered a violation of these terms, and consequence would escalate according to this ladder.
|
||||
* Require they do not interact with others in the report, or those who they suspect are involved in the report.
|
||||
* Suggestions for 'out of office' type of message on platforms, to reduce curiosity, or suspicion among those not involved.
|
||||
|
||||
**Level 4: Temporary Ban (Access Revoked)**
|
||||
Private communication of ban from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
|
||||
|
||||
* 3-6 months imposed break.
|
||||
* All accounts deactivated, or blocked during this time (Our, HQ Slack if applicable).
|
||||
* Require to avoid interaction on community messaging platforms (public forums, Our, commenting on issues).
|
||||
* This includes avoiding any interactions in any Umbraco channels, spaces/offices, as well as external channels like social media (e.g. Twitter, Facebook, LinkedIn). For example, 'following/liking/retweeting' would be considered a violation of these terms, and consequence would escalate according to this ladder.
|
||||
* All community leadership roles (e.g. Community Teams, Meetup/festival organizer, Commit right on Github..) suspended. (onboarding/reapplication required outside of this process)
|
||||
* No attendance at Umbraco events during the ban period.
|
||||
* Not allowed to enter Umbraco HQ offices during the ban period.
|
||||
* Permission to use the MVP title, if applicable, is revoked during this ban period.
|
||||
* The community leaders running events and other initiatives are informed of the ban.
|
||||
|
||||
**Level 5: Permanent Ban**
|
||||
Private communication of ban from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
|
||||
|
||||
* All accounts deactivated permanently.
|
||||
* No attendance at Umbraco events going forward.
|
||||
* Not allowed to enter Umbraco HQ offices permanently.
|
||||
* All community leadership roles (e.g. Community Teams, Meetup/festival organizer, Commit right on Github..) permanently suspended.
|
||||
* Permission to use the MVP title, if applicable, revoked.
|
||||
* The community leaders running events and other initiatives are informed of the ban.
|
||||
|
||||
|
||||
Sources:
|
||||
* [Mozilla Code of Conduct - Enforcement Consequence Ladder](https://github.com/mozilla/inclusion/blob/master/code-of-conduct-enforcement/consequence-ladder.md)
|
||||
* [Drupal Conflict Resolution Policy and Process](https://www.drupal.org/conflict-resolution)
|
||||
* [Django Code of Conduct - Enforcement Manual](https://www.djangoproject.com/conduct/enforcement-manual/)
|
||||
@@ -10,7 +10,7 @@ Remember, we're a friendly bunch and are happy with whatever contribution you mi
|
||||
|
||||
**Code of conduct**
|
||||
|
||||
This project and everyone participating in it, is governed by the [our Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [Sebastiaan Janssen - sj@umbraco.dk](mailto:sj@umbraco.dk).
|
||||
This project and everyone participating in it, is governed by the [our Code of Conduct](https://github.com/umbraco/.github/blob/main/.github/CODE_OF_CONDUCT.md).
|
||||
|
||||
**Table of contents**
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
# [Umbraco CMS](https://umbraco.com) · [](../LICENSE.md) [](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=75) [](CONTRIBUTING.md) [](https://twitter.com/intent/follow?screen_name=umbraco)
|
||||
# [Umbraco CMS](https://umbraco.com) · [](../LICENSE.md) [](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=75) [](CONTRIBUTING.md) [](https://twitter.com/intent/follow?screen_name=umbraco) [](https://discord.gg/umbraco)
|
||||
|
||||
Umbraco is the friendliest, most flexible and fastest growing ASP.NET CMS, and used by more than 500,000 websites worldwide. Our mission is to help you deliver delightful digital experiences by making Umbraco friendly, simpler and social.
|
||||
|
||||
@@ -15,7 +15,7 @@ See the official [Umbraco website](https://umbraco.com) for an introduction, cor
|
||||
- [Community](#join-the-umbraco-community)
|
||||
- [Contributing](#contributing)
|
||||
|
||||
Please also see our [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||
Please also see our [Code of Conduct](https://github.com/umbraco/.github/blob/main/.github/CODE_OF_CONDUCT.md).
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
name: pr-first-response
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
send-response:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch random comment 🗣️
|
||||
uses: JamesIves/fetch-api-data-action@v2.1.0
|
||||
with:
|
||||
ENDPOINT: https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment
|
||||
CONFIGURATION: '{ "method": "POST", "headers": {"Authorization": "Bearer ${{ secrets.OUR_BOT_API_TOKEN }}", "Content-Type": "application/json" }, "body": { "repo": "${{ github.repository }}", "number": "${{ github.event.number }}", "actor": "${{ github.actor }}", "commentType": "opened-pr-first-comment"} }'
|
||||
- name: Add PR comment
|
||||
if: "${{ env.fetch-api-data != '' }}"
|
||||
uses: actions/github-script@v5
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `${{ env.fetch-api-data }}`
|
||||
})
|
||||
@@ -85,6 +85,12 @@ src/Umbraco.Web.UI/wwwroot/[Uu]mbraco/lib/*
|
||||
src/Umbraco.Web.UI/wwwroot/[Uu]mbraco/views/*
|
||||
src/Umbraco.Web.UI/wwwroot/Media/*
|
||||
src/Umbraco.Web.UI/Smidge/
|
||||
src/Umbraco.Web.UI/App_Code/
|
||||
src/Umbraco.Web.UI/App_Plugins/
|
||||
src/Umbraco.Web.UI/Views/
|
||||
!src/Umbraco.Web.UI/Views/Partials/blocklist/
|
||||
!src/Umbraco.Web.UI/Views/Partials/grid/
|
||||
!src/Umbraco.Web.UI/Views/_ViewImports.cshtml
|
||||
|
||||
# Tests
|
||||
cypress.env.json
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
is_global = true
|
||||
|
||||
##########################################
|
||||
# StyleCopAnalyzers Settings
|
||||
##########################################
|
||||
|
||||
# All constant fields must be PascalCase
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1303.md
|
||||
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private
|
||||
dotnet_naming_symbols.stylecop_constant_fields_group.required_modifiers = const
|
||||
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_kinds = field
|
||||
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.symbols = stylecop_constant_fields_group
|
||||
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.style = pascal_case_style
|
||||
|
||||
# All static readonly fields must be PascalCase
|
||||
# Ajusted to ignore private fields.
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1311.md
|
||||
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
|
||||
dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly
|
||||
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field
|
||||
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group
|
||||
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style
|
||||
|
||||
# No non-private instance fields are allowed
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1401.md
|
||||
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
|
||||
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_kinds = field
|
||||
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.symbols = stylecop_fields_must_be_private_group
|
||||
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.style = disallowed_style
|
||||
|
||||
# Local variables must be camelCase
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1312.md
|
||||
dotnet_naming_symbols.stylecop_local_fields_group.applicable_accessibilities = local
|
||||
dotnet_naming_symbols.stylecop_local_fields_group.applicable_kinds = local
|
||||
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.symbols = stylecop_local_fields_group
|
||||
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.style = camel_case_style
|
||||
|
||||
##########################################
|
||||
# StyleCopAnalyzers rule severity
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
|
||||
##########################################
|
||||
|
||||
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = suggestion
|
||||
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.ReadabilityRules.severity = suggestion
|
||||
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.NamingRules.severity = suggestion
|
||||
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.SpacingRules.severity = suggestion
|
||||
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.OrderingRules.severity = suggestion
|
||||
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.MaintainabilityRules.severity = suggestion
|
||||
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.LayoutRules.severity = suggestion
|
||||
|
||||
dotnet_diagnostic.SA1636.severity = none # SA1636: File header copyright text should match
|
||||
dotnet_diagnostic.SA1101.severity = none # PrefixLocalCallsWithThis - stylecop appears to be ignoring dotnet_style_qualification_for_*
|
||||
|
||||
dotnet_diagnostic.SA1503.severity = warning # BracesMustNotBeOmitted
|
||||
dotnet_diagnostic.SA1117.severity = warning # ParametersMustBeOnSameLineOrSeparateLines
|
||||
dotnet_diagnostic.SA1116.severity = warning # SplitParametersMustStartOnLineAfterDeclaration
|
||||
dotnet_diagnostic.SA1122.severity = warning # UseStringEmptyForEmptyStrings
|
||||
dotnet_diagnostic.SA1028.severity = warning # CodeMustNotContainTrailingWhitespace
|
||||
dotnet_diagnostic.SA1500.severity = warning # BracesForMultiLineStatementsMustNotShareLine
|
||||
dotnet_diagnostic.SA1401.severity = warning # FieldsMustBePrivate
|
||||
dotnet_diagnostic.SA1519.severity = warning # BracesMustNotBeOmittedFromMultiLineChildStatement
|
||||
dotnet_diagnostic.SA1111.severity = warning # ClosingParenthesisMustBeOnLineOfLastParameter
|
||||
dotnet_diagnostic.SA1520.severity = warning # UseBracesConsistently
|
||||
dotnet_diagnostic.SA1407.severity = warning # ArithmeticExpressionsMustDeclarePrecedence
|
||||
dotnet_diagnostic.SA1400.severity = warning # AccessModifierMustBeDeclared
|
||||
dotnet_diagnostic.SA1119.severity = warning # StatementMustNotUseUnnecessaryParenthesis
|
||||
dotnet_diagnostic.SA1649.severity = warning # FileNameMustMatchTypeName
|
||||
dotnet_diagnostic.SA1121.severity = warning # UseBuiltInTypeAlias
|
||||
dotnet_diagnostic.SA1132.severity = warning # DoNotCombineFields
|
||||
dotnet_diagnostic.SA1134.severity = warning # AttributesMustNotShareLine
|
||||
dotnet_diagnostic.SA1106.severity = warning # CodeMustNotContainEmptyStatements
|
||||
dotnet_diagnostic.SA1312.severity = warning # VariableNamesMustBeginWithLowerCaseLetter
|
||||
dotnet_diagnostic.SA1303.severity = warning # ConstFieldNamesMustBeginWithUpperCaseLetter
|
||||
dotnet_diagnostic.SA1310.severity = warning # FieldNamesMustNotContainUnderscore
|
||||
dotnet_diagnostic.SA1130.severity = warning # UseLambdaSyntax
|
||||
dotnet_diagnostic.SA1405.severity = warning # DebugAssertMustProvideMessageText
|
||||
dotnet_diagnostic.SA1205.severity = warning # PartialElementsMustDeclareAccess
|
||||
dotnet_diagnostic.SA1306.severity = warning # FieldNamesMustBeginWithLowerCaseLetter
|
||||
dotnet_diagnostic.SA1209.severity = warning # UsingAliasDirectivesMustBePlacedAfterOtherUsingDirectives
|
||||
dotnet_diagnostic.SA1216.severity = warning # UsingStaticDirectivesMustBePlacedAtTheCorrectLocation
|
||||
dotnet_diagnostic.SA1133.severity = warning # DoNotCombineAttributes
|
||||
dotnet_diagnostic.SA1135.severity = warning # UsingDirectivesMustBeQualified
|
||||
@@ -2,12 +2,6 @@
|
||||
<Project>
|
||||
<!-- Package references and additional files which are consumed by all projects -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" IsImplicitlyDefined="true" />
|
||||
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406" PrivateAssets="all" IsImplicitlyDefined="true" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Specify rule set for all projects -->
|
||||
<PropertyGroup>
|
||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)codeanalysis.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<PropertyGroup>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\is-cache\**;wwwroot\ms-cache\**</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins/**</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco/Data/**</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco/Logs/**</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot/media/**</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<PropertyGroup>
|
||||
<ContentFilesPath>$(MSBuildThisFileDirectory)..\content\umbraco\**\*.*</ContentFilesPath>
|
||||
@@ -6,16 +6,6 @@
|
||||
<UmbracoWwwrootName Condition="'$(UmbracoWwwrootName)' == ''">umbraco</UmbracoWwwrootName>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins\**;</DefaultItemExcludes>
|
||||
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\Data\**;</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\Logs\**;</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\mediacache\**;</DefaultItemExcludes>
|
||||
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\media\**;</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CopyUmbracoAssets" BeforeTargets="BeforeBuild">
|
||||
<ItemGroup>
|
||||
<ContentFiles Include="$(ContentFilesPath)" />
|
||||
@@ -39,6 +29,7 @@
|
||||
|
||||
<ContentWithTargetPath
|
||||
Include="@(_AppPluginsFiles)"
|
||||
Exclude="@(ContentWithTargetPath)"
|
||||
TargetPath="%(Identity)"
|
||||
CopyToOutputDirectory="PreserveNewest"
|
||||
CopyToPublishDirectory="PreserveNewest"/>
|
||||
@@ -65,6 +56,7 @@
|
||||
|
||||
<ContentWithTargetPath
|
||||
Include="@(_UmbracoFolderFiles)"
|
||||
Exclude="@(ContentWithTargetPath)"
|
||||
TargetPath="%(Identity)"
|
||||
CopyToOutputDirectory="PreserveNewest"
|
||||
CopyToPublishDirectory="PreserveNewest"/>
|
||||
@@ -92,7 +84,7 @@
|
||||
|
||||
<Target Name="IncludeUmbracoRazorFiles" BeforeTargets="ResolveRazorGenerateInputs">
|
||||
<ItemGroup>
|
||||
<Content Include="$(MSBuildProjectDirectory)\umbraco\**\*.cshtml" />
|
||||
<Content Include="$(MSBuildProjectDirectory)\umbraco\**\*.cshtml" Exclude="@(Content)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
|
||||
+13
-28
@@ -396,42 +396,27 @@ stages:
|
||||
|
||||
$ubuild = build/build.ps1 -get -continue
|
||||
|
||||
|
||||
$version = $ubuild.GetUmbracoVersion()
|
||||
|
||||
$isRelease = [regex]::matches($env:BUILD_SOURCEBRANCH,"v\d+\/\d+.\d+.*")
|
||||
|
||||
if ($isRelease.Count -gt 0){
|
||||
if ($isRelease.Count -gt 0) {
|
||||
$continuous = $version.Semver
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$date = (Get-Date).ToString("yyyyMMdd")
|
||||
$continuous = "$($version.release)-preview$date.$(Build.BuildId)"
|
||||
$ubuild.SetUmbracoVersion($continuous)
|
||||
|
||||
#Update the version in templates also
|
||||
|
||||
$templatePath =
|
||||
'build/templates/UmbracoProject/.template.config/template.json'
|
||||
|
||||
$a = Get-Content $templatePath -raw | ConvertFrom-Json
|
||||
|
||||
$a.symbols.version.defaultValue = $continuous
|
||||
|
||||
$a | ConvertTo-Json -depth 32| set-content $templatePath
|
||||
|
||||
|
||||
$templatePath =
|
||||
'build/templates/UmbracoPackage/.template.config/template.json'
|
||||
|
||||
$a = Get-Content $templatePath -raw | ConvertFrom-Json
|
||||
|
||||
$a.symbols.version.defaultValue = $continuous
|
||||
|
||||
$a | ConvertTo-Json -depth 32| set-content $templatePath
|
||||
}
|
||||
# Update the default Umbraco version in templates
|
||||
$templatePaths = Get-ChildItem 'templates/**/.template.config/template.json'
|
||||
foreach ($templatePath in $templatePaths) {
|
||||
$a = Get-Content $templatePath -Raw | ConvertFrom-Json
|
||||
if ($a.symbols -and $a.symbols.UmbracoVersion) {
|
||||
$a.symbols.UmbracoVersion.defaultValue = $continuous
|
||||
$a | ConvertTo-Json -Depth 32 | Set-Content $templatePath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "##vso[build.updatebuildnumber]$continuous.$(Build.BuildId)"
|
||||
|
||||
@@ -538,7 +523,7 @@ stages:
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
choco install docfx --version=2.58.5 -y
|
||||
choco install docfx --version=2.59.0 -y
|
||||
if ($lastexitcode -ne 0){
|
||||
throw ("Error installing DocFX")
|
||||
}
|
||||
|
||||
+18
-51
@@ -11,7 +11,7 @@
|
||||
[Alias("loc")]
|
||||
[switch] $local = $false,
|
||||
|
||||
# enable docfx
|
||||
# enable docfx
|
||||
[Parameter(Mandatory=$false)]
|
||||
[Alias("doc")]
|
||||
[switch] $docfx = $false,
|
||||
@@ -40,7 +40,7 @@
|
||||
@{ Continue = $continue })
|
||||
if ($ubuild.OnError()) { return }
|
||||
|
||||
Write-Host "Umbraco Cms Build"
|
||||
Write-Host "Umbraco CMS Build"
|
||||
Write-Host "Umbraco.Build v$($ubuild.BuildVersion)"
|
||||
|
||||
# ################################################################
|
||||
@@ -84,7 +84,7 @@
|
||||
$this.SetEnvVar("NPM_CONFIG_CACHE", $node_npmcache)
|
||||
$this.SetEnvVar("NPM_CONFIG_PREFIX", $node_npmprefix)
|
||||
|
||||
$ignore = $this.ClearEnvVar("NODE_NO_HTTP2")
|
||||
$this.ClearEnvVar("NODE_NO_HTTP2")
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("CompileBelle",
|
||||
@@ -171,11 +171,6 @@
|
||||
$src = "$($this.SolutionRoot)\src"
|
||||
$log = "$($this.BuildTemp)\build.umbraco.log"
|
||||
|
||||
if ($this.BuildEnv.VisualStudio -eq $null)
|
||||
{
|
||||
throw "Build environment does not provide VisualStudio."
|
||||
}
|
||||
|
||||
Write-Host "Compile Umbraco"
|
||||
Write-Host "Logging to $log"
|
||||
|
||||
@@ -195,14 +190,14 @@
|
||||
|
||||
# remove extra files
|
||||
$webAppBin = "$($this.BuildTemp)\WebApp\bin"
|
||||
$excludeDirs = @("$($webAppBin)\refs","$($webAppBin)\runtimes","$($webAppBin)\Umbraco","$($webAppBin)\wwwroot")
|
||||
$excludeDirs = @("$($webAppBin)\refs","$($webAppBin)\runtimes","$($webAppBin)\umbraco","$($webAppBin)\wwwroot")
|
||||
$excludeFiles = @("$($webAppBin)\appsettings.*","$($webAppBin)\*.deps.json","$($webAppBin)\*.exe","$($webAppBin)\*.config","$($webAppBin)\*.runtimeconfig.json")
|
||||
$this.RemoveDirectory($excludeDirs)
|
||||
$this.RemoveFile($excludeFiles)
|
||||
|
||||
# copy rest of the files into WebApp
|
||||
$this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI\Umbraco", "*", "$($this.BuildTemp)\WebApp\umbraco")
|
||||
$excludeUmbracoDirs = @("$($this.BuildTemp)\WebApp\umbraco\lib")
|
||||
$this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI\umbraco", "*", "$($this.BuildTemp)\WebApp\umbraco")
|
||||
$excludeUmbracoDirs = @("$($this.BuildTemp)\WebApp\umbraco\lib","$($this.BuildTemp)\WebApp\umbraco\Data","$($this.BuildTemp)\WebApp\umbraco\Logs")
|
||||
$this.RemoveDirectory($excludeUmbracoDirs)
|
||||
$this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI\Views", "*", "$($this.BuildTemp)\WebApp\Views")
|
||||
Copy-Item "$($this.SolutionRoot)\src\Umbraco.Web.UI\appsettings.json" "$($this.BuildTemp)\WebApp"
|
||||
@@ -255,27 +250,21 @@
|
||||
$buildConfiguration = "Release"
|
||||
$log = "$($this.BuildTemp)\msbuild.tests.log"
|
||||
|
||||
if ($this.BuildEnv.VisualStudio -eq $null)
|
||||
{
|
||||
throw "Build environment does not provide VisualStudio."
|
||||
}
|
||||
|
||||
Write-Host "Compile Tests"
|
||||
Write-Host "Logging to $log"
|
||||
|
||||
# beware of the weird double \\ at the end of paths
|
||||
# see http://edgylogic.com/blog/powershell-and-external-commands-done-right/
|
||||
&$this.BuildEnv.VisualStudio.MsBuild "$($this.SolutionRoot)\tests\Umbraco.Tests\Umbraco.Tests.csproj" `
|
||||
/p:WarningLevel=0 `
|
||||
/p:Configuration=$buildConfiguration `
|
||||
/p:Platform=AnyCPU `
|
||||
/p:UseWPP_CopyWebApplication=True `
|
||||
/p:PipelineDependsOnBuild=False `
|
||||
/p:OutDir="$($this.BuildTemp)\tests\\" `
|
||||
/p:Verbosity=minimal `
|
||||
/t:Build `
|
||||
/tv:"$($this.BuildEnv.VisualStudio.ToolsVersion)" `
|
||||
/p:UmbracoBuild=True `
|
||||
&dotnet msbuild "$($this.SolutionRoot)\tests\Umbraco.Tests\Umbraco.Tests.csproj" `
|
||||
-target:Build `
|
||||
-property:WarningLevel=0 `
|
||||
-property:Configuration=$buildConfiguration `
|
||||
-property:Platform=AnyCPU `
|
||||
-property:UseWPP_CopyWebApplication=True `
|
||||
-property:PipelineDependsOnBuild=False `
|
||||
-property:OutDir="$($this.BuildTemp)\tests\\" `
|
||||
-property:Verbosity=minimal `
|
||||
-property:UmbracoBuild=True `
|
||||
> $log
|
||||
|
||||
# copy Umbraco.Persistence.SqlCe files into WebApp
|
||||
@@ -292,10 +281,6 @@
|
||||
|
||||
$src = "$($this.SolutionRoot)\src"
|
||||
$tmp = "$($this.BuildTemp)"
|
||||
$out = "$($this.BuildOutput)"
|
||||
$templates = "$($this.SolutionRoot)\build\templates"
|
||||
|
||||
$buildConfiguration = "Release"
|
||||
|
||||
# cleanup build
|
||||
Write-Host "Clean build"
|
||||
@@ -309,7 +294,6 @@
|
||||
# create directories
|
||||
Write-Host "Create directories"
|
||||
mkdir "$tmp\WebApp\App_Data" > $null
|
||||
mkdir "$tmp\Templates" > $null
|
||||
#mkdir "$tmp\WebApp\Media" > $null
|
||||
#mkdir "$tmp\WebApp\Views" > $null
|
||||
|
||||
@@ -332,10 +316,6 @@
|
||||
{
|
||||
$nugetPackages = [System.Environment]::ExpandEnvironmentVariables("%userprofile%\.nuget\packages")
|
||||
}
|
||||
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\bin\x86")
|
||||
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\bin\amd64")
|
||||
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\WebApp\bin\x86")
|
||||
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\WebApp\bin\amd64")
|
||||
|
||||
# copy Belle
|
||||
Write-Host "Copy Belle"
|
||||
@@ -343,19 +323,6 @@
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI\wwwroot\umbraco\js", "*", "$tmp\WebApp\wwwroot\umbraco\js")
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI\wwwroot\umbraco\lib", "*", "$tmp\WebApp\wwwroot\umbraco\lib")
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI\wwwroot\umbraco\views", "*", "$tmp\WebApp\wwwroot\umbraco\views")
|
||||
|
||||
|
||||
|
||||
# Prepare templates
|
||||
Write-Host "Copy template files"
|
||||
$this.CopyFiles("$templates", "*", "$tmp\Templates")
|
||||
|
||||
Write-Host "Copy files for dotnet templates"
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI", "Program.cs", "$tmp\Templates\UmbracoProject")
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI", "Startup.cs", "$tmp\Templates\UmbracoProject")
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI\Views", "*", "$tmp\Templates\UmbracoProject\Views")
|
||||
|
||||
$this.RemoveDirectory("$tmp\Templates\UmbracoProject\bin")
|
||||
})
|
||||
|
||||
|
||||
@@ -389,7 +356,7 @@
|
||||
{
|
||||
Write-Host "Restore NuGet"
|
||||
Write-Host "Logging to $($this.BuildTemp)\nuget.restore.log"
|
||||
$params = "-Source", $nugetsourceUmbraco
|
||||
$params = "-Source", $nugetsourceUmbraco
|
||||
&$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\umbraco-netcore-only.sln" > "$($this.BuildTemp)\nuget.restore.log" @params
|
||||
if (-not $?) { throw "Failed to restore NuGet packages." }
|
||||
})
|
||||
@@ -397,7 +364,7 @@
|
||||
$ubuild.DefineMethod("PackageNuGet",
|
||||
{
|
||||
$nuspecs = "$($this.SolutionRoot)\build\NuSpecs"
|
||||
$templates = "$($this.BuildTemp)\Templates"
|
||||
$templates = "$($this.SolutionRoot)\templates"
|
||||
|
||||
Write-Host "Create NuGet packages"
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata minClientVersion="4.1.0">
|
||||
<id>Umbraco.Templates</id>
|
||||
<version>1.0.0</version>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<license type="expression">MIT</license>
|
||||
<projectUrl>https://umbraco.com/</projectUrl>
|
||||
<iconUrl>https://umbraco.com/dist/nuget/logo-small.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Umbraco Cms templates for .NET Core Template Engine available through the dotnet CLI's new command</description>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<repository type="git" url="https://github.com/umbraco/umbraco-cms" />
|
||||
<packageTypes>
|
||||
<packageType name="Template" />
|
||||
</packageTypes>
|
||||
</metadata>
|
||||
</package>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/dotnetcli.host",
|
||||
"symbolInfo": {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/vs-2017.3.host",
|
||||
"order" : 0,
|
||||
"icon": "icon.png",
|
||||
"description": {
|
||||
"id": "UmbracoPackage",
|
||||
"text": "Umbraco Package - An empty Umbraco CMS package (Plugin)"
|
||||
},
|
||||
"symbolInfo": [
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/template",
|
||||
"author": "Umbraco HQ",
|
||||
"description": "An empty Umbraco Package/Plugin ready to get started",
|
||||
"classifications": [ "Web", "CMS", "Umbraco", "Package", "Plugin"],
|
||||
"groupIdentity": "Umbraco.Templates.UmbracoPackage",
|
||||
"identity": "Umbraco.Templates.UmbracoPackage.CSharp",
|
||||
"name": "Umbraco Package",
|
||||
"shortName": "umbracopackage",
|
||||
"defaultName": "UmbracoPackage1",
|
||||
"preferNameDirectory": true,
|
||||
"tags": {
|
||||
"language": "C#",
|
||||
"type": "project"
|
||||
},
|
||||
"primaryOutputs": [
|
||||
{
|
||||
"path": "UmbracoPackage.csproj"
|
||||
}
|
||||
],
|
||||
"sourceName": "UmbracoPackage",
|
||||
"preferNameDirectory": true,
|
||||
"symbols": {
|
||||
"version": {
|
||||
"type": "parameter",
|
||||
"datatype": "string",
|
||||
"defaultValue": "9.3.0",
|
||||
"description": "The version of Umbraco to load using NuGet",
|
||||
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
|
||||
},
|
||||
"namespaceReplacer": {
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "UmbracoPackage",
|
||||
"parameters": {
|
||||
"source": "name",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\s",
|
||||
"replacement": "_"
|
||||
},
|
||||
{
|
||||
"regex": "-",
|
||||
"replacement": "_"
|
||||
},
|
||||
{
|
||||
"regex": "^[^a-zA-Z_]+",
|
||||
"replacement": "_"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"msbuildReplacer": {
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "UmbracoPackageMsBuild",
|
||||
"parameters": {
|
||||
"source": "name",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\s",
|
||||
"replacement": ""
|
||||
},
|
||||
{
|
||||
"regex": "\\.",
|
||||
"replacement": ""
|
||||
},
|
||||
{
|
||||
"regex": "-",
|
||||
"replacement": ""
|
||||
},
|
||||
{
|
||||
"regex": "^[^a-zA-Z_]+",
|
||||
"replacement": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Framework": {
|
||||
"type": "parameter",
|
||||
"description": "The target framework for the project.",
|
||||
"datatype": "choice",
|
||||
"choices": [
|
||||
{
|
||||
"choice": "net5.0",
|
||||
"description": "Target net5.0"
|
||||
},
|
||||
{
|
||||
"choice": "net6.0",
|
||||
"description": "Target net6.0"
|
||||
}
|
||||
],
|
||||
"replaces": "net5.0",
|
||||
"defaultValue": "net5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
{
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/dotnetcli.host",
|
||||
"symbolInfo": {
|
||||
"PackageTestSiteName": {
|
||||
"longName": "PackageTestSiteName",
|
||||
"shortName": "p"
|
||||
},
|
||||
"UseSqlCe": {
|
||||
"longName": "SqlCe",
|
||||
"shortName": "ce"
|
||||
},
|
||||
"SkipRestore": {
|
||||
"longName": "no-restore",
|
||||
"shortName": ""
|
||||
},
|
||||
"FriendlyName": {
|
||||
"longName": "friendly-name",
|
||||
"shortName": ""
|
||||
},
|
||||
"Email": {
|
||||
"longName": "email",
|
||||
"shortName": ""
|
||||
},
|
||||
"Password": {
|
||||
"longName": "password",
|
||||
"shortName": ""
|
||||
},
|
||||
"ConnectionString":{
|
||||
"longName": "connection-string",
|
||||
"shortName": ""
|
||||
},
|
||||
"NoNodesViewPath":{
|
||||
"longName": "no-nodes-view-path",
|
||||
"shortName": ""
|
||||
},
|
||||
"UseHttpsRedirect": {
|
||||
"longName": "use-https-redirect",
|
||||
"shortName": ""
|
||||
}
|
||||
},
|
||||
"usageExamples": [
|
||||
"dotnet new umbraco -n MyNewProject",
|
||||
"dotnet new umbraco -n MyNewProjectWithCE -ce",
|
||||
"dotnet new umbraco -n MyNewProject --no-restore",
|
||||
"dotnet new umbraco -n MyNewProject --friendly-name \"Friendly User\" --email user@email.com --password password1234 --connection-string \"Server=ConnectionStringHere\""
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
@@ -1,74 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/vs-2017.3.host",
|
||||
"order" : 0,
|
||||
"icon": "icon.png",
|
||||
"description": {
|
||||
"id": "UmbracoProject",
|
||||
"text": "Umbraco Web Application - An empty Umbraco CMS web application"
|
||||
},
|
||||
"symbolInfo": [
|
||||
{
|
||||
"id": "UseSqlCe",
|
||||
"name": {
|
||||
"text": "Use Sql Compact Edition (SqlCE)"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "SkipRestore",
|
||||
"name": {
|
||||
"text": "Skips the automatic NuGet restore of the project on create"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "PackageTestSiteName",
|
||||
"name": {
|
||||
"text": "Optional: Specify the name of a package that this should be a test site for"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "FriendlyName",
|
||||
"name": {
|
||||
"text": "Optional: The friendly name of the user for Umbraco login when using Unattended install"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "Email",
|
||||
"name": {
|
||||
"text": "Optional: Email to use for Umbraco login when using Unattended install"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "Password",
|
||||
"name": {
|
||||
"text": "Optional: Password to use for Umbraco login when using Unattended install"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "ConnectionString",
|
||||
"name": {
|
||||
"text": "Optional: Database connection string when using Unattended install"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "NoNodesViewPath",
|
||||
"name": {
|
||||
"text": "Optional: Path to a custom view presented with the Umbraco installation contains no published content"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "UseHttpsRedirect",
|
||||
"name": {
|
||||
"text": "Optional: Adds code to Startup.cs to redirect HTTP to HTTPS and enables the UseHttps setting."
|
||||
},
|
||||
"isVisible": "true"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,304 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/template",
|
||||
"author": "Umbraco HQ",
|
||||
"description": "An empty Umbraco Project ready to get started",
|
||||
"classifications": [ "Web", "CMS", "Umbraco"],
|
||||
"groupIdentity": "Umbraco.Templates.UmbracoProject",
|
||||
"identity": "Umbraco.Templates.UmbracoProject.CSharp",
|
||||
"name": "Umbraco Project",
|
||||
"shortName": "umbraco",
|
||||
"defaultName": "UmbracoProject1",
|
||||
"preferNameDirectory": true,
|
||||
"tags": {
|
||||
"language": "C#",
|
||||
"type": "project"
|
||||
},
|
||||
"primaryOutputs": [
|
||||
{
|
||||
"path": "UmbracoProject.csproj"
|
||||
}
|
||||
],
|
||||
"postActions": [
|
||||
{
|
||||
"condition": "(!SkipRestore)",
|
||||
"description": "Restore NuGet packages required by this project",
|
||||
"manualInstructions": [{
|
||||
"text": "Run 'dotnet restore'"
|
||||
}],
|
||||
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
|
||||
"continueOnError": true
|
||||
}
|
||||
],
|
||||
"sourceName": "UmbracoProject",
|
||||
"symbols": {
|
||||
"namespaceReplacer": {
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "Umbraco.Cms.Web.UI",
|
||||
"parameters": {
|
||||
"source": "name",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\s",
|
||||
"replacement": "_"
|
||||
},
|
||||
{
|
||||
"regex": "-",
|
||||
"replacement": "_"
|
||||
},
|
||||
{
|
||||
"regex": "^[^a-zA-Z_]+",
|
||||
"replacement": "_"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": {
|
||||
"type": "parameter",
|
||||
"datatype": "string",
|
||||
"defaultValue": "9.3.0",
|
||||
"description": "The version of Umbraco to load using NuGet",
|
||||
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
|
||||
},
|
||||
"PackageTestSiteName": {
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"defaultValue": "",
|
||||
"replaces":"PackageTestSiteName",
|
||||
"description": "The name of the package this should be a test site for (Default: '')"
|
||||
},
|
||||
"UseSqlCe":{
|
||||
"type": "parameter",
|
||||
"datatype":"bool",
|
||||
"defaultValue": "false",
|
||||
"description": "Adds the required dependencies to use SqlCE (Windows only) (Default: false)"
|
||||
},
|
||||
"Framework": {
|
||||
"type": "parameter",
|
||||
"description": "The target framework for the project",
|
||||
"datatype": "choice",
|
||||
"choices": [
|
||||
{
|
||||
"choice": "net5.0",
|
||||
"description": "Target net5.0"
|
||||
},
|
||||
{
|
||||
"choice": "net6.0",
|
||||
"description": "Target net6.0"
|
||||
}
|
||||
],
|
||||
"replaces": "net5.0",
|
||||
"defaultValue": "net5.0"
|
||||
},
|
||||
"SkipRestore": {
|
||||
"type": "parameter",
|
||||
"datatype": "bool",
|
||||
"description": "If specified, skips the automatic restore of the project on create",
|
||||
"defaultValue": "false"
|
||||
},
|
||||
"HttpPort": {
|
||||
"type": "generated",
|
||||
"generator": "port",
|
||||
"replaces": "HTTP_PORT_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"high": 65535,
|
||||
"low": 1024,
|
||||
"fallback": 5000
|
||||
}
|
||||
},
|
||||
"HttpsPort": {
|
||||
"type": "generated",
|
||||
"generator": "port",
|
||||
"replaces": "HTTPS_PORT_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"low": 44300,
|
||||
"high": 44399,
|
||||
"fallback": 5001
|
||||
}
|
||||
},
|
||||
"FriendlyName":{
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"description": "The friendly name of the user for Umbraco login when using Unattended install (Without installer wizard UI)",
|
||||
"defaultValue": ""
|
||||
},
|
||||
"FriendlyNameReplaced":{
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "FRIENDLY_NAME_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"source": "FriendlyName",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\\\",
|
||||
"replacement": "\\\\"
|
||||
},
|
||||
{
|
||||
"regex": "\\\"",
|
||||
"replacement": "\\\""
|
||||
},
|
||||
{
|
||||
"regex": "\\\n",
|
||||
"replacement": "\\\n"
|
||||
},
|
||||
{
|
||||
"regex": "\\\t",
|
||||
"replacement": "\\\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Email":{
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"description": "Email to use for Umbraco login when using Unattended install (Without installer wizard UI)",
|
||||
"defaultValue": ""
|
||||
},
|
||||
"EmailReplaced":{
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "EMAIL_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"source": "Email",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\\\",
|
||||
"replacement": "\\\\"
|
||||
},
|
||||
{
|
||||
"regex": "\\\"",
|
||||
"replacement": "\\\""
|
||||
},
|
||||
{
|
||||
"regex": "\\\n",
|
||||
"replacement": "\\\n"
|
||||
},
|
||||
{
|
||||
"regex": "\\\t",
|
||||
"replacement": "\\\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Password":{
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"description": "Password to use for Umbraco login when using Unattended install (Without installer wizard UI)",
|
||||
"defaultValue": ""
|
||||
},
|
||||
"PasswordReplaced":{
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "PASSWORD_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"source": "Password",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\\\",
|
||||
"replacement": "\\\\"
|
||||
},
|
||||
{
|
||||
"regex": "\\\"",
|
||||
"replacement": "\\\""
|
||||
},
|
||||
{
|
||||
"regex": "\\\n",
|
||||
"replacement": "\\\n"
|
||||
},
|
||||
{
|
||||
"regex": "\\\t",
|
||||
"replacement": "\\\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"ConnectionString":{
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"description": "Database connection string when using Unattended install (Without installer wizard UI)",
|
||||
"defaultValue": ""
|
||||
},
|
||||
"ConnectionStringReplaced":{
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "CONNECTION_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"source": "ConnectionString",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\\\",
|
||||
"replacement": "\\\\"
|
||||
},
|
||||
{
|
||||
"regex": "\\\"",
|
||||
"replacement": "\\\""
|
||||
},
|
||||
{
|
||||
"regex": "\\\n",
|
||||
"replacement": "\\\n"
|
||||
},
|
||||
{
|
||||
"regex": "\\\t",
|
||||
"replacement": "\\\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"NoNodesViewPath":{
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"description": "Path to a custom view presented with the Umbraco installation contains no published content",
|
||||
"defaultValue": ""
|
||||
},
|
||||
"NoNodesViewPathReplaced":{
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "NO_NODES_VIEW_PATH_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"source": "NoNodesViewPath",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\\\",
|
||||
"replacement": "\\\\"
|
||||
},
|
||||
{
|
||||
"regex": "\\\"",
|
||||
"replacement": "\\\""
|
||||
},
|
||||
{
|
||||
"regex": "\\\n",
|
||||
"replacement": "\\\n"
|
||||
},
|
||||
{
|
||||
"regex": "\\\t",
|
||||
"replacement": "\\\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"HasConnectionString":{
|
||||
"type": "computed",
|
||||
"value": "(ConnectionString != \"\")"
|
||||
},
|
||||
"HasNoNodesViewPath":{
|
||||
"type": "computed",
|
||||
"value": "(NoNodesViewPath != \"\")"
|
||||
},
|
||||
"UsingUnattenedInstall":{
|
||||
"type": "computed",
|
||||
"value": "(FriendlyName != \"\" && Email != \"\" && Password != \"\" && ConnectionString != \"\")"
|
||||
},
|
||||
"UseHttpsRedirect":{
|
||||
"type": "parameter",
|
||||
"datatype":"bool",
|
||||
"defaultValue": "false",
|
||||
"description": "Adds code to Startup.cs to redirect HTTP to HTTPS and enables the UseHttps setting (Default: false)"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
@using Umbraco.Web.UI
|
||||
@using Umbraco.Extensions
|
||||
@using Umbraco.Web.PublishedModels
|
||||
@using Umbraco.Cms.Core.Models.PublishedContent
|
||||
@using Microsoft.AspNetCore.Html
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@addTagHelper *, Smidge
|
||||
@inject Smidge.SmidgeHelper SmidgeHelper
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RuleSet Name="CodeAnalysis" ToolsVersion="16.0">
|
||||
<Rules AnalyzerId="Roslynator.CSharp.Analyzers" RuleNamespace="Roslynator.CSharp">
|
||||
<Rule Id="RCS1090" Action="None" />
|
||||
</Rules>
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
|
||||
<Rule Id="SA1101" Action="None" />
|
||||
<Rule Id="SA1200" Action="None" />
|
||||
<Rule Id="SA1308" Action="None" />
|
||||
<Rule Id="SA1309" Action="None" />
|
||||
<Rule Id="SA1311" Action="None" />
|
||||
<Rule Id="SA1402" Action="None" />
|
||||
<Rule Id="SA1413" Action="None" />
|
||||
<Rule Id="SA1611" Action="None" />
|
||||
<Rule Id="SA1615" Action="None" />
|
||||
<Rule Id="SA1629" Action="None" />
|
||||
</Rules>
|
||||
</RuleSet>
|
||||
@@ -15,8 +15,8 @@
|
||||
<div class="level{{item.level}}"><span class="xref">{{item.name.0.value}}</span></div>
|
||||
</div>
|
||||
{{/inheritance.0}}
|
||||
<h6><strong>{{__global.namespace}}</strong>:{{namespace}}</h6>
|
||||
<h6><strong>{{__global.assembly}}</strong>:{{assemblies.0}}.dll</h6>
|
||||
<h6><strong>{{__global.namespace}}</strong>: {{{namespace.specName.0.value}}}</h6>
|
||||
<h6><strong>{{__global.assembly}}</strong>: {{assemblies.0}}.dll</h6>
|
||||
<h5 id="{{id}}_syntax">{{__global.syntax}}</h5>
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-{{_lang}} hljs">{{syntax.content.0.value}}</code></pre>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<Project>
|
||||
<Project>
|
||||
<!-- Enable multi-level merging -->
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>9.3.0</Version>
|
||||
<AssemblyVersion>9.3.0</AssemblyVersion>
|
||||
<InformationalVersion>9.3.0</InformationalVersion>
|
||||
<FileVersion>9.3.0</FileVersion>
|
||||
<Version>9.5.2</Version>
|
||||
<AssemblyVersion>9.5.2</AssemblyVersion>
|
||||
<InformationalVersion>9.5.2</InformationalVersion>
|
||||
<FileVersion>9.5.2</FileVersion>
|
||||
<LangVersion Condition="'$(LangVersion)' == ''">9.0</LangVersion>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<Company>Umbraco CMS</Company>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
using Umbraco.Cms.Core.Configuration;
|
||||
using Umbraco.Cms.Core.Configuration.Models;
|
||||
using Umbraco.Deploy.Core.Configuration.DebugConfiguration;
|
||||
using Umbraco.Deploy.Core.Configuration.DeployConfiguration;
|
||||
using Umbraco.Deploy.Core.Configuration.DeployProjectConfiguration;
|
||||
using Umbraco.Forms.Core.Configuration;
|
||||
@@ -91,6 +92,8 @@ namespace JsonSchema
|
||||
public ContentDashboardSettings ContentDashboard { get; set; }
|
||||
|
||||
public HelpPageSettings HelpPage { get; set; }
|
||||
|
||||
public InstallDefaultDataSettings DefaultDataCreation { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -127,6 +130,8 @@ namespace JsonSchema
|
||||
public DeploySettings Settings { get; set; }
|
||||
|
||||
public DeployProjectConfig Project { get; set; }
|
||||
|
||||
public DebugSettings Debug { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,32 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.8.0" />
|
||||
<PackageReference Include="NJsonSchema" Version="10.5.2" />
|
||||
<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
|
||||
<PackageReference Include="Umbraco.Deploy.Core" Version="9.2.0" />
|
||||
<PackageReference Include="Umbraco.Forms.Core" Version="9.2.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.8.0" />
|
||||
<PackageReference Include="NJsonSchema" Version="10.5.2" />
|
||||
<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
|
||||
<PackageReference Include="Umbraco.Deploy.Core" Version="9.2.0" />
|
||||
<PackageReference Include="Umbraco.Forms.Core" Version="9.2.0" />
|
||||
<PackageReference Include="Umbraco.Deploy.Core" Version="9.4.0" />
|
||||
<PackageReference Include="Umbraco.Forms.Core" Version="9.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Copy forms xml docs-->
|
||||
<!-- Copy Forms XML docs-->
|
||||
<PropertyGroup>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -46,6 +46,11 @@ namespace Umbraco.Cms.Core.Cache
|
||||
{
|
||||
var payloads = Deserialize(json);
|
||||
|
||||
Refresh(payloads);
|
||||
}
|
||||
|
||||
public override void Refresh(JsonPayload[] payloads)
|
||||
{
|
||||
foreach (var payload in payloads)
|
||||
{
|
||||
foreach (var alias in GetCacheKeysForAlias(payload.Alias))
|
||||
@@ -55,11 +60,13 @@ namespace Umbraco.Cms.Core.Cache
|
||||
if (macroRepoCache)
|
||||
{
|
||||
macroRepoCache.Result.Clear(RepositoryCacheKeys.GetKey<IMacro, int>(payload.Id));
|
||||
macroRepoCache.Result.Clear(RepositoryCacheKeys.GetKey<IMacro, string>(payload.Alias)); // Repository caching of macro definition by alias
|
||||
}
|
||||
}
|
||||
|
||||
base.Refresh(json);
|
||||
base.Refresh(payloads);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Json
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace Umbraco.Cms.Core.Composing
|
||||
IEnumerable<Assembly> assemblies = null,
|
||||
bool onlyConcreteClasses = true)
|
||||
{
|
||||
var assemblyList = (assemblies ?? AssembliesToScan).ToList();
|
||||
var assemblyList = assemblies ?? AssembliesToScan;
|
||||
|
||||
return GetClassesWithBaseType(assignTypeFrom, assemblyList, onlyConcreteClasses,
|
||||
//the additional filter will ensure that any found types also have the attribute applied.
|
||||
@@ -214,7 +214,7 @@ namespace Umbraco.Cms.Core.Composing
|
||||
/// <returns></returns>
|
||||
public IEnumerable<Type> FindClassesOfType(Type assignTypeFrom, IEnumerable<Assembly> assemblies = null, bool onlyConcreteClasses = true)
|
||||
{
|
||||
var assemblyList = (assemblies ?? AssembliesToScan).ToList();
|
||||
var assemblyList = assemblies ?? AssembliesToScan;
|
||||
|
||||
return GetClassesWithBaseType(assignTypeFrom, assemblyList, onlyConcreteClasses);
|
||||
}
|
||||
@@ -231,7 +231,7 @@ namespace Umbraco.Cms.Core.Composing
|
||||
IEnumerable<Assembly> assemblies = null,
|
||||
bool onlyConcreteClasses = true)
|
||||
{
|
||||
var assemblyList = (assemblies ?? AssembliesToScan).ToList();
|
||||
var assemblyList = assemblies ?? AssembliesToScan;
|
||||
|
||||
return GetClassesWithAttribute(attributeType, assemblyList, onlyConcreteClasses);
|
||||
}
|
||||
|
||||
@@ -156,6 +156,9 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
internal const bool StaticShowDeprecatedPropertyEditors = false;
|
||||
internal const string StaticLoginBackgroundImage = "assets/img/login.jpg";
|
||||
internal const string StaticLoginLogoImage = "assets/img/application/umbraco_logo_white.svg";
|
||||
internal const bool StaticHideBackOfficeLogo = false;
|
||||
internal const bool StaticDisableDeleteWhenReferenced = false;
|
||||
internal const bool StaticDisableUnpublishWhenReferenced = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value for the content notification settings.
|
||||
@@ -219,6 +222,24 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
[DefaultValue(StaticLoginLogoImage)]
|
||||
public string LoginLogoImage { get; set; } = StaticLoginLogoImage;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to hide the backoffice umbraco logo or not.
|
||||
/// </summary>
|
||||
[DefaultValue(StaticHideBackOfficeLogo)]
|
||||
public bool HideBackOfficeLogo { get; set; } = StaticHideBackOfficeLogo;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to disable the deletion of items referenced by other items.
|
||||
/// </summary>
|
||||
[DefaultValue(StaticDisableDeleteWhenReferenced)]
|
||||
public bool DisableDeleteWhenReferenced { get; set; } = StaticDisableDeleteWhenReferenced;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to disable the unpublishing of items referenced by other items.
|
||||
/// </summary>
|
||||
[DefaultValue(StaticDisableUnpublishWhenReferenced)]
|
||||
public bool DisableUnpublishWhenReferenced { get; set; } = StaticDisableUnpublishWhenReferenced;
|
||||
|
||||
/// <summary>
|
||||
/// Get or sets the model representing the global content version cleanup policy
|
||||
/// </summary>
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
internal const bool StaticHideTopLevelNodeFromPath = true;
|
||||
internal const bool StaticUseHttps = false;
|
||||
internal const int StaticVersionCheckPeriod = 7;
|
||||
internal const string StaticUmbracoPath = "~/umbraco";
|
||||
internal const string StaticUmbracoPath = Constants.System.DefaultUmbracoPath;
|
||||
internal const string StaticIconsPath = "~/umbraco/assets/icons";
|
||||
internal const string StaticUmbracoCssPath = "~/css";
|
||||
internal const string StaticUmbracoScriptsPath = "~/scripts";
|
||||
@@ -29,6 +29,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
internal const string StaticNoNodesViewPath = "~/umbraco/UmbracoWebsite/NoNodes.cshtml";
|
||||
internal const string StaticSqlWriteLockTimeOut = "00:00:05";
|
||||
internal const bool StaticSanitizeTinyMce = false;
|
||||
internal const int StaticMainDomReleaseSignalPollingInterval = 2000;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value for the reserved URLs (must end with a comma).
|
||||
@@ -137,6 +138,26 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
/// </summary>
|
||||
public string MainDomLock { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value to discriminate MainDom boundaries.
|
||||
/// <para>
|
||||
/// Generally the default should suffice but useful for advanced scenarios e.g. azure deployment slot based zero downtime deployments.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public string MainDomKeyDiscriminator { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration (in milliseconds) for which the MainDomLock release signal polling task should sleep.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Doesn't apply to MainDomSemaphoreLock.
|
||||
/// <para>
|
||||
/// The default value is 2000ms.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[DefaultValue(StaticMainDomReleaseSignalPollingInterval)]
|
||||
public int MainDomReleaseSignalPollingInterval { get; set; } = StaticMainDomReleaseSignalPollingInterval;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the telemetry ID.
|
||||
/// </summary>
|
||||
@@ -174,18 +195,18 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
public bool IsPickupDirectoryLocationConfigured => !string.IsNullOrWhiteSpace(Smtp?.PickupDirectoryLocation);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether TinyMCE scripting sanitization should be applied.
|
||||
/// Gets or sets a value indicating whether TinyMCE scripting sanitization should be applied.
|
||||
/// </summary>
|
||||
[DefaultValue(StaticSanitizeTinyMce)]
|
||||
public bool SanitizeTinyMce => StaticSanitizeTinyMce;
|
||||
public bool SanitizeTinyMce { get; set; } = StaticSanitizeTinyMce;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value representing the time in milliseconds to lock the database for a write operation.
|
||||
/// An int value representing the time in milliseconds to lock the database for a write operation
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The default value is 5000 milliseconds.
|
||||
/// </remarks>
|
||||
[DefaultValue(StaticSqlWriteLockTimeOut)]
|
||||
public TimeSpan SqlWriteLockTimeOut { get; } = TimeSpan.Parse(StaticSqlWriteLockTimeOut);
|
||||
public TimeSpan SqlWriteLockTimeOut { get; set; } = TimeSpan.Parse(StaticSqlWriteLockTimeOut);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
/// <summary>
|
||||
/// Gets or sets a value for the location of temporary files.
|
||||
/// </summary>
|
||||
[DefaultValue(StaticLocalTempStorageLocation)]
|
||||
[DefaultValue(StaticLocalTempStorageLocation)]
|
||||
public LocalTempStorage LocalTempStorageLocation { get; set; } = Enum<LocalTempStorage>.Parse(StaticLocalTempStorageLocation);
|
||||
|
||||
/// <summary>
|
||||
@@ -31,5 +31,10 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
/// <value><c>true</c> if [debug mode]; otherwise, <c>false</c>.</value>
|
||||
[DefaultValue(StaticDebug)]
|
||||
public bool Debug { get; set; } = StaticDebug;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value specifying the name of the site.
|
||||
/// </summary>
|
||||
public string SiteName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Cms.Core.Configuration.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// An enumeration of options available for control over installation of default Umbraco data.
|
||||
/// </summary>
|
||||
public enum InstallDefaultDataOption
|
||||
{
|
||||
/// <summary>
|
||||
/// Do not install any items of this type (other than Umbraco defined essential ones).
|
||||
/// </summary>
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// Only install the default data specified in the <see cref="InstallDefaultDataSettings.Values"/>
|
||||
/// </summary>
|
||||
Values,
|
||||
|
||||
/// <summary>
|
||||
/// Install all default data, except that specified in the <see cref="InstallDefaultDataSettings.Values"/>
|
||||
/// </summary>
|
||||
ExceptValues,
|
||||
|
||||
/// <summary>
|
||||
/// Install all default data.
|
||||
/// </summary>
|
||||
All
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Typed configuration options for installation of default data.
|
||||
/// </summary>
|
||||
public class InstallDefaultDataSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to create default data on installation.
|
||||
/// </summary>
|
||||
public InstallDefaultDataOption InstallData { get; set; } = InstallDefaultDataOption.All;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating which default data (languages, data types, etc.) should be created when <see cref="InstallData"/> is
|
||||
/// set to <see cref="InstallDefaultDataOption.Values"/> or <see cref="InstallDefaultDataOption.ExceptValues"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// For languages, the values provided should be the ISO codes for the languages to be included or excluded, e.g. "en-US".
|
||||
/// If removing the single default language, ensure that a different one is created via some other means (such
|
||||
/// as a restore from Umbraco Deploy schema data).
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// For data types, the values provided should be the Guid values used by Umbraco for the data type, listed at:
|
||||
/// <see cref="Constants.DataTypes"/>
|
||||
/// Some data types - such as the string label - cannot be excluded from install as they are required for core Umbraco
|
||||
/// functionality.
|
||||
/// Otherwise take care not to remove data types required for default Umbraco media and member types, unless you also
|
||||
/// choose to exclude them.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// For media types, the values provided should be the Guid values used by Umbraco for the media type, listed at:
|
||||
/// https://github.com/umbraco/Umbraco-CMS/blob/v9/dev/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// For member types, the values provided should be the Guid values used by Umbraco for the member type, listed at:
|
||||
/// https://github.com/umbraco/Umbraco-CMS/blob/v9/dev/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public IList<string> Values { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
public class KeepAliveSettings
|
||||
{
|
||||
internal const bool StaticDisableKeepAliveTask = false;
|
||||
internal const string StaticKeepAlivePingUrl = "~/api/keepalive/ping";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the keep alive task is disabled.
|
||||
@@ -20,8 +21,9 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
public bool DisableKeepAliveTask { get; set; } = StaticDisableKeepAliveTask;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value for the keep alive ping URL.
|
||||
/// Gets or sets a value for the keep alive ping URL.
|
||||
/// </summary>
|
||||
public string KeepAlivePingUrl => "~/api/keepalive/ping";
|
||||
[DefaultValue(StaticKeepAlivePingUrl)]
|
||||
public string KeepAlivePingUrl { get; set; } = StaticKeepAlivePingUrl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,17 +42,17 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
/// </remarks>
|
||||
public bool FlagOutOfDateModels
|
||||
{
|
||||
get => _flagOutOfDateModels;
|
||||
|
||||
set
|
||||
get
|
||||
{
|
||||
if (!ModelsMode.IsAuto())
|
||||
if (ModelsMode == ModelsMode.Nothing || ModelsMode.IsAuto())
|
||||
{
|
||||
_flagOutOfDateModels = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
_flagOutOfDateModels = value;
|
||||
return _flagOutOfDateModels;
|
||||
}
|
||||
|
||||
set => _flagOutOfDateModels = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
{
|
||||
internal const string StaticNuCacheSerializerType = "MessagePack";
|
||||
internal const int StaticSqlPageSize = 1000;
|
||||
internal const int StaticKitBatchSize = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value defining the BTree block size.
|
||||
@@ -31,6 +32,12 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
[DefaultValue(StaticSqlPageSize)]
|
||||
public int SqlPageSize { get; set; } = StaticSqlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// The size to use for nucache Kit batches. Higher value means more content loaded into memory at a time.
|
||||
/// </summary>
|
||||
[DefaultValue(StaticKitBatchSize)]
|
||||
public int KitBatchSize { get; set; } = StaticKitBatchSize;
|
||||
|
||||
public bool UnPublishedContentCompression { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
[UmbracoOptions(Constants.Configuration.ConfigRichTextEditor)]
|
||||
public class RichTextEditorSettings
|
||||
{
|
||||
internal const string StaticValidElements = "+a[id|style|rel|data-id|data-udi|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],small[class|style],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*]";
|
||||
internal const string StaticValidElements = "+a[id|style|rel|data-id|data-udi|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],small[class|style],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*],figure,figcaption";
|
||||
internal const string StaticInvalidElements = "font";
|
||||
|
||||
private static readonly string[] s_default_plugins = new[]
|
||||
|
||||
@@ -56,6 +56,21 @@ namespace Umbraco.Cms.Core
|
||||
public const string ConfigPackageMigration = ConfigPrefix + "PackageMigration";
|
||||
public const string ConfigContentDashboard = ConfigPrefix + "ContentDashboard";
|
||||
public const string ConfigHelpPage = ConfigPrefix + "HelpPage";
|
||||
public const string ConfigInstallDefaultData = ConfigPrefix + "InstallDefaultData";
|
||||
|
||||
public static class NamedOptions
|
||||
{
|
||||
public static class InstallDefaultData
|
||||
{
|
||||
public const string Languages = "Languages";
|
||||
|
||||
public const string DataTypes = "DataTypes";
|
||||
|
||||
public const string MediaTypes = "MediaTypes";
|
||||
|
||||
public const string MemberTypes = "MemberTypes";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +211,6 @@ namespace Umbraco.Cms.Core
|
||||
/// </summary>
|
||||
public static readonly Guid ListViewMembersGuid = new Guid(ListViewMembers);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Guid for Date Picker with time as string
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace Umbraco.Cms.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines constants.
|
||||
/// </summary>
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines constants for named http clients.
|
||||
/// </summary>
|
||||
public static class HttpClients
|
||||
{
|
||||
/// <summary>
|
||||
/// Name for http client which ignores certificate errors.
|
||||
/// </summary>
|
||||
public const string IgnoreCertificateErrors = "Umbraco:HttpClients:IgnoreCertificateErrors";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Umbraco.Cms.Core
|
||||
namespace Umbraco.Cms.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
{
|
||||
@@ -9,6 +9,11 @@
|
||||
/// </summary>
|
||||
public const string DefaultIcon = Content;
|
||||
|
||||
/// <summary>
|
||||
/// System blueprint icon
|
||||
/// </summary>
|
||||
public const string Blueprint = "icon-blueprint";
|
||||
|
||||
/// <summary>
|
||||
/// System content icon
|
||||
/// </summary>
|
||||
|
||||
@@ -59,7 +59,9 @@
|
||||
public const string RecycleBinMediaPathPrefix = "-1,-21,";
|
||||
|
||||
public const int DefaultLabelDataTypeId = -92;
|
||||
public const string UmbracoConnectionName = "umbracoDbDSN";
|
||||
public const string UmbracoConnectionName = "umbracoDbDSN";
|
||||
|
||||
public const string DefaultUmbracoPath = "~/umbraco";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Cms.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
@@ -42,9 +44,11 @@ namespace Umbraco.Cms.Core
|
||||
public const string Install = "~/install";
|
||||
|
||||
public const string AppPlugins = "/App_Plugins";
|
||||
public static string AppPluginIcons => "/Backoffice/Icons";
|
||||
public const string CreatedPackages = "/created-packages";
|
||||
|
||||
[Obsolete("Use PluginIcons instead")]
|
||||
public static string AppPluginIcons => "/Backoffice/Icons";
|
||||
|
||||
public const string PluginIcons = "/backoffice/icons";
|
||||
|
||||
public const string MvcViews = "~/Views";
|
||||
|
||||
@@ -54,6 +58,8 @@ namespace Umbraco.Cms.Core
|
||||
|
||||
public const string Packages = Data + "/packages";
|
||||
|
||||
public const string CreatedPackages = Data + "/CreatedPackages";
|
||||
|
||||
public const string Preview = Data + "/preview";
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace Umbraco.Cms.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
{
|
||||
public static class Telemetry
|
||||
{
|
||||
|
||||
public static string RootCount = "RootCount";
|
||||
public static string DomainCount = "DomainCount";
|
||||
public static string ExamineIndexCount = "ExamineIndexCount";
|
||||
public static string LanguageCount = "LanguageCount";
|
||||
public static string MacroCount = "MacroCount";
|
||||
public static string MediaCount = "MediaCount";
|
||||
public static string MemberCount = "MemberCount";
|
||||
public static string TemplateCount = "TemplateCount";
|
||||
public static string ContentCount = "ContentCount";
|
||||
public static string DocumentTypeCount = "DocumentTypeCount";
|
||||
public static string Properties = "Properties";
|
||||
public static string UserCount = "UserCount";
|
||||
public static string UserGroupCount = "UserGroupCount";
|
||||
public static string ServerOs = "ServerOs";
|
||||
public static string ServerFramework = "ServerFramework";
|
||||
public static string OsLanguage = "OsLanguage";
|
||||
public static string WebServer = "WebServer";
|
||||
public static string ModelsBuilderMode = "ModelBuilderMode";
|
||||
public static string CustomUmbracoPath = "CustomUmbracoPath";
|
||||
public static string AspEnvironment = "AspEnvironment";
|
||||
public static string IsDebug = "IsDebug";
|
||||
public static string DatabaseProvider = "DatabaseProvider";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.ContentEditing;
|
||||
using Umbraco.Cms.Core.Models.Membership;
|
||||
|
||||
namespace Umbraco.Cms.Core.ContentApps
|
||||
{
|
||||
internal class DictionaryContentAppFactory : IContentAppFactory
|
||||
{
|
||||
private const int Weight = -100;
|
||||
|
||||
private ContentApp _dictionaryApp;
|
||||
|
||||
public ContentApp GetContentAppFor(object source, IEnumerable<IReadOnlyUserGroup> userGroups)
|
||||
{
|
||||
switch (source)
|
||||
{
|
||||
case IDictionaryItem _:
|
||||
return _dictionaryApp ??= new ContentApp
|
||||
{
|
||||
Alias = "dictionaryContent",
|
||||
Name = "Content",
|
||||
Icon = "icon-document",
|
||||
View = "views/dictionary/views/content/content.html",
|
||||
Weight = Weight
|
||||
};
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Cms.Core.Dashboards
|
||||
{
|
||||
public class AnalyticsDashboard : IDashboard
|
||||
{
|
||||
public string Alias => "settingsAnalytics";
|
||||
|
||||
public string[] Sections => new [] { "settings" };
|
||||
|
||||
public string View => "views/dashboard/settings/analytics.html";
|
||||
|
||||
public IAccessRule[] AccessRules => Array.Empty<IAccessRule>();
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,8 @@ namespace Umbraco.Cms.Core.DependencyInjection
|
||||
.Append<ContentTypeListViewContentAppFactory>()
|
||||
.Append<ContentTypePermissionsContentAppFactory>()
|
||||
.Append<ContentTypeTemplatesContentAppFactory>()
|
||||
.Append<MemberEditorContentAppFactory>();
|
||||
.Append<MemberEditorContentAppFactory>()
|
||||
.Append<DictionaryContentAppFactory>();
|
||||
|
||||
// all built-in finders in the correct order,
|
||||
// devs can then modify this list on application startup
|
||||
@@ -117,7 +118,8 @@ namespace Umbraco.Cms.Core.DependencyInjection
|
||||
.Append<Soundcloud>()
|
||||
.Append<Issuu>()
|
||||
.Append<Hulu>()
|
||||
.Append<Giphy>();
|
||||
.Append<Giphy>()
|
||||
.Append<LottieFiles>();
|
||||
builder.SearchableTrees().Add(() => builder.TypeLoader.GetTypes<ISearchableTree>());
|
||||
builder.BackOfficeAssets();
|
||||
}
|
||||
|
||||
@@ -90,6 +90,19 @@ namespace Umbraco.Cms.Core.DependencyInjection
|
||||
.AddUmbracoOptions<ContentDashboardSettings>()
|
||||
.AddUmbracoOptions<HelpPageSettings>();
|
||||
|
||||
builder.Services.Configure<InstallDefaultDataSettings>(
|
||||
Constants.Configuration.NamedOptions.InstallDefaultData.Languages,
|
||||
builder.Config.GetSection($"{Constants.Configuration.ConfigInstallDefaultData}:{Constants.Configuration.NamedOptions.InstallDefaultData.Languages}"));
|
||||
builder.Services.Configure<InstallDefaultDataSettings>(
|
||||
Constants.Configuration.NamedOptions.InstallDefaultData.DataTypes,
|
||||
builder.Config.GetSection($"{Constants.Configuration.ConfigInstallDefaultData}:{Constants.Configuration.NamedOptions.InstallDefaultData.DataTypes}"));
|
||||
builder.Services.Configure<InstallDefaultDataSettings>(
|
||||
Constants.Configuration.NamedOptions.InstallDefaultData.MediaTypes,
|
||||
builder.Config.GetSection($"{Constants.Configuration.ConfigInstallDefaultData}:{Constants.Configuration.NamedOptions.InstallDefaultData.MediaTypes}"));
|
||||
builder.Services.Configure<InstallDefaultDataSettings>(
|
||||
Constants.Configuration.NamedOptions.InstallDefaultData.MemberTypes,
|
||||
builder.Config.GetSection($"{Constants.Configuration.ConfigInstallDefaultData}:{Constants.Configuration.NamedOptions.InstallDefaultData.MemberTypes}"));
|
||||
|
||||
builder.Services.Configure<RequestHandlerSettings>(options => options.MergeReplacements(builder.Config));
|
||||
|
||||
return builder;
|
||||
|
||||
@@ -25,7 +25,7 @@ using Umbraco.Cms.Core.Install;
|
||||
using Umbraco.Cms.Core.IO;
|
||||
using Umbraco.Cms.Core.Logging;
|
||||
using Umbraco.Cms.Core.Mail;
|
||||
using Umbraco.Cms.Core.Manifest;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.PublishedContent;
|
||||
using Umbraco.Cms.Core.Notifications;
|
||||
using Umbraco.Cms.Core.PropertyEditors;
|
||||
@@ -39,7 +39,6 @@ using Umbraco.Cms.Core.Sync;
|
||||
using Umbraco.Cms.Core.Telemetry;
|
||||
using Umbraco.Cms.Core.Templates;
|
||||
using Umbraco.Cms.Core.Web;
|
||||
using Umbraco.Cms.Web.Common.DependencyInjection;
|
||||
using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Core.DependencyInjection
|
||||
@@ -182,7 +181,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
|
||||
Services.AddSingleton<UriUtility>();
|
||||
|
||||
Services.AddUnique<IDashboardService, DashboardService>();
|
||||
Services.AddUnique<IUserDataService, UserDataService>();
|
||||
Services.AddSingleton<IMetricsConsentService, MetricsConsentService>();
|
||||
|
||||
// will be injected in controllers when needed to invoke rest endpoints on Our
|
||||
Services.AddUnique<IInstallationService, InstallationService>();
|
||||
@@ -262,6 +261,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
|
||||
Services.AddSingleton<IValueEditorCache, ValueEditorCache>();
|
||||
|
||||
// Register telemetry service used to gather data about installed packages
|
||||
Services.AddUnique<ISiteIdentifierService, SiteIdentifierService>();
|
||||
Services.AddUnique<ITelemetryService, TelemetryService>();
|
||||
|
||||
// Register a noop IHtmlSanitizer to be replaced
|
||||
|
||||
@@ -33,7 +33,8 @@ namespace Umbraco.Cms.Core.Events
|
||||
Constants.Conventions.RelationTypes.RelateDocumentOnCopyName,
|
||||
true,
|
||||
Constants.ObjectTypes.Document,
|
||||
Constants.ObjectTypes.Document);
|
||||
Constants.ObjectTypes.Document,
|
||||
false);
|
||||
|
||||
_relationService.Save(relationType);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace Umbraco.Extensions
|
||||
}
|
||||
}
|
||||
|
||||
verifiedIdentity = identity.AuthenticationType == Constants.Security.BackOfficeAuthenticationType ? identity : new ClaimsIdentity(identity.Claims, Constants.Security.BackOfficeAuthenticationType);
|
||||
verifiedIdentity = identity.AuthenticationType == Constants.Security.BackOfficeAuthenticationType ? identity : new ClaimsIdentity(identity.Claims, Constants.Security.BackOfficeAuthenticationType);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -626,7 +626,6 @@ namespace Umbraco.Extensions
|
||||
if (type == typeof(sbyte)) return XmlConvert.ToString((sbyte)value);
|
||||
if (type == typeof(short)) return XmlConvert.ToString((short)value);
|
||||
if (type == typeof(TimeSpan)) return XmlConvert.ToString((TimeSpan)value);
|
||||
if (type == typeof(bool)) return XmlConvert.ToString((bool)value);
|
||||
if (type == typeof(uint)) return XmlConvert.ToString((uint)value);
|
||||
if (type == typeof(ulong)) return XmlConvert.ToString((ulong)value);
|
||||
if (type == typeof(ushort)) return XmlConvert.ToString((ushort)value);
|
||||
|
||||
@@ -1082,7 +1082,7 @@ namespace Umbraco.Extensions
|
||||
{
|
||||
return content.Parent != null
|
||||
? content.Parent.Children(variationContextAccessor, culture)
|
||||
: publishedSnapshot.Content.GetAtRoot().WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
|
||||
: publishedSnapshot.Content.GetAtRoot(culture).WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1098,7 +1098,7 @@ namespace Umbraco.Extensions
|
||||
{
|
||||
return content.Parent != null
|
||||
? content.Parent.ChildrenOfType(variationContextAccessor, contentTypeAlias, culture)
|
||||
: publishedSnapshot.Content.GetAtRoot().OfTypes(contentTypeAlias).WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
|
||||
: publishedSnapshot.Content.GetAtRoot(culture).OfTypes(contentTypeAlias).WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1115,7 +1115,7 @@ namespace Umbraco.Extensions
|
||||
{
|
||||
return content.Parent != null
|
||||
? content.Parent.Children<T>(variationContextAccessor, culture)
|
||||
: publishedSnapshot.Content.GetAtRoot().OfType<T>().WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
|
||||
: publishedSnapshot.Content.GetAtRoot(culture).OfType<T>().WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Umbraco.Cms.Core.Configuration;
|
||||
using Umbraco.Cms.Core.Configuration.Models;
|
||||
using Umbraco.Cms.Core.Install.Models;
|
||||
using Umbraco.Cms.Core.Telemetry;
|
||||
using Umbraco.Cms.Web.Common.DependencyInjection;
|
||||
|
||||
namespace Umbraco.Cms.Core.Install.InstallSteps
|
||||
{
|
||||
@@ -13,31 +16,29 @@ namespace Umbraco.Cms.Core.Install.InstallSteps
|
||||
PerformsAppRestart = false)]
|
||||
public class TelemetryIdentifierStep : InstallSetupStep<object>
|
||||
{
|
||||
private readonly ILogger<TelemetryIdentifierStep> _logger;
|
||||
private readonly IOptions<GlobalSettings> _globalSettings;
|
||||
private readonly IConfigManipulator _configManipulator;
|
||||
private readonly ISiteIdentifierService _siteIdentifierService;
|
||||
|
||||
public TelemetryIdentifierStep(ILogger<TelemetryIdentifierStep> logger, IOptions<GlobalSettings> globalSettings, IConfigManipulator configManipulator)
|
||||
public TelemetryIdentifierStep(
|
||||
IOptions<GlobalSettings> globalSettings,
|
||||
ISiteIdentifierService siteIdentifierService)
|
||||
{
|
||||
_logger = logger;
|
||||
_globalSettings = globalSettings;
|
||||
_configManipulator = configManipulator;
|
||||
_siteIdentifierService = siteIdentifierService;
|
||||
}
|
||||
|
||||
[Obsolete("Use constructor that takes GlobalSettings and ISiteIdentifierService")]
|
||||
public TelemetryIdentifierStep(
|
||||
ILogger<TelemetryIdentifierStep> logger,
|
||||
IOptions<GlobalSettings> globalSettings,
|
||||
IConfigManipulator configManipulator)
|
||||
: this(globalSettings, StaticServiceProvider.Instance.GetRequiredService<ISiteIdentifierService>())
|
||||
{
|
||||
}
|
||||
|
||||
public override Task<InstallSetupResult> ExecuteAsync(object model)
|
||||
{
|
||||
// Generate GUID
|
||||
var telemetrySiteIdentifier = Guid.NewGuid();
|
||||
|
||||
try
|
||||
{
|
||||
_configManipulator.SetGlobalId(telemetrySiteIdentifier.ToString());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Couldn't update config files with a telemetry site identifier");
|
||||
}
|
||||
|
||||
_siteIdentifierService.TryCreateSiteIdentifier(out _);
|
||||
return Task.FromResult<InstallSetupResult>(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -70,6 +70,10 @@ namespace Umbraco.Cms.Core.Manifest
|
||||
partA = "contentType";
|
||||
partB = contentType.Alias;
|
||||
break;
|
||||
case IDictionaryItem _:
|
||||
partA = "dictionary";
|
||||
partB = "*"; //Not really a different type for dictionary items
|
||||
break;
|
||||
|
||||
default:
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Umbraco.Cms.Core.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Media.EmbedProviders
|
||||
{
|
||||
/// <summary>
|
||||
/// Embed Provider for lottiefiles.com the popular opensource JSON-based animation format platform.
|
||||
/// </summary>
|
||||
public class LottieFiles : OEmbedProviderBase
|
||||
{
|
||||
public LottieFiles(IJsonSerializer jsonSerializer) : base(jsonSerializer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override string ApiEndpoint => "https://embed.lottiefiles.com/oembed";
|
||||
|
||||
public override string[] UrlSchemeRegex => new string[]
|
||||
{
|
||||
@"lottiefiles\.com/*"
|
||||
};
|
||||
public override Dictionary<string, string> RequestParams => new Dictionary<string, string>();
|
||||
|
||||
public override string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0)
|
||||
{
|
||||
var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight);
|
||||
OEmbedResponse oembed = base.GetJsonResponse<OEmbedResponse>(requestUrl);
|
||||
var html = oembed.GetHtml();
|
||||
//LottieFiles doesn't seem to support maxwidth and maxheight via oembed
|
||||
// this is therefore a hack... with regexes.. is that ok? HtmlAgility etc etc
|
||||
// otherwise it always defaults to 300...
|
||||
if (maxWidth > 0 && maxHeight > 0)
|
||||
{
|
||||
|
||||
html = Regex.Replace(html, "width=\"([0-9]{1,4})\"", "width=\"" + maxWidth + "\"");
|
||||
html = Regex.Replace(html, "height=\"([0-9]{1,4})\"", "height=\"" + maxHeight + "\"");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//if set to 0, let's default to 100% as an easter egg
|
||||
html = Regex.Replace(html, "width=\"([0-9]{1,4})\"", "width=\"100%\"");
|
||||
html = Regex.Replace(html, "height=\"([0-9]{1,4})\"", "height=\"100%\"");
|
||||
}
|
||||
return html;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -237,7 +237,7 @@ namespace Umbraco.Cms.Core.Models
|
||||
public bool IsCulturePublished(string culture)
|
||||
// just check _publishInfos
|
||||
// a non-available culture could not become published anyways
|
||||
=> _publishInfos != null && _publishInfos.ContainsKey(culture);
|
||||
=> !culture.IsNullOrWhiteSpace() && _publishInfos != null && _publishInfos.ContainsKey(culture);
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsCultureEdited(string culture)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
|
||||
{
|
||||
Notifications = new List<BackOfficeNotification>();
|
||||
Translations = new List<DictionaryTranslationDisplay>();
|
||||
ContentApps = new List<ContentApp>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -37,5 +38,11 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
|
||||
/// </summary>
|
||||
[DataMember(Name = "translations")]
|
||||
public List<DictionaryTranslationDisplay> Translations { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Apps for the dictionary item
|
||||
/// </summary>
|
||||
[DataMember(Name = "apps")]
|
||||
public List<ContentApp> ContentApps { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,34 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Cms.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models.ContentEditing
|
||||
{
|
||||
[DataContract(Name = "historyCleanup", Namespace = "")]
|
||||
public class HistoryCleanup
|
||||
public class HistoryCleanup : BeingDirtyBase
|
||||
{
|
||||
private bool _preventCleanup;
|
||||
private int? _keepAllVersionsNewerThanDays;
|
||||
private int? _keepLatestVersionPerDayForDays;
|
||||
|
||||
[DataMember(Name = "preventCleanup")]
|
||||
public bool PreventCleanup { get; set; }
|
||||
public bool PreventCleanup
|
||||
{
|
||||
get => _preventCleanup;
|
||||
set => SetPropertyValueAndDetectChanges(value, ref _preventCleanup, nameof(PreventCleanup));
|
||||
}
|
||||
|
||||
[DataMember(Name = "keepAllVersionsNewerThanDays")]
|
||||
public int? KeepAllVersionsNewerThanDays { get; set; }
|
||||
public int? KeepAllVersionsNewerThanDays
|
||||
{
|
||||
get => _keepAllVersionsNewerThanDays;
|
||||
set => SetPropertyValueAndDetectChanges(value, ref _keepAllVersionsNewerThanDays, nameof(KeepAllVersionsNewerThanDays));
|
||||
}
|
||||
|
||||
[DataMember(Name = "keepLatestVersionPerDayForDays")]
|
||||
public int? KeepLatestVersionPerDayForDays { get; set; }
|
||||
public int? KeepLatestVersionPerDayForDays
|
||||
{
|
||||
get => _keepLatestVersionPerDayForDays;
|
||||
set => SetPropertyValueAndDetectChanges(value, ref _keepLatestVersionPerDayForDays, nameof(KeepLatestVersionPerDayForDays));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,5 +55,11 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
|
||||
/// </summary>
|
||||
[DataMember(Name = "notifications")]
|
||||
public List<BackOfficeNotification> Notifications { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the RelationType should be returned in "Used by"-queries.
|
||||
/// </summary>
|
||||
[DataMember(Name = "isDependency", IsRequired = true)]
|
||||
public bool IsDependency { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,5 +23,11 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
|
||||
/// </summary>
|
||||
[DataMember(Name = "childObjectType", IsRequired = false)]
|
||||
public Guid? ChildObjectType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the RelationType should be returned in "Used by"-queries.
|
||||
/// </summary>
|
||||
[DataMember(Name = "isDependency", IsRequired = true)]
|
||||
public bool IsDependency { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,13 @@ namespace Umbraco.Cms.Core.Models
|
||||
}
|
||||
}
|
||||
|
||||
public HistoryCleanup HistoryCleanup { get; set; }
|
||||
private HistoryCleanup _historyCleanup;
|
||||
|
||||
public HistoryCleanup HistoryCleanup
|
||||
{
|
||||
get => _historyCleanup;
|
||||
set => SetPropertyValueAndDetectChanges(value, ref _historyCleanup, nameof(HistoryCleanup));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if AllowedTemplates contains templateId
|
||||
@@ -162,5 +168,8 @@ namespace Umbraco.Cms.Core.Models
|
||||
/// <inheritdoc />
|
||||
IContentType IContentType.DeepCloneWithResetIdentities(string newAlias) =>
|
||||
(IContentType)DeepCloneWithResetIdentities(newAlias);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool IsDirty() => base.IsDirty() || HistoryCleanup.IsDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,15 @@ using Umbraco.Cms.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models
|
||||
{
|
||||
public interface IRelationTypeWithIsDependency : IRelationType
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the RelationType should be returned in "Used by"-queries.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool IsDependency { get; set; }
|
||||
}
|
||||
|
||||
public interface IRelationType : IEntity, IRememberBeingDirty
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Cms.Core.ContentApps;
|
||||
@@ -48,6 +48,11 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
}
|
||||
|
||||
public IEnumerable<ContentApp> GetContentApps(IUmbracoEntity source)
|
||||
{
|
||||
return GetContentAppsForEntity(source);
|
||||
}
|
||||
|
||||
public IEnumerable<ContentApp> GetContentAppsForEntity(IEntity source)
|
||||
{
|
||||
var apps = _contentAppDefinitions.GetContentAppsFor(source).ToArray();
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
|
||||
if (target is IContentTypeWithHistoryCleanup targetWithHistoryCleanup)
|
||||
{
|
||||
targetWithHistoryCleanup.HistoryCleanup = source.HistoryCleanup;
|
||||
MapHistoryCleanup(source, targetWithHistoryCleanup);
|
||||
}
|
||||
|
||||
target.AllowedTemplates = source.AllowedTemplates
|
||||
@@ -147,6 +147,34 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
: _fileService.GetTemplate(source.DefaultTemplate));
|
||||
}
|
||||
|
||||
private static void MapHistoryCleanup(DocumentTypeSave source, IContentTypeWithHistoryCleanup target)
|
||||
{
|
||||
// If source history cleanup is null we don't have to map all properties
|
||||
if (source.HistoryCleanup is null)
|
||||
{
|
||||
target.HistoryCleanup = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// We need to reset the dirty properties, because it is otherwise true, just because the json serializer has set properties
|
||||
target.HistoryCleanup.ResetDirtyProperties(false);
|
||||
if (target.HistoryCleanup.PreventCleanup != source.HistoryCleanup.PreventCleanup)
|
||||
{
|
||||
target.HistoryCleanup.PreventCleanup = source.HistoryCleanup.PreventCleanup;
|
||||
}
|
||||
|
||||
if (target.HistoryCleanup.KeepAllVersionsNewerThanDays != source.HistoryCleanup.KeepAllVersionsNewerThanDays)
|
||||
{
|
||||
target.HistoryCleanup.KeepAllVersionsNewerThanDays = source.HistoryCleanup.KeepAllVersionsNewerThanDays;
|
||||
}
|
||||
|
||||
if (target.HistoryCleanup.KeepLatestVersionPerDayForDays !=
|
||||
source.HistoryCleanup.KeepLatestVersionPerDayForDays)
|
||||
{
|
||||
target.HistoryCleanup.KeepLatestVersionPerDayForDays = source.HistoryCleanup.KeepLatestVersionPerDayForDays;
|
||||
}
|
||||
}
|
||||
|
||||
// no MapAll - take care
|
||||
private void Map(MediaTypeSave source, IMediaType target, MapperContext context)
|
||||
{
|
||||
@@ -196,7 +224,7 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
|
||||
target.AllowCultureVariant = source.VariesByCulture();
|
||||
target.AllowSegmentVariant = source.VariesBySegment();
|
||||
target.ContentApps = _commonMapper.GetContentApps(source);
|
||||
target.ContentApps = _commonMapper.GetContentAppsForEntity(source);
|
||||
|
||||
//sync templates
|
||||
target.AllowedTemplates = context.MapEnumerable<ITemplate, EntityBasic>(source.AllowedTemplates);
|
||||
@@ -328,7 +356,10 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
|
||||
if (source.GroupId > 0)
|
||||
{
|
||||
target.PropertyGroupId = new Lazy<int>(() => source.GroupId, false);
|
||||
if (target.PropertyGroupId?.Value != source.GroupId)
|
||||
{
|
||||
target.PropertyGroupId = new Lazy<int>(() => source.GroupId, false);
|
||||
}
|
||||
}
|
||||
|
||||
target.Alias = source.Alias;
|
||||
@@ -523,7 +554,15 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
target.Thumbnail = source.Thumbnail;
|
||||
|
||||
target.AllowedAsRoot = source.AllowAsRoot;
|
||||
target.AllowedContentTypes = source.AllowedContentTypes.Select((t, i) => new ContentTypeSort(t, i));
|
||||
|
||||
bool allowedContentTypesUnchanged = target.AllowedContentTypes.Select(x => x.Id.Value)
|
||||
.SequenceEqual(source.AllowedContentTypes);
|
||||
|
||||
if (allowedContentTypesUnchanged is false)
|
||||
{
|
||||
target.AllowedContentTypes = source.AllowedContentTypes.Select((t, i) => new ContentTypeSort(t, i));
|
||||
}
|
||||
|
||||
|
||||
if (!(target is IMemberType))
|
||||
{
|
||||
@@ -574,13 +613,21 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
|
||||
// ensure no duplicate alias, then assign the group properties collection
|
||||
EnsureUniqueAliases(destProperties);
|
||||
destGroup.PropertyTypes = new PropertyTypeCollection(isPublishing, destProperties);
|
||||
if (destGroup.PropertyTypes.SupportsPublishing != isPublishing || destGroup.PropertyTypes.SequenceEqual(destProperties) is false)
|
||||
{
|
||||
destGroup.PropertyTypes = new PropertyTypeCollection(isPublishing, destProperties);
|
||||
}
|
||||
|
||||
destGroups.Add(destGroup);
|
||||
}
|
||||
|
||||
// ensure no duplicate name, then assign the groups collection
|
||||
EnsureUniqueAliases(destGroups);
|
||||
target.PropertyGroups = new PropertyGroupCollection(destGroups);
|
||||
|
||||
if (target.PropertyGroups.SequenceEqual(destGroups) is false)
|
||||
{
|
||||
target.PropertyGroups = new PropertyGroupCollection(destGroups);
|
||||
}
|
||||
|
||||
// because the property groups collection was rebuilt, there is no need to remove
|
||||
// the old groups - they are just gone and will be cleared by the repository
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Cms.Core.Events;
|
||||
using Umbraco.Cms.Core.Mapping;
|
||||
using Umbraco.Cms.Core.Models.ContentEditing;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
@@ -14,12 +15,20 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
public class DictionaryMapDefinition : IMapDefinition
|
||||
{
|
||||
private readonly ILocalizationService _localizationService;
|
||||
private readonly CommonMapper _commonMapper;
|
||||
|
||||
[Obsolete("Use the constructor with the CommonMapper")]
|
||||
public DictionaryMapDefinition(ILocalizationService localizationService)
|
||||
{
|
||||
_localizationService = localizationService;
|
||||
}
|
||||
|
||||
public DictionaryMapDefinition(ILocalizationService localizationService, CommonMapper commonMapper)
|
||||
{
|
||||
_localizationService = localizationService;
|
||||
_commonMapper = commonMapper;
|
||||
}
|
||||
|
||||
public void DefineMaps(IUmbracoMapper mapper)
|
||||
{
|
||||
mapper.Define<IDictionaryItem, EntityBasic>((source, context) => new EntityBasic(), Map);
|
||||
@@ -44,6 +53,10 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
target.Name = source.ItemKey;
|
||||
target.ParentId = source.ParentId ?? Guid.Empty;
|
||||
target.Udi = Udi.Create(Constants.UdiEntityType.DictionaryItem, source.Key);
|
||||
if (_commonMapper != null)
|
||||
{
|
||||
target.ContentApps.AddRange(_commonMapper.GetContentAppsForEntity(source));
|
||||
}
|
||||
|
||||
// build up the path to make it possible to set active item in tree
|
||||
// TODO: check if there is a better way
|
||||
|
||||
@@ -30,6 +30,11 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
target.ChildObjectType = source.ChildObjectType;
|
||||
target.Id = source.Id;
|
||||
target.IsBidirectional = source.IsBidirectional;
|
||||
|
||||
if (source is IRelationTypeWithIsDependency sourceWithIsDependency)
|
||||
{
|
||||
target.IsDependency = sourceWithIsDependency.IsDependency;
|
||||
}
|
||||
target.Key = source.Key;
|
||||
target.Name = source.Name;
|
||||
target.Alias = source.Alias;
|
||||
@@ -74,6 +79,11 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
target.ChildObjectType = source.ChildObjectType;
|
||||
target.Id = source.Id.TryConvertTo<int>().Result;
|
||||
target.IsBidirectional = source.IsBidirectional;
|
||||
if (target is IRelationTypeWithIsDependency targetWithIsDependency)
|
||||
{
|
||||
targetWithIsDependency.IsDependency = source.IsDependency;
|
||||
}
|
||||
|
||||
target.Key = source.Key;
|
||||
target.Name = source.Name;
|
||||
target.ParentObjectType = source.ParentObjectType;
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Umbraco.Cms.Core.Models
|
||||
}
|
||||
else
|
||||
{
|
||||
var tuple = new MemberTypePropertyProfileAccess(false, false, true);
|
||||
var tuple = new MemberTypePropertyProfileAccess(false, false, value);
|
||||
_memberTypePropertyTypes.Add(propertyTypeAlias, tuple);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Cms.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models
|
||||
{
|
||||
[DataContract(Name = "relationItem", Namespace = "")]
|
||||
public class RelationItem
|
||||
{
|
||||
[DataMember(Name = "id")]
|
||||
public int NodeId { get; set; }
|
||||
|
||||
[DataMember(Name = "key")]
|
||||
public Guid NodeKey { get; set; }
|
||||
|
||||
[DataMember(Name = "name")]
|
||||
public string NodeName { get; set; }
|
||||
|
||||
[DataMember(Name = "type")]
|
||||
public string NodeType { get; set; }
|
||||
|
||||
[DataMember(Name = "udi")]
|
||||
public Udi NodeUdi => NodeType == Constants.UdiEntityType.Unknown ? null : Udi.Create(NodeType, NodeKey);
|
||||
|
||||
[DataMember(Name = "icon")]
|
||||
public string ContentTypeIcon { get; set; }
|
||||
|
||||
[DataMember(Name = "alias")]
|
||||
public string ContentTypeAlias { get; set; }
|
||||
|
||||
[DataMember(Name = "contentTypeName")]
|
||||
public string ContentTypeName { get; set; }
|
||||
|
||||
[DataMember(Name = "relationTypeName")]
|
||||
public string RelationTypeName { get; set; }
|
||||
|
||||
[DataMember(Name = "relationTypeIsBidirectional")]
|
||||
public bool RelationTypeIsBidirectional { get; set; }
|
||||
|
||||
[DataMember(Name = "relationTypeIsDependency")]
|
||||
public bool RelationTypeIsDependency { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,20 +9,28 @@ namespace Umbraco.Cms.Core.Models
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public class RelationType : EntityBase, IRelationType
|
||||
public class RelationType : EntityBase, IRelationType, IRelationTypeWithIsDependency
|
||||
{
|
||||
private string _name;
|
||||
private string _alias;
|
||||
private bool _isBidirectional;
|
||||
private bool _isDependency;
|
||||
private Guid? _parentObjectType;
|
||||
private Guid? _childObjectType;
|
||||
|
||||
public RelationType(string alias, string name)
|
||||
: this(name: name, alias: alias, false, null, null)
|
||||
: this(name: name, alias: alias, false, null, null, false)
|
||||
{
|
||||
}
|
||||
|
||||
[Obsolete("Use ctor with isDependency parameter")]
|
||||
public RelationType(string name, string alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType)
|
||||
:this(name,alias,isBidrectional, parentObjectType, childObjectType, false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public RelationType(string name, string alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType, bool isDependency)
|
||||
{
|
||||
if (name == null) throw new ArgumentNullException(nameof(name));
|
||||
if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(name));
|
||||
@@ -32,6 +40,7 @@ namespace Umbraco.Cms.Core.Models
|
||||
_name = name;
|
||||
_alias = alias;
|
||||
_isBidirectional = isBidrectional;
|
||||
_isDependency = isDependency;
|
||||
_parentObjectType = parentObjectType;
|
||||
_childObjectType = childObjectType;
|
||||
}
|
||||
@@ -88,5 +97,11 @@ namespace Umbraco.Cms.Core.Models
|
||||
set => SetPropertyValueAndDetectChanges(value, ref _childObjectType, nameof(ChildObjectType));
|
||||
}
|
||||
|
||||
|
||||
public bool IsDependency
|
||||
{
|
||||
get => _isDependency;
|
||||
set => SetPropertyValueAndDetectChanges(value, ref _isDependency, nameof(IsDependency));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models
|
||||
{
|
||||
[DataContract]
|
||||
public enum TelemetryLevel
|
||||
{
|
||||
Minimal,
|
||||
Basic,
|
||||
Detailed,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models
|
||||
{
|
||||
[DataContract]
|
||||
public class TelemetryResource
|
||||
{
|
||||
[DataMember]
|
||||
public TelemetryLevel TelemetryLevel { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models
|
||||
{
|
||||
[DataContract]
|
||||
public class UsageInformation
|
||||
{
|
||||
[DataMember(Name = "name")]
|
||||
public string Name { get; }
|
||||
|
||||
[DataMember(Name = "data")]
|
||||
public object Data { get; }
|
||||
|
||||
public UsageInformation(string name, object data)
|
||||
{
|
||||
Name = name;
|
||||
Data = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models
|
||||
{
|
||||
[DataContract]
|
||||
public class UserTwoFactorProviderModel
|
||||
{
|
||||
public UserTwoFactorProviderModel(string providerName, bool isEnabledOnUser)
|
||||
{
|
||||
ProviderName = providerName;
|
||||
IsEnabledOnUser = isEnabledOnUser;
|
||||
}
|
||||
|
||||
[DataMember(Name = "providerName")]
|
||||
public string ProviderName { get; }
|
||||
|
||||
[DataMember(Name = "isEnabledOnUser")]
|
||||
public bool IsEnabledOnUser { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.Models.ContentEditing;
|
||||
using Umbraco.Cms.Core.Web;
|
||||
|
||||
namespace Umbraco.Cms.Core.Notifications
|
||||
{
|
||||
public class SendingAllowedChildrenNotification : INotification
|
||||
{
|
||||
public IUmbracoContext UmbracoContext { get; }
|
||||
|
||||
public IEnumerable<ContentTypeBasic> Children { get; set; }
|
||||
|
||||
public SendingAllowedChildrenNotification(IEnumerable<ContentTypeBasic> children, IUmbracoContext umbracoContext)
|
||||
{
|
||||
UmbracoContext = umbracoContext;
|
||||
Children = children;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Cms.Core.Notifications
|
||||
{
|
||||
public class UserTwoFactorRequestedNotification : INotification
|
||||
{
|
||||
public UserTwoFactorRequestedNotification(Guid userKey)
|
||||
{
|
||||
UserKey = userKey;
|
||||
}
|
||||
|
||||
public Guid UserKey { get; }
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Umbraco.Cms.Core.Configuration.Models;
|
||||
@@ -33,7 +32,7 @@ namespace Umbraco.Cms.Core.Packaging
|
||||
private readonly IEntityXmlSerializer _serializer;
|
||||
private readonly IHostingEnvironment _hostingEnvironment;
|
||||
private readonly string _packageRepositoryFileName;
|
||||
private readonly string _mediaFolderPath;
|
||||
private readonly string _createdPackagesFolderPath;
|
||||
private readonly string _packagesFolderPath;
|
||||
private readonly string _tempFolderPath;
|
||||
private readonly PackageDefinitionXmlParser _parser;
|
||||
@@ -93,7 +92,7 @@ namespace Umbraco.Cms.Core.Packaging
|
||||
|
||||
_tempFolderPath = tempFolderPath ?? Constants.SystemDirectories.TempData.EnsureEndsWith('/') + "PackageFiles";
|
||||
_packagesFolderPath = packagesFolderPath ?? Constants.SystemDirectories.Packages;
|
||||
_mediaFolderPath = mediaFolderPath ?? Path.Combine(globalSettings.Value.UmbracoMediaPhysicalRootPath, Constants.SystemDirectories.CreatedPackages);
|
||||
_createdPackagesFolderPath = mediaFolderPath ?? Constants.SystemDirectories.CreatedPackages;
|
||||
|
||||
_parser = new PackageDefinitionXmlParser();
|
||||
_mediaService = mediaService;
|
||||
@@ -250,15 +249,8 @@ namespace Umbraco.Cms.Core.Packaging
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var directoryName =
|
||||
_hostingEnvironment.MapPathWebRoot(Path.Combine(_mediaFolderPath, definition.Name.Replace(' ', '_')));
|
||||
|
||||
if (Directory.Exists(directoryName) == false)
|
||||
{
|
||||
Directory.CreateDirectory(directoryName);
|
||||
}
|
||||
var directoryName = _hostingEnvironment.MapPathContentRoot(Path.Combine(_createdPackagesFolderPath, definition.Name.Replace(' ', '_')));
|
||||
Directory.CreateDirectory(directoryName);
|
||||
|
||||
var finalPackagePath = Path.Combine(directoryName, fileName);
|
||||
|
||||
@@ -276,14 +268,14 @@ namespace Umbraco.Cms.Core.Packaging
|
||||
}
|
||||
finally
|
||||
{
|
||||
//Clean up
|
||||
// Clean up
|
||||
Directory.Delete(temporaryPath, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidatePackage(PackageDefinition definition)
|
||||
{
|
||||
//ensure it's valid
|
||||
// ensure it's valid
|
||||
var context = new ValidationContext(definition, serviceProvider: null, items: null);
|
||||
var results = new List<ValidationResult>();
|
||||
var isValid = Validator.TryValidateObject(definition, context, results);
|
||||
@@ -732,7 +724,6 @@ namespace Umbraco.Cms.Core.Packaging
|
||||
private XDocument EnsureStorage(out string packagesFile)
|
||||
{
|
||||
var packagesFolder = _hostingEnvironment.MapPathContentRoot(_packagesFolderPath);
|
||||
//ensure it exists
|
||||
Directory.CreateDirectory(packagesFolder);
|
||||
|
||||
packagesFile = _hostingEnvironment.MapPathContentRoot(CreatedPackagesFile);
|
||||
@@ -740,6 +731,8 @@ namespace Umbraco.Cms.Core.Packaging
|
||||
{
|
||||
var xml = new XDocument(new XElement("packages"));
|
||||
xml.Save(packagesFile);
|
||||
|
||||
return xml;
|
||||
}
|
||||
|
||||
var packagesXml = XDocument.Load(packagesFile);
|
||||
@@ -749,9 +742,16 @@ namespace Umbraco.Cms.Core.Packaging
|
||||
public void DeleteLocalRepositoryFiles()
|
||||
{
|
||||
var packagesFile = _hostingEnvironment.MapPathContentRoot(CreatedPackagesFile);
|
||||
File.Delete(packagesFile);
|
||||
if (File.Exists(packagesFile))
|
||||
{
|
||||
File.Delete(packagesFile);
|
||||
}
|
||||
|
||||
var packagesFolder = _hostingEnvironment.MapPathContentRoot(_packagesFolderPath);
|
||||
Directory.Delete(packagesFolder);
|
||||
if (Directory.Exists(packagesFolder))
|
||||
{
|
||||
Directory.Delete(packagesFolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,11 @@ namespace Umbraco.Cms.Core
|
||||
/// All languages.
|
||||
/// </summary>
|
||||
public const int Languages = -340;
|
||||
|
||||
/// <summary>
|
||||
/// ScheduledPublishing job.
|
||||
/// </summary>
|
||||
public const int ScheduledPublishing = -341;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Persistence.Repositories
|
||||
{
|
||||
[Obsolete("This interface will be merged with IMacroRepository in Umbraco 11")]
|
||||
public interface IMacroWithAliasRepository : IMacroRepository
|
||||
{
|
||||
IMacro GetByAlias(string alias);
|
||||
|
||||
IEnumerable<IMacro> GetAllByAlias(string[] aliases);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.Entities;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Persistence.Repositories
|
||||
{
|
||||
public interface ITrackedReferencesRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a page of items which are in relation with the current item.
|
||||
/// Basically, shows the items which depend on the current item.
|
||||
/// </summary>
|
||||
/// <param name="id">The identifier of the entity to retrieve relations for.</param>
|
||||
/// <param name="pageIndex">The page index.</param>
|
||||
/// <param name="pageSize">The page size.</param>
|
||||
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
|
||||
/// <param name="totalRecords">The total count of the items with reference to the current item.</param>
|
||||
/// <returns>An enumerable list of <see cref="RelationItem"/> objects.</returns>
|
||||
IEnumerable<RelationItem> GetPagedRelationsForItem(int id, long pageIndex, int pageSize, bool filterMustBeIsDependency, out long totalRecords);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a page of items used in any kind of relation from selected integer ids.
|
||||
/// </summary>
|
||||
/// <param name="ids">The identifiers of the entities to check for relations.</param>
|
||||
/// <param name="pageIndex">The page index.</param>
|
||||
/// <param name="pageSize">The page size.</param>
|
||||
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
|
||||
/// <param name="totalRecords">The total count of the items in any kind of relation.</param>
|
||||
/// <returns>An enumerable list of <see cref="RelationItem"/> objects.</returns>
|
||||
IEnumerable<RelationItem> GetPagedItemsWithRelations(int[] ids, long pageIndex, int pageSize, bool filterMustBeIsDependency, out long totalRecords);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a page of the descending items that have any references, given a parent id.
|
||||
/// </summary>
|
||||
/// <param name="parentId">The unique identifier of the parent to retrieve descendants for.</param>
|
||||
/// <param name="pageIndex">The page index.</param>
|
||||
/// <param name="pageSize">The page size.</param>
|
||||
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
|
||||
/// <param name="totalRecords">The total count of descending items.</param>
|
||||
/// <returns>An enumerable list of <see cref="RelationItem"/> objects.</returns>
|
||||
IEnumerable<RelationItem> GetPagedDescendantsInReferences(int parentId, long pageIndex, int pageSize, bool filterMustBeIsDependency, out long totalRecords);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Umbraco.Cms.Core.Hosting;
|
||||
using Umbraco.Cms.Core.IO;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.Editors;
|
||||
@@ -158,17 +157,15 @@ namespace Umbraco.Cms.Core.PropertyEditors
|
||||
/// <exception cref="System.ArgumentOutOfRangeException">ValueType was out of range.</exception>
|
||||
internal Attempt<object> TryConvertValueToCrlType(object value)
|
||||
{
|
||||
// Ensure empty string values are converted to null
|
||||
if (value is string s && string.IsNullOrWhiteSpace(s))
|
||||
// Ensure empty string and JSON values are converted to null
|
||||
if (value is string stringValue && string.IsNullOrWhiteSpace(stringValue))
|
||||
{
|
||||
value = null;
|
||||
}
|
||||
|
||||
// Ensure JSON is serialized properly (without indentation or converted to null when empty)
|
||||
if (value is not null && ValueType.InvariantEquals(ValueTypes.Json))
|
||||
else if (value is not string && ValueType.InvariantEquals(ValueTypes.Json))
|
||||
{
|
||||
// Only serialize value when it's not already a string
|
||||
var jsonValue = _jsonSerializer.Serialize(value);
|
||||
|
||||
if (jsonValue.DetectIsEmptyJson())
|
||||
{
|
||||
value = null;
|
||||
|
||||
+14
-2
@@ -1,5 +1,5 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Umbraco.Cms.Core.Hosting;
|
||||
using Umbraco.Cms.Core.IO;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Serialization;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Strings;
|
||||
@@ -28,5 +28,17 @@ namespace Umbraco.Cms.Core.PropertyEditors.ParameterEditors
|
||||
DefaultConfiguration.Add("minNumber",0 );
|
||||
DefaultConfiguration.Add("maxNumber", 0);
|
||||
}
|
||||
|
||||
protected override IDataValueEditor CreateValueEditor() => DataValueEditorFactory.Create<MultipleContentPickerParameterEditor.MultipleContentPickerParamateterValueEditor>(Attribute);
|
||||
|
||||
internal class MultipleContentPickerParamateterValueEditor : MultiplePickerParamateterValueEditorBase
|
||||
{
|
||||
public MultipleContentPickerParamateterValueEditor(ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IJsonSerializer jsonSerializer, IIOHelper ioHelper, DataEditorAttribute attribute, IEntityService entityService) : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute, entityService)
|
||||
{
|
||||
}
|
||||
|
||||
public override string UdiEntityType { get; } = Constants.UdiEntityType.Document;
|
||||
public override UmbracoObjectTypes UmbracoObjectType { get; } = UmbracoObjectTypes.Document;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+18
-2
@@ -1,5 +1,9 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Umbraco.Cms.Core.Hosting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection.Metadata;
|
||||
using Umbraco.Cms.Core.IO;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.Editors;
|
||||
using Umbraco.Cms.Core.Serialization;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Strings;
|
||||
@@ -26,5 +30,17 @@ namespace Umbraco.Cms.Core.PropertyEditors.ParameterEditors
|
||||
{
|
||||
DefaultConfiguration.Add("multiPicker", "1");
|
||||
}
|
||||
|
||||
protected override IDataValueEditor CreateValueEditor() => DataValueEditorFactory.Create<MultipleMediaPickerPropertyValueEditor>(Attribute);
|
||||
|
||||
internal class MultipleMediaPickerPropertyValueEditor : MultiplePickerParamateterValueEditorBase
|
||||
{
|
||||
public MultipleMediaPickerPropertyValueEditor(ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IJsonSerializer jsonSerializer, IIOHelper ioHelper, DataEditorAttribute attribute, IEntityService entityService) : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute, entityService)
|
||||
{
|
||||
}
|
||||
|
||||
public override string UdiEntityType { get; } = Constants.UdiEntityType.Media;
|
||||
public override UmbracoObjectTypes UmbracoObjectType { get; } = UmbracoObjectTypes.Media;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.IO;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.Editors;
|
||||
using Umbraco.Cms.Core.Serialization;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Strings;
|
||||
|
||||
namespace Umbraco.Cms.Core.PropertyEditors.ParameterEditors
|
||||
{
|
||||
internal abstract class MultiplePickerParamateterValueEditorBase : DataValueEditor, IDataValueReference
|
||||
{
|
||||
private readonly IEntityService _entityService;
|
||||
|
||||
public MultiplePickerParamateterValueEditorBase(
|
||||
ILocalizedTextService localizedTextService,
|
||||
IShortStringHelper shortStringHelper,
|
||||
IJsonSerializer jsonSerializer,
|
||||
IIOHelper ioHelper,
|
||||
DataEditorAttribute attribute,
|
||||
IEntityService entityService)
|
||||
: base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
|
||||
{
|
||||
_entityService = entityService;
|
||||
}
|
||||
|
||||
public abstract string UdiEntityType { get; }
|
||||
public abstract UmbracoObjectTypes UmbracoObjectType { get; }
|
||||
public IEnumerable<UmbracoEntityReference> GetReferences(object value)
|
||||
{
|
||||
var asString = value is string str ? str : value?.ToString();
|
||||
|
||||
if (string.IsNullOrEmpty(asString))
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
foreach (var udiStr in asString.Split(','))
|
||||
{
|
||||
if (UdiParser.TryParse(udiStr, out Udi udi))
|
||||
{
|
||||
yield return new UmbracoEntityReference(udi);
|
||||
}
|
||||
|
||||
// this is needed to support the legacy case when the multiple media picker parameter editor stores ints not udis
|
||||
if (int.TryParse(udiStr, out var id))
|
||||
{
|
||||
Attempt<Guid> guidAttempt = _entityService.GetKey(id, UmbracoObjectType);
|
||||
Guid guid = guidAttempt.Success ? guidAttempt.Result : Guid.Empty;
|
||||
|
||||
if (guid != Guid.Empty)
|
||||
{
|
||||
yield return new UmbracoEntityReference(new GuidUdi(Constants.UdiEntityType.Media, guid));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -134,8 +134,13 @@ namespace Umbraco.Cms.Core.Routing
|
||||
return GetUrlFromRoute(route, umbracoContext, content.Id, current, mode, culture);
|
||||
}
|
||||
|
||||
internal UrlInfo GetUrlFromRoute(string route, IUmbracoContext umbracoContext, int id, Uri current,
|
||||
UrlMode mode, string culture)
|
||||
internal UrlInfo GetUrlFromRoute(
|
||||
string route,
|
||||
IUmbracoContext umbracoContext,
|
||||
int id,
|
||||
Uri current,
|
||||
UrlMode mode,
|
||||
string culture)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(route))
|
||||
{
|
||||
@@ -149,12 +154,12 @@ namespace Umbraco.Cms.Core.Routing
|
||||
// route is /<path> or <domainRootId>/<path>
|
||||
var pos = route.IndexOf('/');
|
||||
var path = pos == 0 ? route : route.Substring(pos);
|
||||
var domainUri = pos == 0
|
||||
DomainAndUri domainUri = pos == 0
|
||||
? null
|
||||
: DomainUtilities.DomainForNode(umbracoContext.PublishedSnapshot.Domains, _siteDomainMapper, int.Parse(route.Substring(0, pos), CultureInfo.InvariantCulture), current, culture);
|
||||
|
||||
var defaultCulture = _localizationService.GetDefaultLanguageIsoCode();
|
||||
if (domainUri is not null || culture == defaultCulture || string.IsNullOrEmpty(culture))
|
||||
if (domainUri is not null || string.IsNullOrEmpty(culture) || culture.Equals(defaultCulture, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
var url = AssembleUrl(domainUri, path, current, mode).ToString();
|
||||
return UrlInfo.Url(url, culture);
|
||||
|
||||
@@ -111,10 +111,10 @@ namespace Umbraco.Cms.Core.Routing
|
||||
// this the ONLY place where we deal with default culture - IUrlProvider always receive a culture
|
||||
// be nice with tests, assume things can be null, ultimately fall back to invariant
|
||||
// (but only for variant content of course)
|
||||
if (content.ContentType.VariesByCulture())
|
||||
// We need to check all ancestors because urls are variant even for invariant content, if an ancestor is variant.
|
||||
if (culture == null && content.AncestorsOrSelf().Any(x => x.ContentType.VariesByCulture()))
|
||||
{
|
||||
if (culture == null)
|
||||
culture = _variationContextAccessor?.VariationContext?.Culture ?? "";
|
||||
culture = _variationContextAccessor?.VariationContext?.Culture ?? "";
|
||||
}
|
||||
|
||||
if (current == null)
|
||||
@@ -122,7 +122,7 @@ namespace Umbraco.Cms.Core.Routing
|
||||
var umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext();
|
||||
current = umbracoContext.CleanedUmbracoUrl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var url = _urlProviders.Select(provider => provider.GetUrl(content, mode, culture, current))
|
||||
.FirstOrDefault(u => u != null);
|
||||
@@ -230,7 +230,7 @@ namespace Umbraco.Cms.Core.Routing
|
||||
var umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext();
|
||||
current = umbracoContext.CleanedUmbracoUrl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var url = _mediaUrlProviders.Select(provider =>
|
||||
provider.GetMediaUrl(content, propertyAlias, mode, culture, current))
|
||||
|
||||
@@ -269,16 +269,10 @@ namespace Umbraco.Extensions
|
||||
|
||||
if (!pcr.HasPublishedContent())
|
||||
{
|
||||
var logMsg = nameof(DetectCollisionAsync) +
|
||||
const string logMsg = nameof(DetectCollisionAsync) +
|
||||
" did not resolve a content item for original url: {Url}, translated to {TranslatedUrl} and culture: {Culture}";
|
||||
if (pcr.IgnorePublishedContentCollisions)
|
||||
{
|
||||
logger.LogDebug(logMsg, url, uri, culture);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.LogDebug(logMsg, url, uri, culture);
|
||||
}
|
||||
|
||||
logger.LogDebug(logMsg, url, uri, culture);
|
||||
|
||||
var urlInfo = UrlInfo.Message(textService.Localize("content", "routeErrorCannotRoute"), culture);
|
||||
return Attempt.Succeed(urlInfo);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace Umbraco.Cms.Core.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a class which can generate a distinct key for a MainDom boundary.
|
||||
/// </summary>
|
||||
public interface IMainDomKeyGenerator
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a key that signifies a MainDom boundary.
|
||||
/// </summary>
|
||||
string GenerateKey();
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ namespace Umbraco.Cms.Core.Runtime
|
||||
|
||||
if (_isMainDom.HasValue == false)
|
||||
{
|
||||
throw new InvalidOperationException("Register called when MainDom has not been acquired");
|
||||
throw new InvalidOperationException("Register called before IsMainDom has been established");
|
||||
}
|
||||
else if (_isMainDom == false)
|
||||
{
|
||||
@@ -225,7 +225,7 @@ namespace Umbraco.Cms.Core.Runtime
|
||||
{
|
||||
if (!_isMainDom.HasValue)
|
||||
{
|
||||
throw new InvalidOperationException("MainDom has not been acquired yet");
|
||||
throw new InvalidOperationException("IsMainDom has not been established yet");
|
||||
}
|
||||
return _isMainDom.Value;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
@@ -8,12 +8,17 @@ namespace Umbraco.Cms.Core.Security
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Handles password hashing and formatting for legacy hashing algorithms
|
||||
/// Handles password hashing and formatting for legacy hashing algorithms.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Should probably be internal.
|
||||
/// </remarks>
|
||||
public class LegacyPasswordSecurity
|
||||
{
|
||||
// TODO: Remove v11
|
||||
// Used for tests
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[Obsolete("We shouldn't be altering our public API to make test code easier, removing v11")]
|
||||
public string HashPasswordForStorage(string algorithmType, string password)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(password))
|
||||
@@ -24,13 +29,15 @@ namespace Umbraco.Cms.Core.Security
|
||||
return FormatPasswordForStorage(algorithmType, hashed, salt);
|
||||
}
|
||||
|
||||
// TODO: Remove v11
|
||||
// Used for tests
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[Obsolete("We shouldn't be altering our public API to make test code easier, removing v11")]
|
||||
public string FormatPasswordForStorage(string algorithmType, string hashedPassword, string salt)
|
||||
{
|
||||
if (IsLegacySHA1Algorithm(algorithmType))
|
||||
if (!SupportHashAlgorithm(algorithmType))
|
||||
{
|
||||
return hashedPassword;
|
||||
throw new InvalidOperationException($"{algorithmType} is not supported");
|
||||
}
|
||||
|
||||
return salt + hashedPassword;
|
||||
@@ -45,10 +52,15 @@ namespace Umbraco.Cms.Core.Security
|
||||
/// <returns></returns>
|
||||
public bool VerifyPassword(string algorithm, string password, string dbPassword)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(dbPassword)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(dbPassword));
|
||||
if (string.IsNullOrWhiteSpace(dbPassword))
|
||||
{
|
||||
throw new ArgumentException("Value cannot be null or whitespace.", nameof(dbPassword));
|
||||
}
|
||||
|
||||
if (dbPassword.StartsWith(Constants.Security.EmptyPasswordPrefix))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@@ -61,7 +73,6 @@ namespace Umbraco.Cms.Core.Security
|
||||
//This can happen if the length of the password is wrong and a salt cannot be extracted.
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -69,12 +80,13 @@ namespace Umbraco.Cms.Core.Security
|
||||
/// </summary>
|
||||
public bool VerifyLegacyHashedPassword(string password, string dbPassword)
|
||||
{
|
||||
var hashAlgorith = new HMACSHA1
|
||||
var hashAlgorithm = new HMACSHA1
|
||||
{
|
||||
//the legacy salt was actually the password :(
|
||||
Key = Encoding.Unicode.GetBytes(password)
|
||||
};
|
||||
var hashed = Convert.ToBase64String(hashAlgorith.ComputeHash(Encoding.Unicode.GetBytes(password)));
|
||||
|
||||
var hashed = Convert.ToBase64String(hashAlgorithm.ComputeHash(Encoding.Unicode.GetBytes(password)));
|
||||
|
||||
return dbPassword == hashed;
|
||||
}
|
||||
@@ -87,6 +99,8 @@ namespace Umbraco.Cms.Core.Security
|
||||
/// <param name="salt"></param>
|
||||
/// <returns></returns>
|
||||
// TODO: Do we need this method? We shouldn't be using this class to create new password hashes for storage
|
||||
// TODO: Remove v11
|
||||
[Obsolete("We shouldn't be altering our public API to make test code easier, removing v11")]
|
||||
public string HashNewPassword(string algorithm, string newPassword, out string salt)
|
||||
{
|
||||
salt = GenerateSalt();
|
||||
@@ -102,15 +116,15 @@ namespace Umbraco.Cms.Core.Security
|
||||
/// <returns></returns>
|
||||
public string ParseStoredHashPassword(string algorithm, string storedString, out string salt)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(storedString)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(storedString));
|
||||
|
||||
// This is for the <= v4 hashing algorithm for which there was no salt
|
||||
if (IsLegacySHA1Algorithm(algorithm))
|
||||
if (string.IsNullOrWhiteSpace(storedString))
|
||||
{
|
||||
salt = string.Empty;
|
||||
return storedString;
|
||||
throw new ArgumentException("Value cannot be null or whitespace.", nameof(storedString));
|
||||
}
|
||||
|
||||
if (!SupportHashAlgorithm(algorithm))
|
||||
{
|
||||
throw new InvalidOperationException($"{algorithm} is not supported");
|
||||
}
|
||||
|
||||
var saltLen = GenerateSalt();
|
||||
salt = storedString.Substring(0, saltLen.Length);
|
||||
@@ -133,18 +147,18 @@ namespace Umbraco.Cms.Core.Security
|
||||
/// <returns></returns>
|
||||
private string HashPassword(string algorithmType, string pass, string salt)
|
||||
{
|
||||
if (IsLegacySHA1Algorithm(algorithmType))
|
||||
if (!SupportHashAlgorithm(algorithmType))
|
||||
{
|
||||
return HashLegacySHA1Password(pass);
|
||||
throw new InvalidOperationException($"{algorithmType} is not supported");
|
||||
}
|
||||
|
||||
//This is the correct way to implement this (as per the sql membership provider)
|
||||
// This is the correct way to implement this (as per the sql membership provider)
|
||||
|
||||
var bytes = Encoding.Unicode.GetBytes(pass);
|
||||
var saltBytes = Convert.FromBase64String(salt);
|
||||
byte[] inArray;
|
||||
|
||||
var hashAlgorithm = GetHashAlgorithm(algorithmType);
|
||||
using var hashAlgorithm = GetHashAlgorithm(algorithmType);
|
||||
var algorithm = hashAlgorithm as KeyedHashAlgorithm;
|
||||
if (algorithm != null)
|
||||
{
|
||||
@@ -209,42 +223,17 @@ namespace Umbraco.Cms.Core.Security
|
||||
{
|
||||
// This is for the v6-v8 hashing algorithm
|
||||
if (algorithm.InvariantEquals(Constants.Security.AspNetUmbraco8PasswordHashAlgorithmName))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is for the <= v4 hashing algorithm
|
||||
if (IsLegacySHA1Algorithm(algorithm))
|
||||
// Default validation value for old machine keys (switched to HMACSHA256 aspnet 4 https://docs.microsoft.com/en-us/aspnet/whitepapers/aspnet4/breaking-changes)
|
||||
if (algorithm.InvariantEquals("SHA1"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool IsLegacySHA1Algorithm(string algorithm) => algorithm.InvariantEquals(Constants.Security.AspNetUmbraco4PasswordHashAlgorithmName);
|
||||
|
||||
/// <summary>
|
||||
/// Hashes the password with the old v4 algorithm
|
||||
/// </summary>
|
||||
/// <param name="password">The password.</param>
|
||||
/// <returns>The encoded password.</returns>
|
||||
private string HashLegacySHA1Password(string password)
|
||||
{
|
||||
var hashAlgorithm = GetLegacySHA1Algorithm(password);
|
||||
var hash = Convert.ToBase64String(hashAlgorithm.ComputeHash(Encoding.Unicode.GetBytes(password)));
|
||||
return hash;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the old v4 algorithm and settings
|
||||
/// </summary>
|
||||
/// <param name="password"></param>
|
||||
/// <returns></returns>
|
||||
private HashAlgorithm GetLegacySHA1Algorithm(string password)
|
||||
{
|
||||
return new HMACSHA1
|
||||
{
|
||||
//the legacy salt was actually the password :(
|
||||
Key = Encoding.Unicode.GetBytes(password)
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Umbraco.Cms.Core.Services
|
||||
{
|
||||
public interface IExamineIndexCountService
|
||||
{
|
||||
public int GetCount();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
@@ -17,13 +17,6 @@ namespace Umbraco.Cms.Core.Services
|
||||
/// <returns>An <see cref="IMacro"/> object</returns>
|
||||
IMacro GetByAlias(string alias);
|
||||
|
||||
///// <summary>
|
||||
///// Gets a list all available <see cref="IMacro"/> objects
|
||||
///// </summary>
|
||||
///// <param name="aliases">Optional array of aliases to limit the results</param>
|
||||
///// <returns>An enumerable list of <see cref="IMacro"/> objects</returns>
|
||||
//IEnumerable<IMacro> GetAll(params string[] aliases);
|
||||
|
||||
IEnumerable<IMacro> GetAll();
|
||||
|
||||
IEnumerable<IMacro> GetAll(params int[] ids);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services
|
||||
{
|
||||
[Obsolete("This interface will be merged with IMacroService in Umbraco 11")]
|
||||
public interface IMacroWithAliasService : IMacroService
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a list of available <see cref="IMacro"/> objects by alias.
|
||||
/// </summary>
|
||||
/// <param name="aliases">Optional array of aliases to limit the results</param>
|
||||
/// <returns>An enumerable list of <see cref="IMacro"/> objects</returns>
|
||||
IEnumerable<IMacro> GetAll(params string[] aliases);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services
|
||||
{
|
||||
public interface IMetricsConsentService
|
||||
{
|
||||
TelemetryLevel GetConsentLevel();
|
||||
|
||||
void SetConsentLevel(TelemetryLevel telemetryLevel);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services
|
||||
{
|
||||
public interface INodeCountService
|
||||
{
|
||||
int GetNodeCount(Guid nodeType);
|
||||
int GetMediaCount();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.Entities;
|
||||
@@ -215,7 +215,7 @@ namespace Umbraco.Cms.Core.Services
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <param name="totalChildren"></param>
|
||||
/// <returns></returns>
|
||||
/// <returns>An enumerable list of <see cref="IUmbracoEntity"/></returns>
|
||||
IEnumerable<IUmbracoEntity> GetPagedParentEntitiesByChildId(int id, long pageIndex, int pageSize, out long totalChildren, params UmbracoObjectTypes[] entityTypes);
|
||||
|
||||
/// <summary>
|
||||
@@ -225,7 +225,7 @@ namespace Umbraco.Cms.Core.Services
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <param name="totalChildren"></param>
|
||||
/// <returns></returns>
|
||||
/// <returns>An enumerable list of <see cref="IUmbracoEntity"/></returns>
|
||||
IEnumerable<IUmbracoEntity> GetPagedChildEntitiesByParentId(int id, long pageIndex, int pageSize, out long totalChildren, params UmbracoObjectTypes[] entityTypes);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services
|
||||
{
|
||||
public interface ITrackedReferencesService
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a paged result of items which are in relation with the current item.
|
||||
/// Basically, shows the items which depend on the current item.
|
||||
/// </summary>
|
||||
/// <param name="id">The identifier of the entity to retrieve relations for.</param>
|
||||
/// <param name="pageIndex">The page index.</param>
|
||||
/// <param name="pageSize">The page size.</param>
|
||||
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
|
||||
/// <returns>A paged result of <see cref="RelationItem"/> objects.</returns>
|
||||
PagedResult<RelationItem> GetPagedRelationsForItem(int id, long pageIndex, int pageSize, bool filterMustBeIsDependency);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a paged result of the descending items that have any references, given a parent id.
|
||||
/// </summary>
|
||||
/// <param name="parentId">The unique identifier of the parent to retrieve descendants for.</param>
|
||||
/// <param name="pageIndex">The page index.</param>
|
||||
/// <param name="pageSize">The page size.</param>
|
||||
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
|
||||
/// <returns>A paged result of <see cref="RelationItem"/> objects.</returns>
|
||||
PagedResult<RelationItem> GetPagedDescendantsInReferences(int parentId, long pageIndex, int pageSize, bool filterMustBeIsDependency);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a paged result of items used in any kind of relation from selected integer ids.
|
||||
/// </summary>
|
||||
/// <param name="ids">The identifiers of the entities to check for relations.</param>
|
||||
/// <param name="pageIndex">The page index.</param>
|
||||
/// <param name="pageSize">The page size.</param>
|
||||
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
|
||||
/// <returns>A paged result of <see cref="RelationItem"/> objects.</returns>
|
||||
PagedResult<RelationItem> GetPagedItemsWithRelations(int[] ids, long pageIndex, int pageSize, bool filterMustBeIsDependency);
|
||||
}
|
||||
}
|
||||
@@ -58,4 +58,12 @@ namespace Umbraco.Cms.Core.Services
|
||||
/// </summary>
|
||||
Task<IEnumerable<string>> GetEnabledTwoFactorProviderNamesAsync(Guid userOrMemberKey);
|
||||
}
|
||||
|
||||
[Obsolete("This will be merged into ITwoFactorLoginService in Umbraco 11")]
|
||||
public interface ITwoFactorLoginService2 : ITwoFactorLoginService
|
||||
{
|
||||
Task<bool> DisableWithCodeAsync(string providerName, Guid userOrMemberKey, string code);
|
||||
|
||||
Task<bool> ValidateAndSaveAsync(string providerName, Guid userKey, string secret, string code);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user