From 800c3a497e9b256b508c4fec329fcd188c3bd326 Mon Sep 17 00:00:00 2001 From: Anil Vishnoi Date: Fri, 27 Sep 2024 02:29:53 -0700 Subject: [PATCH 1/2] Fix knowledge contribution submission Signed-off-by: Anil Vishnoi --- src/components/Contribute/Knowledge/index.tsx | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/Contribute/Knowledge/index.tsx b/src/components/Contribute/Knowledge/index.tsx index 547995e6..881866f8 100644 --- a/src/components/Contribute/Knowledge/index.tsx +++ b/src/components/Contribute/Knowledge/index.tsx @@ -225,46 +225,46 @@ export const KnowledgeForm: React.FunctionComponent = ({ kno const contextStr = context.trim(); if (contextStr.length == 0) { setDisableAction(true); - return { errorMsg: 'Context is required', context: ValidatedOptions.error }; + return { msg: 'Context is required', status: ValidatedOptions.error }; } const tokens = contextStr.split(/\s+/); if (tokens.length > 0 && tokens.length <= 500) { setDisableAction(!checkKnowledgeFormCompletion(knowledgeFormData)); - return { errorMsg: '', context: ValidatedOptions.success }; + return { msg: 'Valid Input', status: ValidatedOptions.success }; } setDisableAction(true); const errorMsg = 'Context must be less than 500 words. Current word count: ' + tokens.length; - return { errorMsg: errorMsg, context: ValidatedOptions.error }; + return { msg: errorMsg, status: ValidatedOptions.error }; }; const validateQuestion = (question: string) => { const questionStr = question.trim(); if (questionStr.length == 0) { setDisableAction(true); - return { errorMsg: 'Question is required', context: ValidatedOptions.error }; + return { msg: 'Question is required', status: ValidatedOptions.error }; } const tokens = questionStr.split(/\s+/); if (tokens.length > 0 && tokens.length < 250) { setDisableAction(!checkKnowledgeFormCompletion(knowledgeFormData)); - return { errorMsg: '', context: ValidatedOptions.success }; + return { msg: 'Valid input', status: ValidatedOptions.success }; } setDisableAction(true); - return { errorMsg: 'Question must be less than 250 words. Current word count: ' + tokens.length, context: ValidatedOptions.error }; + return { msg: 'Question must be less than 250 words. Current word count: ' + tokens.length, status: ValidatedOptions.error }; }; const validateAnswer = (answer: string) => { const answerStr = answer.trim(); if (answerStr.length == 0) { setDisableAction(true); - return { errorMsg: 'Answer is required', context: ValidatedOptions.error }; + return { msg: 'Answer is required', status: ValidatedOptions.error }; } const tokens = answerStr.split(/\s+/); if (tokens.length > 0 && tokens.length < 250) { setDisableAction(!checkKnowledgeFormCompletion(knowledgeFormData)); - return { errorMsg: '', context: ValidatedOptions.success }; + return { msg: 'Valid input', status: ValidatedOptions.success }; } setDisableAction(true); - return { errorMsg: 'Answer must be less than 250 words. Current word count: ' + tokens.length, context: ValidatedOptions.error }; + return { msg: 'Answer must be less than 250 words. Current word count: ' + tokens.length, status: ValidatedOptions.error }; }; const handleContextInputChange = (seedExampleIndex: number, contextValue: string): void => { @@ -283,11 +283,11 @@ export const KnowledgeForm: React.FunctionComponent = ({ kno const handleContextBlur = (seedExampleIndex: number): void => { const updatedSeedExamples = seedExamples.map((seedExample: SeedExample, index: number): SeedExample => { if (index === seedExampleIndex) { - const { errorMsg, context } = validateContext(seedExample.context); + const { msg, status } = validateContext(seedExample.context); return { ...seedExample, - isContextValid: context, - validationError: errorMsg + isContextValid: status, + validationError: msg }; } return seedExample; @@ -323,11 +323,11 @@ export const KnowledgeForm: React.FunctionComponent = ({ kno ...seedExample, questionAndAnswers: seedExample.questionAndAnswers.map((questionAndAnswerPair: QuestionAndAnswerPair, index: number) => { if (index === questionAndAnswerIndex) { - const { errorMsg, context } = validateQuestion(questionAndAnswerPair.question); + const { msg, status } = validateQuestion(questionAndAnswerPair.question); return { ...questionAndAnswerPair, - isQuestionValid: context, - questionValidationError: errorMsg + isQuestionValid: status, + questionValidationError: msg }; } return questionAndAnswerPair; @@ -366,11 +366,11 @@ export const KnowledgeForm: React.FunctionComponent = ({ kno ...seedExample, questionAndAnswers: seedExample.questionAndAnswers.map((questionAndAnswerPair: QuestionAndAnswerPair, index: number) => { if (index === questionAndAnswerIndex) { - const { errorMsg, context } = validateAnswer(questionAndAnswerPair.answer); + const { msg, status } = validateAnswer(questionAndAnswerPair.answer); return { ...questionAndAnswerPair, - isAnswerValid: context, - answerValidationError: errorMsg + isAnswerValid: status, + answerValidationError: msg }; } return questionAndAnswerPair; From 508699a771dd8eaa610f2e1663234a67f72aeace Mon Sep 17 00:00:00 2001 From: Anil Vishnoi Date: Fri, 27 Sep 2024 02:30:58 -0700 Subject: [PATCH 2/2] Use the latest image. Latest tag points to the latest release Signed-off-by: Anil Vishnoi --- deploy/k8s/overlays/openshift/prod/kustomization.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/k8s/overlays/openshift/prod/kustomization.yaml b/deploy/k8s/overlays/openshift/prod/kustomization.yaml index 64526af1..a8b11371 100644 --- a/deploy/k8s/overlays/openshift/prod/kustomization.yaml +++ b/deploy/k8s/overlays/openshift/prod/kustomization.yaml @@ -36,7 +36,7 @@ patches: patch: |- - op: replace path: /spec/template/spec/containers/0/image - value: quay.io/instructlab-ui/ui:v1.0.0-beta # Override this image if you want to use a different UI image + value: quay.io/instructlab-ui/ui:latest #Override this image if you want to use a different UI image # Override the pathservice image for Openshift production deployment - target: @@ -45,4 +45,4 @@ patches: patch: |- - op: replace path: /spec/template/spec/containers/0/image - value: quay.io/instructlab-ui/pathservice:v1.0.0-beta # Override this image if you want to use a different pathservice image + value: quay.io/instructlab-ui/pathservice:latest #Override this image if you want to use a different pathservice image