Skip to content

Commit 14de63a

Browse files
committed
- Added new CustomBlockBox DTO
1 parent d9ffc59 commit 14de63a

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by the Rock.CodeGeneration project
4+
// Changes to this file will be lost when the code is regenerated.
5+
// </auto-generated>
6+
//------------------------------------------------------------------------------
7+
// <copyright>
8+
// Copyright by the Spark Development Network
9+
//
10+
// Licensed under the Rock Community License (the "License");
11+
// you may not use this file except in compliance with the License.
12+
// You may obtain a copy of the License at
13+
//
14+
// http://www.rockrms.com/license
15+
//
16+
// Unless required by applicable law or agreed to in writing, software
17+
// distributed under the License is distributed on an "AS IS" BASIS,
18+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
// See the License for the specific language governing permissions and
20+
// limitations under the License.
21+
// </copyright>
22+
//
23+
24+
/**
25+
* A box that contains the required information to render a custom
26+
* block component in the rare case that a block does not conform
27+
* to an Entity.
28+
*/
29+
export type CustomBlockBox<TCustomBag, TOptions> = {
30+
/** Gets or sets a custom bag of data required by the block. */
31+
bag?: TCustomBag | null;
32+
33+
/**
34+
* Gets or sets the error message. A non-empty value indicates that
35+
* an error is preventing the block from being displayed.
36+
*/
37+
errorMessage?: string | null;
38+
39+
/** Gets or sets the navigation urls. */
40+
navigationUrls?: Record<string, string> | null;
41+
42+
/** Gets or sets the block properties and common data options. */
43+
options?: TOptions | null;
44+
45+
/** Gets or sets the security grant token. */
46+
securityGrantToken?: string | null;
47+
};
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// <copyright>
2+
// Copyright by the Spark Development Network
3+
//
4+
// Licensed under the Rock Community License (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.rockrms.com/license
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
// </copyright>
16+
//
17+
18+
namespace Rock.ViewModels.Blocks
19+
{
20+
/// <summary>
21+
/// A box that contains the required information to render a custom
22+
/// block component in the rare case that a block does not conform
23+
/// to an Entity.
24+
/// </summary>
25+
/// <typeparam name="TCustomBag">The type of the settings property.</typeparam>
26+
/// <typeparam name="TOptions">The type of the options property.</typeparam>
27+
public class CustomBlockBox<TCustomBag, TOptions> : BlockBox
28+
where TOptions : new()
29+
{
30+
/// <summary>
31+
/// Gets or sets a custom bag of data required by the block.
32+
/// </summary>
33+
/// <value>The data.</value>
34+
public TCustomBag Bag { get; set; }
35+
36+
/// <summary>
37+
/// Gets or sets the block properties and common data options.
38+
/// </summary>
39+
/// <value>The options.</value>
40+
public TOptions Options { get; set; } = new TOptions();
41+
}
42+
}

0 commit comments

Comments
 (0)