profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/SafaAlfulaij/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

SafaAlfulaij/amplify-pollCounter 0

A rewrite of the Serverless Voting App, this time using Amplify to manage the configuration and deployment of AWS resources.

SafaAlfulaij/angularjs-webpack 0

A complete, yet simple, starter for AngularJS using webpack

SafaAlfulaij/antergos-iso 0

Scripts based on archiso to create the Antergos ISO

SafaAlfulaij/aws-amplify-vue 0

A Vue.js starter app integrated with AWS Amplify

SafaAlfulaij/BidiRenderer 0

An example / demo application that illustrates the shaping and layout of complex text in bidirectional paragraphs using FriBidi, FreeType, and HarfBuzz

SafaAlfulaij/discourse 0

A platform for community discussion. Free, open, simple.

SafaAlfulaij/django-closure-tree 0

Closure view based Tree models for Django

SafaAlfulaij/django-lingua 0

Django database translation on the basis of gettext, stored in gettext file. Edit on the fly and the changes are instant available.

SafaAlfulaij/django-pipeline 0

Pipeline is an asset packaging library for Django.

push eventSafaAlfulaij/django-closure-tree

Safa Alfulaij

commit sha b4cee24879aefc337942bd4db30f77f89b6d20aa

Add files via upload

view details

push time in 9 days

push eventSafaAlfulaij/django-closure-tree

Safa Alfulaij

commit sha d45fb15d3b6f07b0a89683219130de7d4865ec41

Add files via upload

view details

push time in 9 days

fork SafaAlfulaij/django-closure-tree

Closure view based Tree models for Django

fork in 9 days

fork SafaAlfulaij/django-closure-tree

Closure view based Tree models for Django

fork in 9 days

startedmatthiask/django-tree-queries

started time in 19 days

pull request commentdjango-json-api/django-rest-framework-json-api

Cache included and related serializers

I'm sorry but I can't work on this anymore. I tried an approach where I set included_serializers and related_serializers to None if not provided, but it resulted in a bit more complicated code, you'll find it before applying the commit "Simplify caching included serializers".

SafaAlfulaij

comment created time in a month

issue commenttwbs/bootstrap

Fullscreen classses for offcanvas

It's possible yes, but then I have to use 4 classes, two for width responsiveness, and two for border responsiveness... I'm also thinking along with this #34247 to have modal and offcanvas similar (or exact) in functionality, since an offcanvas is actually a modal placed at the edge.

SafaAlfulaij

comment created time in a month

Pull request review commentdjango-json-api/django-rest-framework-json-api

Cache included and related serializers

 class PlainRelatedResourceTypeSerializer(serializers.Serializer):   def test_get_included_serializers():-    class IncludedSerializersModel(DJAModel):+    class DeprecatedIncludedSerializersModel(DJAModel):

Yup, it didn't work.

SafaAlfulaij

comment created time in a month

PullRequestReviewEvent

issue openedtwbs/bootstrap

[RTL] Offcanvas close button doesn't switch place

Bug: Offcanvas close button doesn't switch place: https://github.com/twbs/bootstrap/blob/a9d7a62658c5d93dcba5ed5fc47d84f3ddd3e0a3/scss/_offcanvas.scss#L25

Originally posted by @SafaAlfulaij in https://github.com/twbs/bootstrap/issues/32330#issuecomment-860143097

created time in a month

issue openedtwbs/bootstrap

Allow static backdrop in offcanvas

Offcanvas components should also be able to prevent the user from closing them by having a static backdrop. This will make modal and offcanvas share more code and similar functionality.

created time in a month

Pull request review commentdjango-json-api/django-rest-framework-json-api

Cache included and related serializers

 class PlainRelatedResourceTypeSerializer(serializers.Serializer):   def test_get_included_serializers():-    class IncludedSerializersModel(DJAModel):+    class DeprecatedIncludedSerializersModel(DJAModel):

I remember Django was telling me that it's not possible to do this, perhaps because I moved it outside of the function. Will try again.

SafaAlfulaij

comment created time in a month

PullRequestReviewEvent

issue openedmatthiask/django-tree-queries

[Request for Info] Difference between path and ordering

Hi! I got confused between path and ordering now that I'm using UUID as primary keys. I don't know how they should be with integer keys, hence this question. Currently, both fields are exactly equal. Is this right? Or is it because of my UUID primary keys? And what should each represent? Thanks and sorry if this looks like a basic database question :\

created time in a month

issue commenttwbs/bootstrap

RTL: remaining tasks

Bug: Offcanvas close button doesn't switch place: https://github.com/twbs/bootstrap/blob/a9d7a62658c5d93dcba5ed5fc47d84f3ddd3e0a3/scss/_offcanvas.scss#L25

ffoodd

comment created time in a month

issue commentorbitjs/orbit

Remotely generate IDs

For url generation, we can use the remote id directly (this.modal.remoteId)

This was the first thing I tried, but maybe I am missing some setup step because my models don't have this.model.remoteId.

What is the appropriate extension point to make that happen?

Oops, it's this.model.keys.remoteId, sorry. I have a proxy around the model data and got confused...

ef4

comment created time in a month

issue commentorbitjs/orbit

Remotely generate IDs

As I understood it, it is actually a good idea to do operations on local ids. For url generation, we can use the remote id directly (this.modal.remoteId), and use the third snippet to query from a given url, providing type-key-value. Otherwise, you can just do all operations with local ids, and the normalizer/mapper will map the local ids to the server ids, and save the server id (remoteId) in the map for future use.

Remote ids will be used for url generation, for queries from a url, for displaying the id to the user, and I believe that's it.

ef4

comment created time in a month

issue openedtwbs/bootstrap

Fullscreen classses for offcanvas

Add similar modal classes for fullscreen on different breakpoints to offcanvase for better viewport support (fullscreen on mobile). Related: #28683

created time in a month

issue commentorbitjs/orbit

Validate inverse relationships in schema

I had one thing I'd like to ask: Is atomic operations supported yet or not? I saw a PR, but couldn't really understand how to use it...

Thanks again!

SafaAlfulaij

comment created time in a month

issue closedorbitjs/orbit

Validate inverse relationships in schema

If you define an invalid relationship in the schema, and query MemorySource with a synced JSONAPISource, passing "include" to JSONAPISource, you'll get the final result of the query as an empty array.


const schema = new RecordSchema({
  models: {
    testModelTwo: { // no tests inverse
      attributes: {
        name: { type: 'string' },
      },
    },
    testModelOne: {
      attributes: {
        name: { type: 'string' },
      },
      relationships: {
        testModelTwo: { type: "hasOne", kind: "testModelTwo", inverse: "tests" } // here
      },
    },
  },
});

const memory = new MemorySource({ schema });
const remote = new JSONAPISource({ ... });


const coordinator = new Coordinator({
  sources: [memory, remote],
});

// Query the remote server whenever the memory is queried
coordinator.addStrategy(new RequestStrategy({
  source: 'memory',
  on: 'beforeQuery',
  target: 'remote',
  action: 'query',
  blocking: true,
}));

// Update the remote server whenever the memory is updated
coordinator.addStrategy(new RequestStrategy({
  source: 'memory',
  on: 'beforeUpdate',
  target: 'remote',
  action: 'push',
  blocking: true,
}));

// Sync all changes received from the remote server to the memory
coordinator.addStrategy(new SyncStrategy({
  source: 'remote',
  target: 'memory',
  blocking: true,
}));

await coordinator.activate();

let records = await memory.query(
    q => q.findRecords("testModelOne").sort("name"),
    {
        sources: {
            remote: {
                include: ["testModelTwo"]
            }
        }
    }
)

// records will be an empty array even though the API returns results.

closed time in a month

SafaAlfulaij

issue commentorbitjs/orbit

Validate inverse relationships in schema

Sorry for opening those many issues. I actually tried before swapping them as you mentioned, but it failed as well. I suspect the reason was that I already edited the library to swap them, so I should have reverted it back. My bad.

I think that this is actually a bug.

I'm closing all those issues now. Will wait for some documentation to be ready

And I'd like to thank you and all those who worked on this library. It is one-of-a-kind really! 👍🏻

SafaAlfulaij

comment created time in a month

issue closedorbitjs/orbit

removeRecord for a relationship attempts to remove all related relationships of the primary resource

Unfortunately I don't have a proper reproduce steps, but:

  • car is related to person (hasOne)
  • person has several cars (automatic reverse hasMany)

If you try and removeRecord a car, you'll notice that the operation is trying to set null on the whole cars relationship, instead of the one car we wanted to remove. image https://github.com/orbitjs/orbit/blob/9da431680e3bcedf9ae80e1fdd9a3407e3f3d169/packages/%40orbit/record-cache/src/operation-processors/sync-cache-integrity-processor.ts#L25-L34

The actual error being thrown is here: https://github.com/orbitjs/orbit/blob/1bcbe72a3083545efec06150b39549472829a7c5/packages/%40orbit/memory/src/memory-cache.ts#L191 Where r.relatedRecord is returning an array of all cars related to the person, which the array obviously doesn't have a type.

Or, I'm doing something wrong...

closed time in a month

SafaAlfulaij

issue commentorbitjs/orbit

removeRecord for a relationship attempts to remove all related relationships of the primary resource

You guessed correct, kind and type were swapped.

SafaAlfulaij

comment created time in a month

issue closedorbitjs/orbit

Possible bug in related record validation?

I'm not sure anymore, but it seems that this might a bug in validation, as it takes the type (hasOne/hasMany) rather than the kind (actual resource name).

https://github.com/orbitjs/orbit/blob/1bcbe72a3083545efec06150b39549472829a7c5/packages/%40orbit/records/src/record-validators/related-record-validator.ts#L119-L121

closed time in a month

SafaAlfulaij

issue commentorbitjs/orbit

Possible bug in related record validation?

You guessed correct, kind and type were swapped.

SafaAlfulaij

comment created time in a month

issue openedorbitjs/orbit

removeRecord for a relationship attempts to remove all related relationships of the primary resource

Unfortunately I don't have a proper reproduce steps, but:

  • car is related to person (hasOne)
  • person has several cars (automatic reverse hasMany)

If you try and removeRecord a car, you'll notice that the operation is trying to set null on the whole cars relationship, instead of the one car we wanted to remove. image https://github.com/orbitjs/orbit/blob/9da431680e3bcedf9ae80e1fdd9a3407e3f3d169/packages/%40orbit/record-cache/src/operation-processors/sync-cache-integrity-processor.ts#L25-L34

The actual error being thrown is here: https://github.com/orbitjs/orbit/blob/1bcbe72a3083545efec06150b39549472829a7c5/packages/%40orbit/memory/src/memory-cache.ts#L191 Where r.relatedRecord is returning an array of all cars related to the person, which the array obviously doesn't have a type.

Or, I'm doing something wrong...

created time in a month

pull request commentorbitjs/orbit

Introduce @orbit/validators and record-specific validators

fork was also missed...

dgeb

comment created time in 2 months

pull request commentorbitjs/orbit

Introduce @orbit/validators and record-specific validators

It seems that this missed the cache sources as they don't get the validatorFor, and fail on operations...

dgeb

comment created time in 2 months

issue openedorbitjs/orbit

Possible bug in related record validation?

I'm not sure anymore, but it seems that this might a bug in validation, as it takes the type (hasOne/hasMany) rather than the kind (actual resource name).

https://github.com/orbitjs/orbit/blob/1bcbe72a3083545efec06150b39549472829a7c5/packages/%40orbit/records/src/record-validators/related-record-validator.ts#L119-L121

created time in 2 months