Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: prevent credentials being stored from checkout #3014

Merged
merged 3 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v1
with:
node-version: '12'
Expand Down
76 changes: 76 additions & 0 deletions src/__deprecated__/components/fieldset/__definition__.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import Fieldset from '.';
import OptionsHelper from '../../../utils/helpers/options-helper';
import Definition from '../../../../demo/utils/definition';
import textboxDefinition from '../textbox/__definition__';

let definition = new Definition('fieldset', Fieldset, {
description: `Edits a set of closely related inputs that are grouped together.`,
designerNotes: `
* You can nest any Carbon input into this component.
* Useful for presenting a series of inputs that are closely related, within a wider Form or Pod (e.g. an address or contact details).
* Configure Pod and Fieldset components to work together, or choose the pre-configured Show/Edit Pod component.
* The [Show/Edit Pod](/components/show-edit-pod) component automatically presents content as a read-only Pod, until the user clicks an edit icon, which shows the same information in an editable Fieldset.
* But, configuring Pod and Fieldset components manually will give you more customization options, like the following.
* Top-aligned labels (Carbon default) or inline right-aligned labels are usually fastest for users.
* Create a single path to completion with your inputs, and between your inputs and the primary action Button.
* Indicate mandatory, or optional fields, whichever is the minority. Think carefully before collecting optional data - don’t collect information you don’t need! Try suffixing ‘(optional)’ after your field label.
* More guidance is available for each of the individual inputs you might place inside this component.
`,
relatedComponentsNotes: `
* Filling in a broad series of inputs? [Try Form](/components/form).
* Viewing content that’s grouped together visually? [Try Pod](/components/pod).
* Using Fieldset and Pod components together? [Try Show/Edit Pod](/components/show-edit-pod).
* Creating a new entity that is usually presented in a pod? [Try Create](/components/create).
`,
propTypes: {
legend: "String"
},
propDescriptions: {
legend: "Adds a legend to the fieldset."
}
});

definition.addChildByDefinition(textboxDefinition, {
fieldHelp: null,
labelHelp: null,
labelInline: true,
label: "First Name",
labelAlign: "right",
});
definition.addChildByDefinition(textboxDefinition, {
fieldHelp: null,
labelHelp: null,
labelInline: true,
label: "Last Name",
labelAlign: "right",
});
definition.addChildByDefinition(textboxDefinition, {
fieldHelp: null,
labelHelp: null,
labelInline: true,
label: "Address",
labelAlign: "right",
});
definition.addChildByDefinition(textboxDefinition, {
fieldHelp: null,
labelHelp: null,
labelInline: true,
label: "City",
labelAlign: "right",
});
definition.addChildByDefinition(textboxDefinition, {
fieldHelp: null,
labelHelp: null,
labelInline: true,
label: "Country",
labelAlign: "right",
});
definition.addChildByDefinition(textboxDefinition, {
fieldHelp: null,
labelHelp: null,
labelInline: true,
label: "Telephone",
labelAlign: "right",
});

export default definition;
51 changes: 51 additions & 0 deletions src/__deprecated__/components/fieldset/__spec__.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from 'react';
import TestUtils from 'react-dom/test-utils';
import Fieldset from './fieldset';
import Textbox from '../textbox';
import { shallow } from 'enzyme';
import { elementsTagTest, rootTagTest } from '../../../utils/helpers/tags/tags-specs';

describe('Fieldset', () => {
let instance;

beforeEach(() => {
instance = TestUtils.renderIntoDocument(<Fieldset><Textbox /></Fieldset>);
});

it('renders its children', () => {
let child = TestUtils.findRenderedComponentWithType(instance, Textbox);
expect(child).toBeDefined();
});

it('applies any props to the fieldset', () => {
instance = TestUtils.renderIntoDocument(<Fieldset id="foo"><Textbox /></Fieldset>);
let child = TestUtils.findRenderedDOMComponentWithTag(instance, 'fieldset');
expect(child.id).toEqual('foo');
});

describe('if a legend is supplied', () => {
it('renders its legend', () => {
instance = TestUtils.renderIntoDocument(<Fieldset legend="foo"><Textbox /></Fieldset>);
let child = TestUtils.findRenderedDOMComponentWithTag(instance, 'legend');
expect(child).toBeDefined();
});
});

describe("tags", () => {
describe("on component", () => {
let wrapper = shallow(<Fieldset data-element='bar' data-role='baz' />);

it('include correct component, element and role data tags', () => {
rootTagTest(wrapper, 'fieldset', 'bar', 'baz');
});
});

describe("on internal elements", () => {
let wrapper = shallow(<Fieldset legend='test' />);

elementsTagTest(wrapper, [
'legend'
]);
});
});
});
41 changes: 41 additions & 0 deletions src/__deprecated__/components/fieldset/docgenInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"src/components/fieldset/fieldset.js": [
{
"description": "",
"displayName": "Fieldset",
"methods": [
{
"name": "legend",
"docblock": "Returns the legend if on is defined.\n\n@method legend\n@return {Object} JSX",
"modifiers": [
"get"
],
"params": [],
"returns": {
"description": "JSX",
"type": {
"name": "Object"
}
},
"description": "Returns the legend if on is defined."
}
],
"props": {
"children": {
"type": {
"name": "node"
},
"required": false,
"description": "Children elements"
},
"legend": {
"type": {
"name": "string"
},
"required": false,
"description": "A label for the fieldset."
}
}
}
]
}
16 changes: 16 additions & 0 deletions src/__deprecated__/components/fieldset/documentation/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Designer Notes
- You can nest any Carbon input into this component.
- Useful for presenting a series of inputs that are closely related, within a wider Form or Pod (e.g. an address or contact details).
- Configure Pod and Fieldset components to work together, or choose the pre-configured Show/Edit Pod component.
-The Show/Edit Pod component automatically presents content as a read-only Pod, until the user clicks an edit icon, which shows the same information in an editable Fieldset.
- But, configuring Pod and Fieldset components manually will give you more customization options, like the following.
- Top-aligned labels (Carbon default) or inline right-aligned labels are usually fastest for users.
- Create a single path to completion with your inputs, and between your inputs and the primary action Button.
- Indicate mandatory, or optional fields, whichever is the minority. Think carefully before collecting optional data - don’t collect information you don’t need! Try suffixing ‘(optional)’ after your field label.
- More guidance is available for each of the individual inputs you might place inside this component.

# Related Components
- Filling in a broad series of inputs? [Try Form](/components/form "Form").
- Viewing content that’s grouped together visually? [Try Pod](/components/pod "Pod").
- Using Fieldset and Pod components together? [Try Show/Edit Pod](/components/show-edit-pod "Show/Edit Pod").
- Creating a new entity that is usually presented in a pod? [Try Create](/components/create, "Create").
59 changes: 59 additions & 0 deletions src/__deprecated__/components/fieldset/fieldset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { validProps } from '../../../utils/ether';
import tagComponent from '../../../utils/helpers/tags';
import './fieldset.scss';

class Fieldset extends React.Component {
static propTypes = {
/**
* Children elements
*/
children: PropTypes.node,

/**
* A label for the fieldset.
*/
legend: PropTypes.string
};


/**
* Returns the legend if on is defined.
*
* @method legend
* @return {Object} JSX
*/
get legend() {
if (!this.props.legend) { return null; }

return (
<legend className='carbon-fieldset__legend common-input__label' data-element='legend'>
{ this.props.legend }
</legend>
);
}

/**
* @method render
*/
render() {
const {
className, labelAlign, childOfForm, ...props
} = validProps(this);
const classes = classNames('carbon-fieldset', className);

return (
<fieldset
className={ classes } { ...props }
{ ...tagComponent('fieldset', this.props) }
>
{ this.legend }
{ this.props.children }
</fieldset>
);
}
}

export default Fieldset;
63 changes: 63 additions & 0 deletions src/__deprecated__/components/fieldset/fieldset.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@import "./../../../style-config/input-field";

.carbon-fieldset {
border: none;
margin: 0;
padding: 0;

[data-component='icon'].carbon-input-icon,
.common-input__icon {
z-index: 2;
[data-element='error'] {
top: 5px;
}
}

.common-input__input--error {
position: relative;
z-index: 1;
}

.common-input__icon--warning {
right: 5px;
top: 6px;
z-index: 2;
}

.common-input__input:focus,
.common-input__input:hover {
position: relative;
z-index: 2;
}

.common-input + .common-input {
margin-top: -1px;

.common-input__input {
border-radius: 0;
}
}

.common-input:first-child {
.common-input__input {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
}

.common-input:last-child {
.common-input__input {
border-radius: 0 0 $input-border-radius $input-border-radius;
}
}

.common-input--readonly {
.common-input__input {
border: $input-common-border;
}

.common-input__input:hover {
border: $input-common-border;
}
}
}
67 changes: 67 additions & 0 deletions src/__deprecated__/components/fieldset/fieldset.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { text } from '@storybook/addon-knobs';
import { classicThemeSelector } from '../../../../.storybook/theme-selectors';
import notes from './documentation/notes.md';
import Fieldset from './fieldset';
import Textbox from '../textbox';
import getDocGenInfo from '../../../utils/helpers/docgen-info';

Fieldset.__docgenInfo = getDocGenInfo(
require('./docgenInfo.json'),
/fieldset(?!spec)/
);

storiesOf('__deprecated__/Fieldset', module)
.addParameters({
info: {
propTablesExclude: [Textbox]
},
chromatic: {
disable: true
}
})
.add('classic', () => {
const legend = text('legend', '');

return (
<Fieldset
legend={ legend }
>
<Textbox
label='First Name'
labelInline
labelAlign='right'
/>
<Textbox
label='Last Name'
labelInline
labelAlign='right'
/>
<Textbox
label='Address'
labelInline
labelAlign='right'
/>
<Textbox
label='City'
labelInline
labelAlign='right'
/>
<Textbox
label='Country'
labelInline
labelAlign='right'
/>
<Textbox
label='Telephone'
labelInline
labelAlign='right'
/>
</Fieldset>
);
}, {
notes: { markdown: notes },
knobs: { escapeHTML: false },
themeSelector: classicThemeSelector
});
4 changes: 4 additions & 0 deletions src/__deprecated__/components/fieldset/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"main": "./fieldset.js",
"name": "Fieldset"
}