Add feedback links to footer (#2125)

Add feedback links in "Support" section of the footer. The links refer to the creation of a new topic in the SCMM section of the forum.
This commit is contained in:
Florian Scholdei
2022-09-27 16:18:03 +02:00
committed by GitHub
parent 74702591ed
commit 89386928b6
9 changed files with 170 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
- type: added
description: Feedback links to footer ([#2125](https://github.com/scm-manager/scm-manager/pull/2125))

View File

@@ -1677,6 +1677,26 @@ exports[`Storyshots Footer Default 1`] = `
footer.support.enterprise
</a>
</li>
<li>
<a
className=""
href="https://community.cloudogu.com/new-topic?category=scm-manager/bug-reports-scmm"
rel="noopener noreferrer"
target="_blank"
>
footer.support.bugReport
</a>
</li>
<li>
<a
className=""
href="https://community.cloudogu.com/new-topic?category=scm-manager/feature-requests-scmm"
rel="noopener noreferrer"
target="_blank"
>
footer.support.featureRequest
</a>
</li>
</ul>
</section>
</div>
@@ -1843,6 +1863,26 @@ exports[`Storyshots Footer Full 1`] = `
footer.support.enterprise
</a>
</li>
<li>
<a
className=""
href="https://community.cloudogu.com/new-topic?category=scm-manager/bug-reports-scmm"
rel="noopener noreferrer"
target="_blank"
>
footer.support.bugReport
</a>
</li>
<li>
<a
className=""
href="https://community.cloudogu.com/new-topic?category=scm-manager/feature-requests-scmm"
rel="noopener noreferrer"
target="_blank"
>
footer.support.featureRequest
</a>
</li>
<li>
<a
className=""
@@ -1990,6 +2030,26 @@ exports[`Storyshots Footer With Avatar 1`] = `
footer.support.enterprise
</a>
</li>
<li>
<a
className=""
href="https://community.cloudogu.com/new-topic?category=scm-manager/bug-reports-scmm"
rel="noopener noreferrer"
target="_blank"
>
footer.support.bugReport
</a>
</li>
<li>
<a
className=""
href="https://community.cloudogu.com/new-topic?category=scm-manager/feature-requests-scmm"
rel="noopener noreferrer"
target="_blank"
>
footer.support.featureRequest
</a>
</li>
</ul>
</section>
</div>
@@ -2148,6 +2208,26 @@ exports[`Storyshots Footer With Plugin Links 1`] = `
footer.support.enterprise
</a>
</li>
<li>
<a
className=""
href="https://community.cloudogu.com/new-topic?category=scm-manager/bug-reports-scmm"
rel="noopener noreferrer"
target="_blank"
>
footer.support.bugReport
</a>
</li>
<li>
<a
className=""
href="https://community.cloudogu.com/new-topic?category=scm-manager/feature-requests-scmm"
rel="noopener noreferrer"
target="_blank"
>
footer.support.featureRequest
</a>
</li>
<li>
<a
className=""

View File

@@ -22,7 +22,8 @@
* SOFTWARE.
*/
import React, { FC } from "react";
import { Links, Me } from "@scm-manager/ui-types";
import { Feedback, Links, Me } from "@scm-manager/ui-types";
import { useIndex } from "@scm-manager/ui-api";
import { ExtensionPoint, extensionPoints, useBinder } from "@scm-manager/ui-extensions";
import { AvatarImage } from "../avatar";
import NavLink from "../navigation/NavLink";
@@ -80,6 +81,7 @@ const TitleWithAvatar: FC<TitleWithAvatarProps> = ({ me }) => (
const Footer: FC<Props> = ({ me, version, links }) => {
const [t] = useTranslation("commons");
const binder = useBinder();
const index = useIndex();
const extensionProps = { me, url: "/me", links };
let meSectionTile;
@@ -124,6 +126,18 @@ const Footer: FC<Props> = ({ me, version, links }) => {
to="https://cloudogu.com/en/scm-manager-enterprise/"
label={t("footer.support.enterprise")}
/>
{!(index.data?._embedded?.feedback as Feedback)?.disabled ? (
<>
<ExternalNavLink
to="https://community.cloudogu.com/new-topic?category=scm-manager/bug-reports-scmm"
label={t("footer.support.bugReport")}
/>
<ExternalNavLink
to="https://community.cloudogu.com/new-topic?category=scm-manager/feature-requests-scmm"
label={t("footer.support.featureRequest")}
/>
</>
) : null}
<ExtensionPoint name="footer.support" props={extensionProps} renderAll={true} />
</FooterSection>
</div>

View File

@@ -0,0 +1,29 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import { HalRepresentation } from "./hal";
export type Feedback = HalRepresentation & {
disabled: boolean;
};

View File

@@ -74,3 +74,4 @@ export * from "./GlobalPermissions";
export * from "./Search";
export * from "./General";
export * from "./ContentType";
export * from "./Feedback";

View File

@@ -141,7 +141,9 @@
"support": {
"title": "Support",
"community": "Community",
"enterprise": "Enterprise"
"enterprise": "Enterprise",
"bugReport": "Bug Report",
"featureRequest": "Feature Request"
}
},
"commaSeparatedList": {

View File

@@ -142,7 +142,9 @@
"support": {
"title": "Support",
"community": "Community",
"enterprise": "Enterprise"
"enterprise": "Enterprise",
"bugReport": "Bug Report",
"featureRequest": "Feature Request"
}
},
"commaSeparatedList": {

View File

@@ -0,0 +1,35 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package sonia.scm.api.v2.resources;
import de.otto.edison.hal.HalRepresentation;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public class FeedbackDto extends HalRepresentation {
private boolean disabled;
}

View File

@@ -86,6 +86,8 @@ public class IndexDtoGenerator extends HalAppenderMapper {
builder.self(resourceLinks.index().self());
builder.single(link("uiPlugins", resourceLinks.uiPluginCollection().self()));
embeddedBuilder.with("feedback", new FeedbackDto(Boolean.getBoolean("sonia.scm.disableFeedback")));
if (initializationFinisher.isFullyInitialized()) {
return handleNormalIndex(builder, embeddedBuilder);
} else {