Skip to content

Commit

Permalink
Add missing usage of appVersion in a docs link (#2135)
Browse files Browse the repository at this point in the history
* Add missing usage of appVersion in a docs link

* Add missing appVersion in a docs link from state

Instead of passing trough different components, it gets the appVersion directly from state.
  • Loading branch information
antgamdia committed Nov 5, 2020
1 parent 75fed4b commit 0909220
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions dashboard/src/components/Config/AppRepoList/AppRepoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,8 @@ const AUTH_METHOD_BASIC = "basic";
const AUTH_METHOD_BEARER = "bearer";
const AUTH_METHOD_CUSTOM = "custom";

export function AppRepoForm({
onSubmit,
onAfterInstall,
namespace,
kubeappsNamespace,
repo,
secret,
}: IAppRepoFormProps) {
export function AppRepoForm(props: IAppRepoFormProps) {
const { onSubmit, onAfterInstall, namespace, kubeappsNamespace, repo, secret } = props;
const dispatch: ThunkDispatch<IStoreState, null, Action> = useDispatch();

const [authMethod, setAuthMethod] = useState(AUTH_METHOD_NONE);
Expand All @@ -59,10 +53,13 @@ export function AppRepoForm({
const [validated, setValidated] = useState(undefined as undefined | boolean);

const {
imagePullSecrets,
errors: { create: createError, update: updateError, validate: validationError },
validating,
} = useSelector((state: IStoreState) => state.repos);
repos: {
imagePullSecrets,
errors: { create: createError, update: updateError, validate: validationError },
validating,
},
config: { appVersion },
} = useSelector((state: IStoreState) => state);

useEffect(() => {
// Select the pull secrets if they are already selected in the existing repo
Expand Down Expand Up @@ -388,7 +385,7 @@ export function AppRepoForm({
Select existing secret(s) to access a private Docker registry and pull images from it.
Note that this functionality is supported for Kubeapps with Helm3 only, more info{" "}
<a
href="https://github.com/kubeapps/kubeapps/blob/master/docs/user/private-app-repository.md"
href={`https://github.com/kubeapps/kubeapps/blob/${appVersion}/docs/user/private-app-repository.md`}
target="_blank"
rel="noopener noreferrer"
>
Expand Down Expand Up @@ -432,7 +429,7 @@ export function AppRepoForm({
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/kubeapps/kubeapps/blob/master/docs/user/private-app-repository.md#modifying-the-synchronization-job"
href={`https://github.com/kubeapps/kubeapps/blob/${appVersion}/docs/user/private-app-repository.md#modifying-the-synchronization-job`}
>
here
</a>
Expand Down

0 comments on commit 0909220

Please sign in to comment.