Skip to content

Commit

Permalink
Project edit (project-openubl#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 authored Dec 31, 2023
1 parent 5a5ecbc commit 5723bed
Show file tree
Hide file tree
Showing 116 changed files with 3,621 additions and 1,581 deletions.
4 changes: 4 additions & 0 deletions openubl/ui/client/config/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ const config: Configuration = {
}),
new CopyPlugin({
patterns: [
{
from: pathTo("../public/locales"),
to: pathTo("../dist/locales"),
},
{
from: pathTo("../public/manifest.json"),
to: pathTo("../dist/manifest.json"),
Expand Down
27 changes: 27 additions & 0 deletions openubl/ui/client/i18next-parser.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* eslint-env node */

module.exports = {
createOldCatalogs: true, // Save the \_old files

indentation: 4, // Indentation of the catalog files

keepRemoved: true, // Keep keys from the catalog that are no longer in code

lexers: {
js: ["JsxLexer"],
ts: ["JsxLexer"],
jsx: ["JsxLexer"],
tsx: ["JsxLexer"],

default: ["JsxLexer"],
},

locales: ["en", "es"],

output: "public/locales/$LOCALE/$NAMESPACE.json",

input: ["src/**/*.{js,jsx,ts,tsx}"],

sort: true,
verbose: true,
};
156 changes: 156 additions & 0 deletions openubl/ui/client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"about": {
"about": "About",
"bottom1": "{{brandType}} is a project within the",
"bottom2": "For more information, refer to",
"description": "{{brandType}} allows users to maintain their portfolio of applications with a full set of metadata and to assess their suitability for modernization leveraging a questionnaire based approach.",
"iconLibrary": "The Icon Library used in this project is a derivative of the <2>Standard Icons library</2> by <5>Red Hat</5>, used under <8>CC BY 4.0</8>",
"introduction": "{{brandType}} is a collection of tools that supports large-scale application modernization and migration projects to Kubernetes."
},
"actions": {
"analysisDetails": "Analysis details",
"analyze": "Analyze",
"assess": "Assess",
"accept": "Accept",
"back": "Back",
"cancel": "Cancel",
"checkDocumentation": "Check documentation",
"clearAllFilters": "Clear all filters",
"clearRepositoryNotSupported": "This action is disabled when RWX volumes are not available",
"close": "Close",
"continue": "Continue",
"copy": "Copy",
"copyAssessment": "Copy assessment",
"copyAssessmentAndReview": "Copy assessment and review",
"create": "Create",
"createNew": "Create new",
"createTag": "Create tag",
"createTagCategory": "Create tag category",
"createTags": "Create tags",
"cancelAnalysis": "Cancel analysis",
"delete": "Delete",
"discardAssessment": "Discard assessment(s)",
"discardReview": "Discard review",

"downloadCsvTemplate": "Download CSV template",
"download": "Download {{what}}",
"duplicate": "Duplicate",
"edit": "Edit",
"export": "Export",
"filterBy": "Filter by {{what}}",
"import": "Import",
"logout": "Logout",
"manageAccount": "User management",
"manageCredentials": "Manage credentials",
"manageDependencies": "Manage dependencies",
"manageImports": "Manage imports",
"next": "Next",
"override": "Override",
"review": "Review",
"save": "Save",
"saveAndReview": "Save and review",
"saveAsDraft": "Save as draft",
"selectAll": "Select all",
"selectNone": "Select none",
"selectPage": "Select page",
"submitReview": "Submit review",
"unlink": "Unlink",
"view": "View",
"viewErrorReport": "View error report",
"viewArchetypes": "View archetypes"
},
"colors": {
"black": "Black",
"blue": "Blue",
"brown": "Brown",
"cyan": "Cyan",
"gold": "Gold",
"gray": "Gray",
"green": "Green",
"lime": "Lime",
"magenta": "Magenta",
"maroon": "Maroon",
"navy": "Navy",
"olive": "Olive",
"orange": "Orange",
"purple": "Purple",
"red": "Red",
"teal": "Teal",
"yellow": "Yellow"
},
"composed": {
"add": "Add {{what}}",
"new": "New {{what}}",
"applicationAssessment": "Application assessment",
"applicationInventory": "Application inventory",
"businessCriticality": "Business criticality (1=low, 10=high)",
"editQuestion": "Edit {{what}}?",
"error": "{{what}} error",
"manage": "Manage {{what}}",
"manageDependenciesFor": "Manage dependencies for {{what}}",
"noDataStateBody": "Create a new {{what}} to start seeing data here.",
"noDataStateTitle": "No {{what}} available",
"Nquestions": "{{n}} questions",
"ofTotalApplications": "Of {{count}} application",
"ofTotalApplications_plural": "Of {{count}} applications",
"ofTotalAssessments": "Of {{count}} assessment",
"ofTotalAssessments_plural": "Of {{count}} assessments",
"selectMany": "Select {{what}}",
"selectOne": "Select a {{what}}",
"selectAn": "Select an {{what}}",
"totalApplications": "{{count}} application",
"totalApplications_plural": "{{count}} applications",
"workPriority": "Work priority (1=low, 10=high)"
},
"dialog": {
"message": {
"applicationsBulkDelete": "The selected application(s) will be deleted.",

"delete": "This action cannot be undone.",
"discardAssessment": "The assessment(s) for <1>{{applicationName}}</1> will be discarded. Do you wish to continue?",
"discardReview": "The review for <1>{{applicationName}}</1> will be discarded. Do you wish to continue?",
"leavePage": "Are you sure you want to leave this page? Be sure to save your changes, or they will be lost.",
"pageError": "Oops! Something went wrong.",
"refreshPage": "Try to refresh your page or contact your admin.",
"maxfileSize": "Max file size of 1MB exceeded. Upload a smaller file.",
"dragAndDropFile": "Drag and drop your file here or upload one.",
"uploadYamlFile": "Upload your YAML file",
"deleteQuestionnaire": "Deleting a questionnaire will cascade into the deletion of all answered questionnaires associated to applications and/or archetypes.",
"confirmDeletion": "Confirm deletion by typing <1>{{nameToDelete}}</1> below:"
},
"title": {
"applicationAnalysis": "Application analysis",
"copyApplicationAssessmentAndReviewFrom": "Copy {{what}} assessment and review",
"copyApplicationAssessmentFrom": "Copy {{what}} assessment",
"delete": "Delete {{what}}?",
"deleteWithName": "Delete {{what}} \"{{name}}\"?",
"discard": "Discard {{what}}?",
"download": "Download {{what}}",
"edit": "Edit {{what}}",
"export": "Export {{what}}",
"importApplicationFile": "Import application file",
"import": "Import {{what}}",
"leavePage": "Leave page",
"leaveAssessment": "Leave assessment",
"new": "New {{what}}",
"newArchetype": "Create new archetype",
"newAssessment": "New assessment",
"newApplication": "New application",
"newBusinessService": "New business service",
"newJobFunction": "New job function",
"newStakeholder": "New stakeholder",
"newStakeholderGroup": "New stakeholder group",
"newTag": "New Tag",
"newTagCategory": "New tag category",
"update": "Update {{what}}",
"updateArchetype": "Update archetype",
"updateApplication": "Update application",
"updateBusinessService": "Update business service",
"updateJobFunction": "Update job function",
"updateStakeholder": "Update stakeholder",
"updateStakeholderGroup": "Update stakeholder group",
"updateTag": "Update tag",
"updateTagCategory": "Update tag category"
}
}
}
76 changes: 76 additions & 0 deletions openubl/ui/client/public/locales/es/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"about": {
"about": "Acerca de",
"bottom1": "{{brandType}} es un proyecto dentro de ",
"bottom2": "Para mayor información por favor diríjase a ",
"description": "{{brandType}} permite a los usuarios mantener su cartera de aplicaciones con un conjunto completo de metadatos y evaluar su idoneidad para la modernización aprovechando un enfoque basado en cuestionarios.",
"iconLibrary": "La biblioteca de iconos utilizada en este proyecto es un derivado de <2>la Biblioteca de iconos estándar</2> de <5>Red Hat</5>, utilizada bajo <8>CC BY 4.0</8>",
"introduction": "{{brandType}} es una colección de herramientas que ayudan en la migración y modernización de aplicaciones a gran escala a Kubernetes."
},
"actions": {
"analysisDetails": "Detalles del análisis",
"analyze": "Analizar",
"assess": "Evaluar",
"back": "Atrás",
"cancel": "Cancelar",
"checkDocumentation": "Verificar documentación",
"clearAllFilters": "Limpiar todos los filtros",
"clearRepositoryNotSupported": "Esta acción está deshabilitada cuando los volúmenes RWX no están disponibles",
"close": "Cerrar",
"continue": "Continuar",
"copy": "Copiar",
"copyAssessment": "Copiar evaluación",
"copyAssessmentAndReview": "Copiar evaluación y revisión",
"create": "Crear",
"createNew": "Crear nuevo",
"createTag": "Crear etiqueta",
"createTagCategory": "Crear categoría de etiqueta",
"createTags": "Create tags",
"delete": "Eliminar",
"discardAssessment": "Descartar evaluación/revisar",
"downloadCsvTemplate": "Descargar plantilla CSV",
"edit": "Editar",
"export": "Exportar",
"filterBy": "Filtrar por {{what}}",
"import": "Importar",
"logout": "Cerrar sesión",
"manageAccount": "Administrar cuenta",
"manageCredentials": "Administrar credenciales",
"manageDependencies": "Administrar dependencias",
"manageImports": "Administrar importaciones",
"next": "Siguiente",
"review": "Revisar",
"save": "Guardar",
"saveAndReview": "Guardar y revisar",
"saveAsDraft": "Guardar como borrador",
"selectAll": "Seleccionar todos",
"selectNone": "Seleccionar ninguno",
"selectPage": "Seleccionar página",
"submitReview": "Enviar revisión",
"viewErrorReport": "Ver reporte"
},
"colors": {
"blue": "Azul",
"cyan": "Cian",
"green": "Verde",
"orange": "Naranja",
"purple": "Morado",
"red": "Rojo",
"yellow": "Amarillo"
},
"composed": {
"add": "Agregar {{what}}",
"applicationAssessment": "Evaluación de la aplicación",
"applicationInventory": "Inventario de aplicaciones",
"businessCriticality": "Criticidad de negocio (1=bajo, 10=alto)",
"editQuestion": "Editar {{what}}?",
"manageDependenciesFor": "Administrar dependencias para {{what}}",
"noDataStateBody": "Cree un(a) nuevo(a) {{what}} para empezar a ver datos acá.",
"noDataStateTitle": "No existen {{what}} disponibles",
"Nquestions": "{{n}} preguntas",
"selectMany": "Seleccione {{what}}",
"selectOne": "Seleccione un {{what}}",
"selectAn": "Seleccione una {{what}}",
"workPriority": "Prioridad de trabajo (1=bajo, 10=alto)"
}
}
2 changes: 1 addition & 1 deletion openubl/ui/client/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BrowserRouter as Router } from "react-router-dom";

import { DefaultLayout } from "./layout";
import { AppRoutes } from "./Routes";
import { NotificationsProvider } from "./shared/components/NotificationsContext";
import { NotificationsProvider } from "./components/NotificationsContext";

import "@patternfly/patternfly/patternfly.css";
import "@patternfly/patternfly/patternfly-addons.css";
Expand Down
2 changes: 2 additions & 0 deletions openubl/ui/client/src/app/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Bullseye, Spinner } from "@patternfly/react-core";

const Home = lazy(() => import("./pages/home"));
const Projects = lazy(() => import("./pages/projects"));
const Documents = lazy(() => import("./pages/documents"));

export const ViewRepositoryRouteParam = "repositoryId";
export const ViewPackageRouteParam = "packageId";
Expand All @@ -13,6 +14,7 @@ export const AppRoutes = () => {
const allRoutes = useRoutes([
{ path: "/", element: <Projects /> },
{ path: "/home", element: <Home /> },
{ path: "/projects/:projectId/documents", element: <Documents /> },
// { path: "*", element: <Navigate to="/organizations" /> },
]);

Expand Down
17 changes: 11 additions & 6 deletions openubl/ui/client/src/app/api/models.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
export enum MimeType {
TAR = "tar",
YAML = "yaml",
}

/** Mark an object as "New" therefore does not have an `id` field. */
export type New<T extends { id: number }> = Omit<T, "id">;
export type Only<T extends { id: number }> = Pick<T, "id">;

export interface ApiFilter {
export interface HubFilter {
field: string;
operator?: "=" | "!=" | "~" | ">" | ">=" | "<" | "<=";
value:
Expand All @@ -13,8 +18,8 @@ export interface ApiFilter {
};
}

export interface ApiRequestParams {
filters?: ApiFilter[];
export interface HubRequestParams {
filters?: HubFilter[];
sort?: {
field: string;
direction: "asc" | "desc";
Expand All @@ -25,10 +30,10 @@ export interface ApiRequestParams {
};
}

export interface ApiPaginatedResult<T> {
export interface HubPaginatedResult<T> {
data: T[];
total: number;
params: ApiRequestParams;
params: HubRequestParams;
}

//
Expand Down
14 changes: 7 additions & 7 deletions openubl/ui/client/src/app/api/rest.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import axios from "axios";
import { ApiPaginatedResult, ApiRequestParams, New, Project } from "./models";
import { serializeRequestParamsForApi } from "@app/shared/hooks/table-controls";
import { HubPaginatedResult, HubRequestParams, New, Project } from "./models";
import { serializeRequestParamsForHub } from "@app/hooks/table-controls";

const API = "/hub";
const HUB = "/hub";

export const PROJECTS = API + "/projects";
export const PROJECTS = HUB + "/projects";

interface ApiSearchResult<T> {
total: number;
Expand All @@ -13,11 +13,11 @@ interface ApiSearchResult<T> {

export const getApiPaginatedResult = <T>(
url: string,
params: ApiRequestParams = {}
): Promise<ApiPaginatedResult<T>> =>
params: HubRequestParams = {}
): Promise<HubPaginatedResult<T>> =>
axios
.get<ApiSearchResult<T>>(url, {
params: serializeRequestParamsForApi(params),
params: serializeRequestParamsForHub(params),
})
.then(({ data }) => ({
data: data.data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const AppTableActionButtons: React.FC<AppTableActionButtonsProps> = ({
onClick={onDelete}
isAriaDisabled={isDeleteEnabled}
>
Delete
Eliminar
</Button>
</ConditionalTooltip>
</FlexItem>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5723bed

Please sign in to comment.