Giter Site home page Giter Site logo

armstrong-edge's People

Contributors

adam-cove avatar adamiprinciples avatar b54690 avatar bennlongg avatar benrockets avatar clarehenningmarsh avatar james-norris1 avatar jlews avatar jonnygwi avatar judithrocketmakers avatar kahnix avatar nathanrhd avatar norgru avatar patrickbenjamin1 avatar semantic-release-bot avatar tomrocketmakers avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

armstrong-edge's Issues

More form control css variables

Overview

We need more variables to control some form properties

Bug report (delete if not a bug report)

It'd be great to add a few more variables to control

  • default form field width
  • form field background color
  • form field foreground color

Mouse up on modal/dialog obscurer layer closing dialog

Bug report

Because the dialog obscurer layer closes the dialog on a mouse up event, it means trying to select text inside a form in a dialog can easily cause it to close which is pretty annoying usability-wise.

Expected Behaviour

Dialog dismissal should be triggered via mouse capture, not just mouse up

Actual Behaviour

Any mouse up event closes the dialog. Try making a dialog with an input in and dragging some text selection, then letting go outside of the dialog. You'll see what I mean.

Child form validation errors

Bug report (delete if not a bug report)

Unable to trigger client validation messages for child forms from the parent

Expected Behaviour

const { formProp } = useForm({child: {wow: ''}, hello: ''})

<ChildForm bind={formProp('child').bind()} />
<TextInput  bind={formProp('hello').bind()} />

both these methods should trigger validation messages

addValidationError({key: 'child.wow', message: 'error'})
formProp('child', 'wow').addValidationError('error')

Actual Behaviour

validation message is not triggered

Armstrong dropdown fix

Overview

I want to work around a bug in Armstrong which incorrectly displays calendar dropdowns

Bug report (delete if not a bug report)

Projects using iOS calendar dropdown should use native device calendar inputs instead of Dropdown

Subtasks

  • CalendarInput should use native device calendar inputs instead of Dropdown
  • Dropdown should be deprecated
  • Unit Tests
  • Storybook

Notes

"I’ve had a look into this and it looks like the correct-er solution is to deprecate CalendarInput in favour of NativeDateInput (and probably also deprecate Dropdown) and then make sure that deprecation is followed through on projects. This means there’s not directly work to do exactly on this ticket, but we need to do some work re: Armstrong product management."

[Dialog Hook] Resolve has implicit any type in dialog hook

Overview

Resolve promise in dialog hooks has implicit any so won't work in projects where this is not allowed.

Bug report (delete if not a bug report)

Expected Behaviour

The 'resolve' property of the useDialog constructor should be typed as Promise<T> with T coming from the first type parameter of the use dialog constructor, e.g useDialog<boolean>({ resolve )) where resolve would be Promise<boolean>

Actual Behaviour

image

Steps to Reproduce

See above image

Add code examples to stories

Overview

Storybook should have code examples

Bug report

MDX plugin is now SB7 compatible so we can add these back in

ScrollToEndListener not firing when scrolling to end of the page.

Overview

ScrollToEndListener not firing when scrolling to end of the page.

Bug report (delete if not a bug report)

ScrollToEndListener not firing when scrolling to end of the page.

Expected Behaviour

To load additional fetches from the API once scrolled to the bottom of the screen

Actual Behaviour

Loads the intial fetch but then doesn't load anymore afterwards once scrolled to the bottom

Steps to Reproduce

export const RewardsView: React.FC = () => {
  const totalBiscuits = 45700;

  const { accessToken } = React.useContext(Auth0Context);

  const getRewards = apiHooks(accessToken).rewardClient.rewardsGet.useRequest();

  const fetchItems = React.useCallback(async (pageToken?: PageToken): Promise<IInfinitePagingResult<Reward>> => {
    if (!pageToken) {
      console.log('No page token:', pageToken);

      return { data: [] };
    }
    const { data } = await getRewards({ page: +pageToken, pageSize: 1 });
    console.log('current items', data?.data, 'current page:', pageToken, 'and next page: ', data?.paging?.next);
    return { data: data?.data || [], nextPageToken: data?.paging?.next || 1 };
  }, []);

  const { items, loadMore } = useInfinitePaging<Reward>(fetchItems, (item) => item?.id?.value || '', {
    firstPageToken: 1,
    pageSize: 1,
  });

  return (
    <View title="Rewards" className={styles.rewardsView} unpadded={true}>
      <div className={styles.totalBiscuit}>
        <h3>Total Biscuits</h3>
        <div>
          <img src={BiscuitLogoPurple} />
          {totalBiscuits.toLocaleString()}
        </div>
      </div>
      <div className={styles.totalBiscuit}>
        <h3>Total Biscuits</h3>
        <div>
          <img src={BiscuitLogoPurple} />
          {totalBiscuits.toLocaleString()}
        </div>
      </div>
      <ScrollToEndListener
        onScrollToEnd={async () => {
          console.log('Scrolled to end');
          await loadMore();
        }}
        rootMargin={'77px'}
      >
        {items.map((item) => {
          return (
            <RewardCard
              key={item?.id?.value}
              image={BiscuitLogoPurple}
              biscuitValue={item.priority}
              company={item.name}
              value={item.price}
              category={item?.category?.name}
            />
          );
        })}
      </ScrollToEndListener>
    </View>
  );
};

Internal

We use JIRA for issue tracking internally. If you're in Rocketmakers and you have an issue to raise, raise a ticket in JIRA and notify the #armstrong Slack channel.

Bound Input of type Number doesn't allow trailing zeros

Bug report

Bound Input of type Number doesn't allow trailing zeros

Expected Behaviour

Should let me enter a value like 1.0404

Actual Behaviour

The second zero cannot be entered

Steps to Reproduce

Add input of type number, try to enter 1.0405

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


No npm token specified.

An npm token must be created and set in the NPM_TOKEN environment variable on your CI environment.

Please make sure to create an npm token and to set it in the NPM_TOKEN environment variable on your CI environment. The token must allow to publish to the registry https://registry.npmjs.org/.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Calendar icon image on click does not open the calendar

Bug report

When clicking on the calendar icon the calendar does not open.

Both on right overlay and left overlay.

Expected Behaviour

When clicking on either overlay the icon the calendar opens.

Actual Behaviour

When clicking on either overlay the icon the calendar does not open.

Steps to Reproduce

Internal

We use JIRA for issue tracking internally. If you're in Rocketmakers and you have an issue to raise, raise a ticket in JIRA and notify the #armstrong Slack channel.

CalendarInput is broken on iOS

Overview

I want Armstrong to have a new component for...

Bug report (delete if not a bug report)

Expected Behaviour

Native date picker

Actual Behaviour

The html dropdown flies off wildly depending on how tall the page is and what the keyboard opens

Steps to Reproduce

Use it on iOS

Internal

We use JIRA for issue tracking internally. If you're in Rocketmakers and you have an issue to raise, raise a ticket in JIRA and notify the #armstrong Slack channel.

Check state on <CheckboxInput /> not matching provided state if defaults to true and not bound

Expected Behaviour

should be displayed as checked

Actual Behaviour

is not displayed as checked

Steps to Reproduce

export const IsCheckedComponent: React.FC = () => {
  const [isChecked, setIsChecked] = React.useState<boolean>(true);

  return (
    <>
      <CheckboxInput checked={isChecked} onClick={() => setIsChecked(!isChecked)} />
      {isChecked ? 'Is checked' : 'Is not checked'}
    </>
  );
};

I think the culprit is line 73 within module/src/components/checkboxInput/checkboxInput.component.tsx where it’s initial value should be equal to checkedinstead of false

Form Inputs Taking Native Element Props

Overview

I want Armstrong form inputs to take props for underlying native input elements via an explicit key (e.g. nativeInputProps), rather than being optional in the component props themselves.

An example is the RangeInput taking step as a prop, whereas it does not appear / is not implicitly referenced in the documentation args table.

https://rocketmakers.github.io/armstrong-edge/?path=/docs/form-range-input--default#with-steps

Internal

https://rocketmakers.atlassian.net/browse/ARM-198

Formprop set doesn't work for string union property types

Bug report

Expected Behaviour

Should be able to use formProp('stringUnionField').set('stringUnionValue')

Actual Behaviour

Get Argument of type 'string' is not assignable to parameter of type 'never'

image

Steps to Reproduce

Create a form bound to any object with one of the properties being a string union type, e.g

export type ExecutionType = 'scheduled' | 'manual';

export interface IJob {
  id?: string;
  jobName: string;
  vendorConfig: string;
  companyConfig: string;
  customerConfig: string;
  executionType: ExecutionType;
}

then just try to manually set the property, for example

formProp('executionType').set('scheduled')

useDialog not displaying up to date value from external state

Bug report (delete if not a bug report)

Expected Behaviour

Should be able to pass a value from state into a dialog via the useDialog hook

Actual Behaviour

State value displayed in dialog is always one update behind.

Steps to Reproduce

const [coolGuy,setCoolGuy] = React.useState("Patrick");
const [open] = useDialog<any, any>((p) =><div>{coolGuy}</div>)

 return (<div>
   {coolGuy}
  <Button onClick={() => setCoolGuy(coolGuy === "Patrick" ? "Adam" : "Patrick")}>Toggle guy</Button>
  <Button onClick={open}>Open dialog</Button>
</div>
)

Using a simple example like above, clicking the button will toggle the name in state. Opening the dialog you'll see the previous value displayed. Opening it a second time without changing state you'll see the new value.

CalendarInput returning a string when passed a number

Bug report

When you pass a number to a CalendarInput it returns a date string rather than a number, even though the formatters (toData/fromData) claim it's a number

Expected Behaviour

Passing a number in to the binder should return a number in the form state

Actual Behaviour

A date string is returned

Steps to Reproduce

 const { formProp, formState } = Form.use<ICreateStagingJobApiParams>({
    vendorId: '',
    companyId: '',
    customerId: '',
    juniperProductId: '',
    oldestReleaseDate: 0,
    maxFirmware: 0,
  });
 <CalendarInput displayMode="inputs" bind={formProp('oldestReleaseDate').bind()}/>

Log form state, oldestReleaseDate will be a date string

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.