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

feat: add event card to new ui #1055

Merged
merged 17 commits into from
May 22, 2024
Merged

feat: add event card to new ui #1055

merged 17 commits into from
May 22, 2024

Conversation

adong
Copy link
Contributor

@adong adong commented May 14, 2024

Context

Add event card and meta data info to event card

Objective

Build on top of #1040

Screenshot:

Regular Card
image

Card with parameters
image

image

References

License

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@adong adong marked this pull request as draft May 15, 2024 16:34
@adong adong force-pushed the adong/newui-eventcard branch from 579ebd9 to 2e14b43 Compare May 21, 2024 17:47
@adong adong marked this pull request as ready for review May 21, 2024 17:54
@adong adong changed the title [New UI] Code refactoring feat: add event card to new ui May 21, 2024
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { inject as service } from '@ember/service';
import { service } from '@ember/service';

Comment on lines +9 to +12
const eventId =
get(model, 'events.firstObject.id') === undefined
? 0
: get(model, 'events.firstObject.id');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const eventId =
get(model, 'events.firstObject.id') === undefined
? 0
: get(model, 'events.firstObject.id');
const eventId = model.events.firstObject.id;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the changes, and it needs to be reverted back. See error

image

@@ -1,9 +1,38 @@
import Route from '@ember/routing/route';
import RSVP from 'rsvp';
import { inject as service } from '@ember/service';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { inject as service } from '@ember/service';
import { service } from '@ember/service';

@@ -1,9 +1,14 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { inject as service } from '@ember/service';
import { service } from '@ember/service';

@@ -1,6 +1,20 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { inject as service } from '@ember/service';
import { service } from '@ember/service';

Comment on lines +65 to +66
font-size: 14px;
font-style: normal;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should safe to remove

Comment on lines +75 to +76
font-style: normal;
font-weight: 400;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should safe to remove

Comment on lines 6 to 7
import { Promise as EmberPromise } from 'rsvp';
import Service from '@ember/service';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { Promise as EmberPromise } from 'rsvp';
import Service from '@ember/service';
import sinon from 'sinon';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to add sinon to the dev dependencies and can also remove ember-sinon

Comment on lines 16 to 27
const userSettingsStub = Service.extend({
getUserPreference() {
return new EmberPromise(resolve => {
resolve({
timestampFormat: 'UTC'
});
});
}
});

this.owner.unregister('service:userSettings');
this.owner.register('service:userSettings', userSettingsStub);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const userSettingsStub = Service.extend({
getUserPreference() {
return new EmberPromise(resolve => {
resolve({
timestampFormat: 'UTC'
});
});
}
});
this.owner.unregister('service:userSettings');
this.owner.register('service:userSettings', userSettingsStub);
const userSettings = this.owner.lookup('service:user-settings');
sinon.stub(userSettings, 'getUserPreference').resolves({timestampFormat: 'UTC'});

beforeModel() {
const { pipeline } = this.modelFor('v2.pipeline');

if (pipeline.get('childPipelines')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (pipeline.get('childPipelines')) {
if (pipeline.childPipelines) {

@adong adong merged commit c636204 into master May 22, 2024
2 checks passed
@adong adong deleted the adong/newui-eventcard branch May 22, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants