Skip to content

Commit

Permalink
Fix component imports within components package
Browse files Browse the repository at this point in the history
Instead of referencing `@tektoncd/dashboard-components`, imports
within the `components` package that reference other components
should load them locally from the index. This will be more important
in future when we provide the ability to override / customise parts
of the UI via extensions.
  • Loading branch information
AlanGreene committed Mar 11, 2022
1 parent 85994c6 commit e763aa1
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 20 deletions.
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -28,7 +28,6 @@
"carbon-components": "^10.52.0",
"carbon-components-react": "^7.52.0",
"carbon-icons": "^7.0.7",
"classnames": "^2.2.6",
"core-js": "^3.20.3",
"git-url-parse": "^11.3.0",
"history": "^4.10.1",
Expand Down
1 change: 1 addition & 0 deletions packages/components/package.json
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"@tektoncd/dashboard-utils": "file:../utils",
"classnames": "^2.3.1",
"js-yaml": "^3.13.0",
"linkify-it": "^3.0.2",
"prop-types": "^15.7.2",
Expand Down
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
import React from 'react';
import { injectIntl } from 'react-intl';
import { Modal } from 'carbon-components-react';
import { Table } from '@tektoncd/dashboard-components';
import { Table } from '..';

const DeleteModal = ({
onClose,
Expand Down
11 changes: 8 additions & 3 deletions packages/components/src/components/PipelineRuns/PipelineRuns.js
@@ -1,5 +1,5 @@
/*
Copyright 2019-2021 The Tekton Authors
Copyright 2019-2022 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -14,12 +14,17 @@ limitations under the License.
import React from 'react';
import { injectIntl } from 'react-intl';
import { Link } from 'react-router-dom';
import { StatusIcon, Table } from '@tektoncd/dashboard-components';
import { getStatus, taskRunHasWarning, urls } from '@tektoncd/dashboard-utils';
import { Pending24 as DefaultIcon } from '@carbon/icons-react';
import { Link as CarbonLink } from 'carbon-components-react';

import { FormattedDate, FormattedDuration, RunDropdown } from '..';
import {
FormattedDate,
FormattedDuration,
RunDropdown,
StatusIcon,
Table
} from '..';

const PipelineRuns = ({
batchActionButtons = [],
Expand Down
Expand Up @@ -16,12 +16,7 @@ import PropTypes from 'prop-types';
import { injectIntl } from 'react-intl';
import { InlineNotification, SkeletonText, Tag } from 'carbon-components-react';
import { formatLabels, getErrorMessage } from '@tektoncd/dashboard-utils';
import {
FormattedDate,
Tab,
Tabs,
ViewYAML
} from '@tektoncd/dashboard-components';
import { FormattedDate, Tab, Tabs, ViewYAML } from '..';

const tabs = ['overview', 'yaml'];

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/RunDropdown/RunDropdown.js
@@ -1,5 +1,5 @@
/*
Copyright 2019-2021 The Tekton Authors
Copyright 2019-2022 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -14,7 +14,7 @@ limitations under the License.
import React, { Component } from 'react';
import { injectIntl } from 'react-intl';
import { OverflowMenu, OverflowMenuItem } from 'carbon-components-react';
import { Modal } from '@tektoncd/dashboard-components';
import { Modal } from '..';

class RunDropdown extends Component {
state = { showDialog: false };
Expand Down
5 changes: 3 additions & 2 deletions packages/components/src/components/Task/Task.js
@@ -1,5 +1,5 @@
/*
Copyright 2019-2021 The Tekton Authors
Copyright 2019-2022 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -16,12 +16,13 @@ import {
PendingFilled20 as DefaultIcon,
ChevronDown20 as ExpandIcon
} from '@carbon/icons-react';
import { StatusIcon, Step } from '@tektoncd/dashboard-components';
import {
getStepStatusReason,
updateUnexecutedSteps
} from '@tektoncd/dashboard-utils';

import { StatusIcon, Step } from '..';

class Task extends Component {
state = { hasWarning: false, selectedStepId: null };

Expand Down
11 changes: 8 additions & 3 deletions packages/components/src/components/TaskRuns/TaskRuns.js
@@ -1,5 +1,5 @@
/*
Copyright 2019-2021 The Tekton Authors
Copyright 2019-2022 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -14,11 +14,16 @@ limitations under the License.
import React from 'react';
import { injectIntl } from 'react-intl';
import { Link } from 'react-router-dom';
import { StatusIcon } from '@tektoncd/dashboard-components';
import { getStatus, taskRunHasWarning, urls } from '@tektoncd/dashboard-utils';
import { Link as CarbonLink } from 'carbon-components-react';

import { FormattedDate, FormattedDuration, RunDropdown, Table } from '..';
import {
FormattedDate,
FormattedDuration,
RunDropdown,
StatusIcon,
Table
} from '..';

const TaskRuns = ({
batchActionButtons = [],
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/Trigger/Trigger.js
Expand Up @@ -22,7 +22,7 @@ import {
UnorderedList
} from 'carbon-components-react';
import { urls } from '@tektoncd/dashboard-utils';
import { Table, ViewYAML } from '@tektoncd/dashboard-components';
import { Table, ViewYAML } from '..';

const Trigger = ({ intl, namespace, trigger }) => {
const tableHeaders = [
Expand Down

0 comments on commit e763aa1

Please sign in to comment.