From e35bbdc9eae5cab173484bd1c6e0535a0bb10943 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 5 Nov 2024 18:51:46 -0800 Subject: [PATCH] doc(Tab): update NotAuthorized parameter documentation (#4613) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc: 增加 404 重定向 * feat(Tab): 移除 NotAuthorized/NotFound 参数 * feat(Layout): 移除 NotAuthorized/NotFound 参数 * Revert "feat(Layout): 移除 NotAuthorized/NotFound 参数" This reverts commit f5e5f49583998913d531474a01c4afa99126042c. * Revert "feat(Tab): 移除 NotAuthorized/NotFound 参数" This reverts commit df041c745b47a72b45c6f2c541b858333cffe1b3. * refactor: 更新参数文档 * refactor: 更新私有变量 * refactor: 代码格式化 * Revert "chore(Qodana): add qodana CI checks (#4610)" This reverts commit 52449392b0826f0679123c5748e12e7762aee6b6. --- .github/workflows/qodana_code_quality.yml | 28 ------------------- qodana.yaml | 6 ---- .../Components/Layout/Layout.razor | 9 +++--- .../Components/Layout/Layout.razor.cs | 10 +++---- .../Components/Tab/Tab.razor.cs | 18 ++++++------ 5 files changed, 18 insertions(+), 53 deletions(-) delete mode 100644 .github/workflows/qodana_code_quality.yml delete mode 100644 qodana.yaml diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml deleted file mode 100644 index 8084deeda..000000000 --- a/.github/workflows/qodana_code_quality.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Qodana -on: - workflow_dispatch: - pull_request: - push: - branches: # Specify your branches here - - main # The 'main' branch - - 'releases/*' # The release branches - -jobs: - qodana: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - checks: write - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit - fetch-depth: 0 # a full history is required for pull request analysis - - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2024.1 - with: - pr-mode: false - env: - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_1246412647 }} - QODANA_ENDPOINT: 'https://qodana.cloud' \ No newline at end of file diff --git a/qodana.yaml b/qodana.yaml deleted file mode 100644 index 2a42d2ff4..000000000 --- a/qodana.yaml +++ /dev/null @@ -1,6 +0,0 @@ -version: "1.0" -linter: jetbrains/qodana-dotnet:2024.1 -profile: - name: qodana.recommended -include: - - name: CheckDependencyLicenses \ No newline at end of file diff --git a/src/BootstrapBlazor/Components/Layout/Layout.razor b/src/BootstrapBlazor/Components/Layout/Layout.razor index dda85eee0..76eedc351 100644 --- a/src/BootstrapBlazor/Components/Layout/Layout.razor +++ b/src/BootstrapBlazor/Components/Layout/Layout.razor @@ -3,7 +3,7 @@ @attribute [BootstrapModuleAutoLoader(JSObjectReference = true)] - @if (IsInit) + @if (_init) { @if (IsAuthenticated) { @@ -118,11 +118,10 @@ @
@if (UseTabSet) { - + Body="@Main" NotAuthorized="NotAuthorized!" NotFound="NotFound!" NotFoundTabText="@NotFoundTabText"> } else diff --git a/src/BootstrapBlazor/Components/Layout/Layout.razor.cs b/src/BootstrapBlazor/Components/Layout/Layout.razor.cs index 3ede660f8..229d57792 100644 --- a/src/BootstrapBlazor/Components/Layout/Layout.razor.cs +++ b/src/BootstrapBlazor/Components/Layout/Layout.razor.cs @@ -67,19 +67,19 @@ public partial class Layout : IHandlerException public RenderFragment? Side { get; set; } /// - /// 获得/设置 NotAuthorized 模板 + /// 获得/设置 NotAuthorized 模板 默认 null NET6.0/7.0 有效 /// [Parameter] public RenderFragment? NotAuthorized { get; set; } /// - /// 获得/设置 NotFound 模板 + /// 获得/设置 NotFound 模板 默认 null NET6.0/7.0 有效 /// [Parameter] public RenderFragment? NotFound { get; set; } /// - /// 获得/设置 NotFound 标签文本 + /// 获得/设置 NotFound 标签文本 默认 null NET6.0/7.0 有效 /// [Parameter] [NotNull] @@ -337,7 +337,7 @@ public partial class Layout : IHandlerException [Inject] private IAuthorizationService? AuthorizationService { get; set; } - private bool IsInit { get; set; } + private bool _init { get; set; } /// /// @@ -387,7 +387,7 @@ public partial class Layout : IHandlerException IsAuthenticated = true; } - IsInit = true; + _init = true; } /// diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs index a2d172d22..c7d8e8136 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs @@ -137,17 +137,24 @@ public partial class Tab : IHandlerException public RenderFragment? ChildContent { get; set; } /// - /// 获得/设置 NotAuthorized 模板 + /// 获得/设置 NotAuthorized 模板 默认 null NET6.0/7.0 有效 /// [Parameter] public RenderFragment? NotAuthorized { get; set; } /// - /// 获得/设置 NotFound 模板 + /// 获得/设置 NotFound 模板 默认 null NET6.0/7.0 有效 /// [Parameter] public RenderFragment? NotFound { get; set; } + /// + /// 获得/设置 NotFound 标签文本 默认 null NET6.0/7.0 有效 + /// + [Parameter] + [NotNull] + public string? NotFoundTabText { get; set; } + /// /// 获得/设置 TabItems 模板 /// @@ -179,13 +186,6 @@ public partial class Tab : IHandlerException [Parameter] public Func? OnClickTabItemAsync { get; set; } - /// - /// 获得/设置 NotFound 标签文本 - /// - [Parameter] - [NotNull] - public string? NotFoundTabText { get; set; } - /// /// 获得/设置 关闭当前 TabItem 菜单文本 ///