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

add "autocomplete" attr to input fields #49

Closed
icebob opened this issue Aug 25, 2016 · 18 comments
Closed

add "autocomplete" attr to input fields #49

icebob opened this issue Aug 25, 2016 · 18 comments

Comments

@icebob
Copy link
Member

icebob commented Aug 25, 2016

Same as "readonly". Add to every field which contains input element.
Example schema:

        let schema = {
            type: "text",
            label: "E-mail",
            model: "email",
            readonly: false,
            autocomplete: true,
            placeholder: "Field placeholder"
        };

Example template of field:

    input.form-control(type="email", v-model="value", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder", :autocomplete="schema.autocomplete")
@lionel-bijaoui
Copy link
Member

lionel-bijaoui commented Sep 1, 2016

I'm doing it
EDIT: Done #63

@icebob
Copy link
Member Author

icebob commented Sep 1, 2016

Great!

@lionel-bijaoui
Copy link
Member

lionel-bijaoui commented Sep 2, 2016

I fixed the problems, can you merge now ?

@icebob
Copy link
Member Author

icebob commented Sep 2, 2016

Need test cases too.

@lionel-bijaoui
Copy link
Member

lionel-bijaoui commented Sep 2, 2016

Does all of this count toward a new version ? 0.4.1 ?
If yes, could you do a milestone linked to the issue/PR ?
It is easier for me to know what's missing. Thank you.

@icebob icebob added this to the v0.4.1 milestone Sep 2, 2016
@icebob
Copy link
Member Author

icebob commented Sep 2, 2016

Ok, I did.

@lionel-bijaoui
Copy link
Member

lionel-bijaoui commented Sep 2, 2016

Thank you. #50 and #62 count toward what goal ?
I just want to have an idea of the roadmap for the plugin.

@icebob
Copy link
Member Author

icebob commented Sep 2, 2016

#62 is only docs, I linked to #64. #50 added to v0.5.0

@lionel-bijaoui
Copy link
Member

Wait, you mean custom fields are working ?

@icebob
Copy link
Member Author

icebob commented Sep 2, 2016

Yes, I think it is working already, just need to test it.

@lionel-bijaoui
Copy link
Member

Awesome !

@lionel-bijaoui
Copy link
Member

lionel-bijaoui commented Sep 2, 2016

@icebob For the test case, I propose to group attribute checking under "check optional attribute" inside "check template" :

describe("check optional attribute", () => {
    it("should set autocomplete", () =>{
        field.autocomplete = true;
        vm.$nextTick( () => {
            expect(input.autocomplete).to.be.true;
            field.autocomplete = false;
            done();
        });
    });

    it("should set disabled", (done) => {
        field.disabled = true;
        vm.$nextTick( () => {
            expect(input.disabled).to.be.true;  
            field.disabled = false;
            done();
        });
    });

    it("should set placeholder", (done) => {
        field.placeholder = "Placeholder text";
        vm.$nextTick( () => {
            expect(input.placeholder).to.be.equal("Placeholder text");
            field.placeholder = "";
            done();
        });
    });

    it("should set readOnly", (done) => {
        schema.readonly = true;
        vm.$nextTick( () => {
            expect(input.readOnly).to.be.true;  
            schema.readonly = false;
            done();
        });
    });
});

@icebob
Copy link
Member Author

icebob commented Sep 2, 2016

Good idea

@lionel-bijaoui
Copy link
Member

You will see in the PR #63 that I did a little more, and created a function checkAttribute in util.js so that we can write:

describe("check optional attribute", () => {
    // name which attributes you want to test and that's it.
    let attributes = ["disabled"];

    attributes.forEach(function(name) {
        it("should set " + name, function(done) {
            checkAttribute(name, vm, input, field, schema, done);
        });
    });
});

I hope we can merge now 😅

@icebob
Copy link
Member Author

icebob commented Sep 6, 2016

Good stuff!

@lionel-bijaoui
Copy link
Member

You are back ! :D

@lionel-bijaoui
Copy link
Member

@icebob What's blocking this milestone ?

@icebob
Copy link
Member Author

icebob commented Sep 8, 2016

Only my free time 😄

@icebob icebob closed this as completed Sep 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants