Skip to content

Commit

Permalink
Merge pull request openshift-pipelines#68 from vikram-raj/rename-plug…
Browse files Browse the repository at this point in the history
…in-name

OCPBUGS-29362: Rename plugin to pipelines-console-plugin and update descriptions
  • Loading branch information
openshift-merge-bot[bot] authored Feb 13, 2024
2 parents cee2b4f + 903107d commit 90a33ab
Show file tree
Hide file tree
Showing 23 changed files with 38 additions and 38 deletions.
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cd console
# the first time you need to build the backend and frontend with ./build.sh
# oc login...
# source ./contrib/oc-environment.sh
./bin/bridge -plugins "pipeline-console-plugin=http://localhost:9001"
./bin/bridge -plugins "pipelines-console-plugin=http://localhost:9001"
```

### Option 2: Local development, running a console as container
Expand Down Expand Up @@ -79,7 +79,7 @@ cached containers will help you start developing in seconds.
1. Create a `dev.env` file inside the `.devcontainer` folder with the correct values for your cluster:

```bash
OC_PLUGIN_NAME=pipeline-console-plugin
OC_PLUGIN_NAME=pipelines-console-plugin
OC_URL=https://api.example.com:6443
OC_USER=kubeadmin
OC_PASS=<password>
Expand Down Expand Up @@ -142,20 +142,20 @@ NOTE: When defining i18n namespace, adhere `plugin__<name-of-the-plugin>` format

The plugin use [react-i18next](https://react.i18next.com/) to translate messages.
The i18n namespace must match the name of the `ConsolePlugin` resource with the `plugin__` prefix to avoid
naming conflicts. For this plugin this means `plugin__pipeline-console-plugin`.
naming conflicts. For this plugin this means `plugin__pipelines-console-plugin`.

All translation calls like the `useTranslation` hook must use this namespace as follows:

```tsx
conster Header: React.FC = () => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
return <h1>{t('Hello, World!')}</h1>;
};
```

For labels in `console-extensions.json`, you can use the format
`%plugin__pipeline-console-plugin~My Label%`. Console will replace the value with
the message for the current language from the `plugin__pipeline-console-plugin`
`%plugin__pipelines-console-plugin~My Label%`. Console will replace the value with
the message for the current language from the `plugin__pipelines-console-plugin`
namespace. For example:

```json
Expand All @@ -165,7 +165,7 @@ namespace. For example:
"id": "pipelines-overview",
"perspective": "admin",
"section": "pipelines",
"name": "%plugin__pipeline-console-plugin~Overview%"
"name": "%plugin__pipelines-console-plugin~Overview%"
}
}
```
Expand Down
12 changes: 6 additions & 6 deletions console-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"kind": "TektonResult"
},
"color": "#38812f",
"label": "%plugin__pipeline-console-plugin~TektonResult%",
"labelPlural": "%plugin__pipeline-console-plugin~TektonResults%",
"label": "%plugin__pipelines-console-plugin~TektonResult%",
"labelPlural": "%plugin__pipelines-console-plugin~TektonResults%",
"abbr": "TR"
}
},
Expand All @@ -22,8 +22,8 @@
"kind": "Pipeline"
},
"color": "#38812f",
"label": "%plugin__pipeline-console-plugin~Pipeline%",
"labelPlural": "%plugin__pipeline-console-plugin~Pipelines%",
"label": "%plugin__pipelines-console-plugin~Pipeline%",
"labelPlural": "%plugin__pipelines-console-plugin~Pipelines%",
"abbr": "PL"
}
},
Expand All @@ -36,8 +36,8 @@
"kind": "Pipeline"
},
"color": "#38812f",
"label": "%plugin__pipeline-console-plugin~Pipeline%",
"labelPlural": "%plugin__pipeline-console-plugin~Pipelines%",
"label": "%plugin__pipelines-console-plugin~Pipeline%",
"labelPlural": "%plugin__pipelines-console-plugin~Pipelines%",
"abbr": "PL"
}
},
Expand Down
2 changes: 1 addition & 1 deletion i18next-parser.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
locales: ['en'],
namespaceSeparator: '~',
reactNamespace: false,
defaultNamespace: 'plugin__pipeline-console-plugin',
defaultNamespace: 'plugin__pipelines-console-plugin',
useKeysAsDefaultValue: true,

// see below for more details
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "pipeline-console-plugin",
"name": "pipelines-console-plugin",
"version": "0.0.1",
"private": true,
"repository": "[email protected]:openshift-pipelines/console-plugin.git",
Expand Down Expand Up @@ -83,10 +83,10 @@
"webpack-dev-server": "^4.7.4"
},
"consolePlugin": {
"name": "pipeline-console-plugin",
"name": "pipelines-console-plugin",
"version": "0.0.1",
"displayName": "OpenShift pipeline console plugin",
"description": "Plugin for Openshift console.",
"displayName": "Pipelines console plugin",
"description": "OpenShift Pipelines UI plugin for OpenShift web console",
"exposedModules": {
"hookProvider": "./components/hooks",
"pipelinesComponent": "./components/pipelines-overview",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const PipelinesAverageDuration: React.FC<PipelinesAverageDurationProps> = ({
namespace,
kind,
}) => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
const [data, setData] = React.useState<SummaryResponse>();
const startTimespan = timespan - parsePrometheusDuration('1d');
const endDate = new Date(Date.now()).setHours(0, 0, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/components/pipelines-overview/NamespaceDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const NameSpaceDropdown: React.FC<NameSpaceDropdownProps> = ({
selected,
setSelected,
}) => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
const [isOpen, setValue] = React.useState(false);
const toggleIsOpen = React.useCallback(() => setValue((v) => !v), []);
const setClosed = React.useCallback(() => setValue(false), []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const PipelinesRunsDurationCard: React.FC<PipelinesRunsDurationProps> = ({
bordered,
kind,
}) => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
const [summaryData, setSummaryData] = React.useState<SummaryProps>({});
const [loaded, setLoaded] = React.useState(false);
if (namespace == ALL_NAMESPACES_KEY) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const PipelinesRunsNumbersChart: React.FC<PipelinesRunsNumbersChartProps> = ({
bordered,
kind,
}) => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
const startTimespan = timespan - parsePrometheusDuration('1d');
const endDate = new Date(Date.now()).setHours(0, 0, 0, 0);
const startDate = new Date(Date.now() - startTimespan).setHours(0, 0, 0, 0);
Expand Down
4 changes: 2 additions & 2 deletions src/components/pipelines-overview/PipelineRunsStatusCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const getChartData = (
y: number;
name: string;
}[] => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
const k = key.toLowerCase();
const chartData = tickValues?.map((value) => {
const s = data?.summary?.find((d) => {
Expand Down Expand Up @@ -95,7 +95,7 @@ const PipelinesRunsStatusCard: React.FC<PipelinesRunsStatusCardProps> = ({
parentName,
kind,
}) => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
const [data, setData] = React.useState<SummaryResponse>();
const [data2, setData2] = React.useState<SummaryResponse>();
const [loaded, setLoaded] = React.useState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const PipelinesRunsTotalCard: React.FC<PipelinesRunsDurationProps> = ({
interval,
bordered,
}) => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');

const [totalRun, setTotalRun] = React.useState(0);
const [plrRun, setPlrRun] = React.useState(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { useHistory } from 'react-router-dom';
import { useActiveNamespace } from '../hooks/useActiveNamespace';

const PipelinesOverviewPage: React.FC = () => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
const [activeNamespace] = useActiveNamespace();
const dispatch = useDispatch();
const history = useHistory();
Expand Down
2 changes: 1 addition & 1 deletion src/components/pipelines-overview/RefreshDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const RefreshDropdown: React.FC<RefreshDropdownProps> = ({
interval,
setInterval,
}) => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
return (
<div className="form-group">
<label htmlFor="pipeline-refresh-interval-dropdown">
Expand Down
2 changes: 1 addition & 1 deletion src/components/pipelines-overview/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const SearchInputField: React.FC<SearchInputProps> = ({
handleNameChange,
searchText,
}) => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
return (
<SearchInput
value={searchText}
Expand Down
2 changes: 1 addition & 1 deletion src/components/pipelines-overview/TimeRangeDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const TimeRangeDropdown: React.FC<TimeRangeDropdownProps> = ({
(v: string) => setTimespan(parsePrometheusDuration(v)),
[setTimespan],
);
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
const timeRangeOptions = TimeRangeOptions();
return (
<div className="form-group">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type PipelineRunsForPipelinesListProps = {
const PipelineRunsForPipelinesList: React.FC<
PipelineRunsForPipelinesListProps
> = ({ summaryData, summaryDataFiltered, loaded }) => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
const EmptyMsg = () => (
<EmptyState variant={EmptyStateVariant.large}>
{t('No PipelineRuns found')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type PipelineRunsForRepositoriesListProps = {
const PipelineRunsForRepositoriesList: React.FC<
PipelineRunsForRepositoriesListProps
> = ({ summaryData, summaryDataFiltered, loaded }) => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
const EmptyMsg = () => (
<EmptyState variant={EmptyStateVariant.large}>
{t('No PipelineRuns found')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const PipelineRunsListPage: React.FC<PipelineRunsListPageProps> = ({
timespan,
interval,
}) => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
const [pageFlag, setPageFlag] = React.useState(1);
const [loaded, setloaded] = React.useState(false);
const [summaryData, setSummaryData] = React.useState<SummaryProps[]>([]);
Expand Down
6 changes: 3 additions & 3 deletions src/components/pipelines-overview/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const listPageTableColumnClasses = [
];

export const TimeRangeOptions = () => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
return {
'1d': t('Last day'),
'2w': t('Last weeks'),
Expand All @@ -59,7 +59,7 @@ export const TimeRangeOptions = () => {
};

export const StatusOptions = () => {
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
return {
Succeeded: t('Succeeded'),
Failed: t('Failed'),
Expand All @@ -71,7 +71,7 @@ export const StatusOptions = () => {

export const IntervalOptions = () => {
const OFF_KEY = 'OFF_KEY';
const { t } = useTranslation('plugin__pipeline-console-plugin');
const { t } = useTranslation('plugin__pipelines-console-plugin');
return {
[OFF_KEY]: t('Refresh off'),
'15s': t('{{count}} second', { count: 15 }),
Expand Down
6 changes: 3 additions & 3 deletions src/models.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { chart_color_green_400 as tektonGroupColor } from '@patternfly/react-tokens/dist/js/chart_color_green_400';
import { K8sKind } from '@openshift-console/dynamic-plugin-sdk';
import { chart_color_green_400 as tektonGroupColor } from '@patternfly/react-tokens/dist/js/chart_color_green_400';

const color = tektonGroupColor.value;

Expand All @@ -26,9 +26,9 @@ export const RepositoryModel = {
apiVersion: 'v1alpha1',
label: 'Repository',
// t('Repository')
labelKey: 'plugin__pipeline-console-plugin~Repository',
labelKey: 'plugin__pipelines-console-plugin~Repository',
// t('Repositories')
labelPluralKey: 'plugin__pipeline-console-plugin~Repositories',
labelPluralKey: 'plugin__pipelines-console-plugin~Repositories',
plural: 'repositories',
abbr: 'R',
namespaced: true,
Expand Down

0 comments on commit 90a33ab

Please sign in to comment.